diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd10fb3..b6c6bff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,174 +1,183 @@
 cmake_minimum_required (VERSION 2.6 FATAL_ERROR)
 
 project(ExternalDataFitter)
 
 enable_language(Fortran)
 
 set (ExtFit_VERSION_MAJOR 1)
 set (ExtFit_VERSION_MINOR 0) #The q+1'th letter of the alphabet
 set (ExtFit_VERSION_REVISION 0)
 
 set (ExtFit_VERSION_STRING "v${ExtFit_VERSION_MAJOR}r${ExtFit_VERSION_MINOR}")
 if(${ExtFit_VERSION_REVISION} STRGREATER "0")
   set (ExtFit_VERSION_STRING "${ExtFit_VERSION_STRING}p${ExtFit_VERSION_REVISION}")
 endif()
 
 set (VERBOSE TRUE)
 
 set (CMAKE_SKIP_BUILD_RPATH TRUE)
 
 if(NOT DEFINED NOTEST OR NOT NOTEST)
   enable_testing()
 endif()
 
 include(${CMAKE_SOURCE_DIR}/cmake/cmessage.cmake)
 
 if(NOT DEFINED USE_NEUT AND
   NOT DEFINED USE_NuWro AND
   NOT DEFINED USE_GENIE AND
   NOT DEFINED USE_T2K AND
   NOT DEFINED USE_NIWG AND
   NOT DEFINED USE_GiBUU AND
   NOT DEFINED USE_NUANCE)
   cmessage(FATAL_ERROR "No reweight engines requested. Configure with at least "
     "one of -DUSE_{NEUT,NuWro,GENIE,NIWG,T2K,GiBUU,NUANCE}.")
 else()
   cmessage(STATUS "Generator Input Support:
   		  NEUT:${USE_NEUT},
   		  NuWro:${USE_NuWro},
 		  GENIE:${USE_GENIE},
 		  NIWG:${USE_NIWG},
   		  GiBUU:${USE_GiBUU},
 		  NUANCE:${USE_NUANCE}")
 endif()
 
 #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()
 
 cmessage(STATUS "CMAKE_INSTALL_PREFIX: \"${CMAKE_INSTALL_PREFIX}\"")
 
 if(CMAKE_BUILD_TYPE STREQUAL "")
   set(CMAKE_BUILD_TYPE DEBUG)
 elseif(NOT DEFINED CMAKE_BUILD_TYPE)
   set(CMAKE_BUILD_TYPE DEBUG)
 endif()
 
 cmessage(STATUS "CMAKE_BUILD_TYPE: \"${CMAKE_BUILD_TYPE}\"")
 
 ################################################################################
 #                            Check Dependencies
 ################################################################################
 
 ##################################  ROOT  ######################################
 include(${CMAKE_SOURCE_DIR}/cmake/ROOTSetup.cmake)
 
 ############################  Reweight Engines  ################################
 include(${CMAKE_SOURCE_DIR}/cmake/ReweightEnginesSetup.cmake)
 
+############################### GiBUU + NUANCE  ####################################
+
+if(DEFINED USE_EXP AND USE_EXP)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINMEMORYEVENTCLASS")
+endif()
+
+if(DEFINED USE_GiBUU AND USE_GiBUU)
+  cmessage(STATUS "Included GiBUU")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GiBUU_ENABLED__")
+  include(${CMAKE_SOURCE_DIR}/cmake/GiBUUSetup.cmake)
+endif()
+
+if(DEFINED USE_NUANCE AND USE_NUANCE)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NUANCE_ENABLED__")
+endif()
+
 #################################  Pythia6  ####################################
 include(${CMAKE_SOURCE_DIR}/cmake/pythia6Setup.cmake)
 
 ################################## COMPILER ####################################
 include(${CMAKE_SOURCE_DIR}/cmake/c++CompilerSetup.cmake)
 
 ################################################################################
 
 ################################# gperftools ###################################
 
 include(${CMAKE_SOURCE_DIR}/cmake/gperfSetup.cmake)
 
 ################################### doxygen ###################################
 
 include(${CMAKE_SOURCE_DIR}/cmake/docsSetup.cmake)
 
-################################################################################
-
-if(DEFINED USE_EXP AND USE_EXP)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DINMEMORYEVENTCLASS")
-endif()
-
-if(DEFINED USE_GiBUU AND USE_GiBUU)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GiBUU_ENABLED__")
-  include(${CMAKE_SOURCE_DIR}/cmake/GiBUUSetup.cmake)
-endif()
-
-if(DEFINED USE_NUANCE AND USE_NUANCE)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NUANCE_ENABLED__")
-endif()
-
-################################################################################
+###############################################################################
 
 set(MINCODE
   Routines
   FCN)
 
 set(CORE
   MCStudies
+  Genie
   FitBase
+  InputHandler
   Splines
+  Reweight
   Utils
   #Devel
   )
 
 
 ###############
 # Allow compilation against single experiment folder
 # Add later..
 ##############
 
 set(EXPERIMENTS
   ANL
   ArgoNeuT
   BEBC
   BNL
+  Electron
   FNAL
   GGM
   K2K
   MINERvA
   MiniBooNE
   SciBooNE
   T2K)
 
 set(EXP_INCLUDE_DIRECTORIES)
 
 foreach(edir ${EXPERIMENTS})
   set(EXP_INCLUDE_DIRECTORIES ${EXP_INCLUDE_DIRECTORIES};${CMAKE_SOURCE_DIR}/src/${edir})
 endforeach()
 cmessage(STATUS "Included experiments: ${EXP_INCLUDE_DIRECTORIES}")
 
 foreach(mdir ${MINCODE})
   cmessage (STATUS "Configuring directory: src/${mdir}")
   add_subdirectory(src/${mdir})
 endforeach()
 
 foreach(edir ${EXPERIMENTS})
   cmessage (STATUS "Configuring directory: src/${edir}")
   add_subdirectory(src/${edir})
 endforeach()
 
 foreach(cdir ${CORE})
   cmessage (STATUS "Configuring directory: src/${cdir}")
   add_subdirectory(src/${cdir})
 endforeach()
 
 cmessage(STATUS "Module targets:  ${MODULETargets}")
 
 add_subdirectory(app)
 add_subdirectory(src/Tests)
 
 configure_file(cmake/setup.sh.in
   "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" @ONLY)
 install(FILES
   "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/setup.sh" DESTINATION
   ${CMAKE_INSTALL_PREFIX})
 
+
 install(PROGRAMS
   "${PROJECT_SOURCE_DIR}/scripts/nuiscardgen" DESTINATION
   bin)
 
+install(PROGRAMS
+  "${PROJECT_SOURCE_DIR}/scripts/nuissamples" DESTINATION
+  bin)
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 788dbbe..de45ddd 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,127 +1,145 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 set(TARGETS_TO_BUILD)
 
 if(USE_MINIMIZER)
   add_executable(nuismin nuismin.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuismin)
   target_link_libraries(nuismin ${MODULETargets})
   target_link_libraries(nuismin ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(nuismin ${ROOT_LIBS})
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
     set_target_properties(nuismin PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
 
   add_executable(nuissplines nuissplines.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuissplines)
   target_link_libraries(nuissplines ${MODULETargets})
   target_link_libraries(nuissplines ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(nuissplines ${ROOT_LIBS})
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
     set_target_properties(nuissplines PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
 
 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/Utils)
 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(${EXP_INCLUDE_DIRECTORIES})
 
+if (BUILD_GEVGEN)
+  add_executable(gevgen_nuisance gEvGen_NUISANCE.cxx)
+  set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};gevgen_nuisance)
+  target_link_libraries(gevgen_nuisance ${MODULETargets})
+  target_link_libraries(gevgen_nuisance ${CMAKE_DEPENDLIB_FLAGS})
+  target_link_libraries(gevgen_nuisance ${ROOT_LIBS})
+  include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+  include_directories(${GENIE_INCLUDES}/Apps)
+  include_directories(${GENIE_INCLUDES}/FluxDrivers)
+  include_directories(${GENIE_INCLUDES}/EVGDrivers)
+  if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
+    set_target_properties(gevgen_nuisance PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
+  endif()
+endif()
+
 if (USE_GiBUU)
   add_executable(DumpGiBUUEvents DumpGiBUUEvents.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};DumpGiBUUEvents)
   target_link_libraries(DumpGiBUUEvents ${MODULETargets})
   target_link_libraries(DumpGiBUUEvents ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(DumpGiBUUEvents ${ROOT_LIBS})
   include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
     set_target_properties(DumpGiBUUEvents PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
 endif()
 
 add_executable(nuiscomp nuiscomp.cxx)
 set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuiscomp)
 target_link_libraries(nuiscomp ${MODULETargets})
 target_link_libraries(nuiscomp ${CMAKE_DEPENDLIB_FLAGS})
 target_link_libraries(nuiscomp ${ROOT_LIBS})
 if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
   set_target_properties(nuiscomp PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
 endif()
 
 add_executable(nuisflat nuisflat.cxx)
 set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuisflat)
 target_link_libraries(nuisflat ${MODULETargets})
 target_link_libraries(nuisflat ${CMAKE_DEPENDLIB_FLAGS})
 target_link_libraries(nuisflat ${ROOT_LIBS})
 if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
   set_target_properties(nuisflat PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
 endif()
 
 
 add_executable(nuissyst nuissyst.cxx)
 set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};nuissyst)
 target_link_libraries(nuissyst ${MODULETargets})
 target_link_libraries(nuissyst ${CMAKE_DEPENDLIB_FLAGS})
 target_link_libraries(nuissyst ${ROOT_LIBS})
 if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
   set_target_properties(nuissyst PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
 endif()
 
 if(USE_GENIE)
   add_executable(PrepareGENIE PrepareGENIE.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareGENIE)
   target_link_libraries(PrepareGENIE ${MODULETargets})
   target_link_libraries(PrepareGENIE ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(PrepareGENIE ${ROOT_LIBS})
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
      set_target_properties(PrepareGENIE PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
 endif()
 
 if(USE_NEUT)
   add_executable(PrepareNEUT PrepareNEUT.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareNEUT)
   target_link_libraries(PrepareNEUT ${MODULETargets})
   target_link_libraries(PrepareNEUT ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(PrepareNEUT ${ROOT_LIBS})
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
      set_target_properties(PrepareNEUT PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
 endif()
 
 # PREPARE NUWRO
 # Commented out for the time being until it is finished..
 #if(USE_NuWro)
 #  add_executable(PrepareNuwro PrepareNuwro.cxx)
 #  set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};PrepareNuwro)
 #  target_link_libraries(PrepareNuwro ${MODULETargets})
 #  target_link_libraries(PrepareNuwro ${CMAKE_DEPENDLIB_FLAGS})
 #  target_link_libraries(PrepareNuwro ${ROOT_LIBS})
 #  if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
 #    set_target_properties(PrepareNuwro PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
 #  endif()
 #endif()
 
 install(TARGETS ${TARGETS_TO_BUILD} DESTINATION bin)
diff --git a/app/PrepareGENIE.cxx b/app/PrepareGENIE.cxx
index 92b93b5..e0be761 100644
--- a/app/PrepareGENIE.cxx
+++ b/app/PrepareGENIE.cxx
@@ -1,318 +1,367 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "TFile.h"
 #include "TH1D.h"
 #include "TTree.h"
 #include "PlotUtils.h"
 #include "FitLogger.h"
 
 #ifdef __GENIE_ENABLED__
 #include "Conventions/Units.h"
+#include "GHEP/GHepParticle.h"
+#include "PDG/PDGUtils.h"
 #endif
 
 bool gFlagMerge = false;
 std::string gInputFiles = "";
 std::string gOutputFile = "";
 std::string gFluxFile   = "";
 std::string gTarget     = "";
 
 void PrintOptions();
 void ParseOptions(int argc, char* argv[]);
 void RunGENIEMerger(std::string inputs, std::string output);
 void RunGENIEPrepare(std::string input, std::string flux, std::string target, std::string output);
 
-int main(int argc, char* argv[]){
+int main(int argc, char* argv[]) {
 
   ParseOptions(argc, argv);
 
   if (gFlagMerge) RunGENIEMerger(gInputFiles, gOutputFile);
   else            RunGENIEPrepare(gInputFiles, gFluxFile, gTarget, gOutputFile);
 
 }
 
-void RunGENIEMerger(std::string inputs, std::string output){
+void RunGENIEMerger(std::string inputs, std::string output) {
 
 };
 
-void RunGENIEPrepare(std::string input, std::string flux, std::string target, std::string output){
-  
+void RunGENIEPrepare(std::string input, std::string flux, std::string target, std::string output) {
+
   LOG(FIT) << "Running GENIE Prepare" << std::endl;
 
   // Setup TTree
   TChain* tn = new TChain("gtree");
   tn->AddFile(input.c_str());
 
   int nevt = tn->GetEntries();
   NtpMCEventRecord * genientpl = NULL;
-  
-  tn->SetBranchAddress("gmcrec",&genientpl);
+
+  tn->SetBranchAddress("gmcrec", &genientpl);
 
   // Get Flux Hist
-  std::vector<std::string> fluxvect = GeneralUtils::ParseToStr(flux,",");
+  std::vector<std::string> 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);
+  if (fluxvect.size() > 1) {
+    TFile* fluxfile = new TFile(fluxvect[0].c_str(), "READ");
+    if (!fluxfile->IsZombie()) {
+      fluxhist = (TH1D*) fluxfile->Get(fluxvect[1].c_str());
+      fluxhist->SetDirectory(0);
+    } else {
+
+      // Function with EnuRange
+      if (fluxvect.size() == 3){
+	
+        ERR(FTL) << "FUNCTION WITH ENU RANGE NOT SUPPORTED SORRY!" << std::endl;
+        throw;
+	
+	// Single Enu
+      } 
+    }
+
+  } else if (fluxvect.size() == 1){
+
+    double E = GeneralUtils::StrToDbl(fluxvect[0]);
+    fluxhist = new TH1D("fluxhist","fluxhist",1, E-0.00001, E+0.00001);
+    fluxhist->SetBinContent(1, 1.0);
+    
+  
+      // if (fluxvect[0] == '1.0') {
+      //   fluxhist = new TH1D("fluxhist", "fluxhist", 40, GeneralUtils::StrToDbl(fluxvect[1]), GeneralUtils::StrToDbl(fluxvect[2]));
+      //   for (int i = 0; i < fluxhist->GetNbinsX(); i++) {
+      //     fluxhist->SetBinContent(i + 1, 1.0);
+      //   }
+      // } else {
+      //   //  TF1 f1 = TF1("1.0", GeneralUtils::StrToDbl(fluxvect[1]),  GeneralUtils::StrToDbl(fluxvect[2]), 1);
+      //   //  std::cout << "Created TF1 with '" << fluxvect[0].c_str()<<"' " << GeneralUtils::StrToDbl(fluxvect[1]) << " " << GeneralUtils::StrToDbl(fluxvect[2]) << std::endl;
+      //   fluxhist = new TH1D("fluxhist", "fluxhist", 40, GeneralUtils::StrToDbl(fluxvect[1]), GeneralUtils::StrToDbl(fluxvect[2]));
+      //   for (int i = 0; i < fluxhist->GetNbinsX(); i++) {
+      //     fluxhist->SetBinContent(i + 1, 1.0); //f1.Eval(fluxhist->GetXaxis()->GetBinCenter(i+1)));
+      //     //    std::cout << "Filling Flux Hist " << f1.Eval(fluxhist->GetXaxis()->GetBinCenter(i+1)) << std::endl;
+      //   }
+      //   sleep(10);
+    
   } else {
     LOG(FTL) << "NO FLUX SPECIFIED" << std::endl;
     throw;
   }
 
   // Make Event Hist
   TH1D* eventhist = (TH1D*)fluxhist->Clone();
   eventhist->Reset();
 
   TH1D* xsechist = (TH1D*) eventhist->Clone();
-  
+
   // Create maps
   std::map<std::string, TH1D*> modexsec;
   std::map<std::string, TH1D*> modecount;
   std::vector<std::string> genieids;
   std::vector<std::string> targetids;
   std::vector<std::string> 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<GHepRecord>(event);
     double xsec = (genie_record.XSec() / (1E-38 * genie::units::cm2));
 
     // Parse Interaction String
     std::string mode = genie_record.Summary()->AsString();
-    std::vector<std::string> modevec = GeneralUtils::ParseToStr(mode,";");
+    std::vector<std::string> 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()){
+    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.end()) {
       interids.push_back(inter);
     }
 
     // Create entries Mode Maps
-    if (modexsec.find(mode) == modexsec.end()){
+    if (modexsec.find(mode) == modexsec.end()) {
       genieids.push_back(mode);
-      
+
       modexsec[mode] = (TH1D*)xsechist->Clone();
       modecount[mode] = (TH1D*)xsechist->Clone();
     }
 
     // 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();
 
-    if (i % (nevt/20) == 0){
-        LOG(FIT) << "Processed " << i <<  "/" << nevt << " GENIE events." << std::endl;
+    if (i % (nevt / 20) == 0) {
+      LOG(FIT) << "Processed " << i <<  "/" << nevt << " GENIE events." << std::endl;
     }
   }
   LOG(FIT) << "Processed all events" << std::endl;
 
   // Once event loop is done we can start saving stuff into the file
   // bool savesplines = FitPar::Config().GetParB("save_genie_splines"); // Currently not implemented
-  
-  TFile* outputfile = new TFile(input.c_str(),"UPDATE");
+
+  TFile* outputfile = new TFile(input.c_str(), "UPDATE");
   outputfile->cd();
 
   LOG(FIT) << "Getting splines " << std::endl;
-  
+
   // Save each of the reconstructed splines to file
   std::map<std::string, TH1D*> modeavg;
 
-  
+
   TDirectory* inddir = (TDirectory*) outputfile->Get("IndividualGENIESplines");
   if (!inddir) inddir = (TDirectory*)outputfile->mkdir("IndividualGENIESplines");
   inddir->cd();
-  
-  for (UInt_t i = 0; i < genieids.size(); i++){
+
+  // Loop over GENIE ID's and get MEC count
+  int MECcount = 0;
+  bool MECcorrect = FitPar::Config().GetParB("CorrectGENIEMECNorm");
+  for (UInt_t i = 0; i < genieids.size(); i++) {
+    if (genieids[i].find("MEC") != std::string::npos){
+      MECcount++;
+    }
+  }
+  LOG(FIT) << "Found " << MECcount << " repeated MEC instances." << std::endl;
+
+
+  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]->Divide(modecount[mode]);
 
+    if (MECcorrect && (mode.find("MEC") != std::string::npos)){
+      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();
-  
+
   LOG(FIT) << "Getting Target Splines" << std::endl;
   // For each target save a total spline
   std::map<std::string, TH1D*> targetsplines;
 
-  for (uint i = 0; i < targetids.size(); i++){
-    LOG(FIT) << "Getting target "<< i << std::endl;
+  for (uint i = 0; i < targetids.size(); i++) {
+    LOG(FIT) << "Getting target " << i << std::endl;
     std::string targ = targetids[i];
     targetsplines[targ] = (TH1D*) xsechist->Clone();
     LOG(FIT) << "Created target spline for " << targ << std::endl;
-    
-    for (uint j = 0; j < genieids.size(); j++){
+
+    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){
+      if (mode.find(targ) != std::string::npos) {
 
-	LOG(FIT) << "Mode " << mode << " contains " << targ << " target!" << std::endl;
-	modeavg[mode]->Write( (mode + "_cont_" + targ).c_str() , TObject::kOverwrite);
-	targetsplines[targ]->Add( modeavg[mode] );
-	LOG(FIT) << "Finished with Mode " << mode << " "  << modeavg[mode]->Integral()<<std::endl;
+        LOG(FIT) << "Mode " << mode << " contains " << targ << " target!" << std::endl;
+	//        modeavg[mode]->Write( (mode + "_cont_" + targ).c_str() , TObject::kOverwrite);
+        targetsplines[targ]->Add( modeavg[mode] );
+        LOG(FIT) << "Finished with Mode " << mode << " "  << modeavg[mode]->Integral() << std::endl;
       }
     }
 
-    LOG(FIT) << "Saving target spline:" <<targ<< std::endl;
+    LOG(FIT) << "Saving target spline:" << targ << std::endl;
     targetsplines[targ]->Write(("Total" + targ).c_str(), TObject::kOverwrite);
   }
 
   LOG(FIT) << "Getting total splines" << std::endl;
   // Now we have each of the targets we need to create a total cross-section.
   int totalnucl = 0;
-  std::vector<std::string> targprs = GeneralUtils::ParseToStr(target,",");
+  std::vector<std::string> targprs = GeneralUtils::ParseToStr(target, ",");
   TH1D* totalxsec = (TH1D*) xsechist->Clone();
-  
-  for (uint i = 0; i < targprs.size(); i++){
+
+  for (uint i = 0; i < targprs.size(); i++) {
     std::string targpdg = targprs[i];
 
     for (std::map<std::string, TH1D*>::iterator iter = targetsplines.begin();
-	 iter != targetsplines.end(); iter++){
+         iter != targetsplines.end(); iter++) {
       std::string targstr = iter->first;
       TH1D* xsec = iter->second;
 
-      if (targstr.find(targpdg) != std::string::npos){
-	LOG(FIT) << "Adding target spline " << targstr << " : " << xsec->Integral("width") << std::endl;
-	totalxsec->Add(xsec);
+      if (targstr.find(targpdg) != std::string::npos) {
+        LOG(FIT) << "Adding target spline " << targstr << " Integral = " << xsec->Integral("width") << std::endl;
+        totalxsec->Add(xsec);
 
-	int nucl = atoi( targpdg.c_str() );
-	totalnucl += int((nucl  % 10000) / 10);
+        int nucl = atoi( targpdg.c_str() );
+        totalnucl += int((nucl  % 10000) / 10);
 
       }
     }
   }
 
+  LOG(FIT) << "Total XSec Integral = " << totalxsec->Integral("width") << std::endl;
+
   outputfile->cd();
   totalxsec->Write("nuisance_xsec", TObject::kOverwrite);
   eventhist = (TH1D*)fluxhist->Clone();
   eventhist->Multiply(totalxsec);
 
   LOG(FIT) << "Dividing by Total Nucl = " << totalnucl << std::endl;
   eventhist->Scale(1.0 / double(totalnucl) );
 
   eventhist->Write("nuisance_events", TObject::kOverwrite);
   fluxhist->Write("nuisance_flux", TObject::kOverwrite);
 
-  
-  LOG(FIT) << "Inclusive XSec Per Nucleon = " << eventhist->Integral("width") * 1E-38 / fluxhist->Integral("width") << std::endl;
 
-  
-  
-
-
-  
+  LOG(FIT) << "Inclusive XSec Per Nucleon = " << eventhist->Integral("width") * 1E-38 / fluxhist->Integral("width") << std::endl;
+  std::cout << "XSec Hist Integral = " << xsechist->Integral("width") << std::endl;
 
   return;
 };
 
 
 
-void PrintOptions(){
+void PrintOptions() {
 
   std::cout << "PrepareGENIEEvents NUISANCE app. "  << std::endl
-	    << "Takes GHep Outputs and prepares events for NUISANCE." << std::endl << std::endl
-	    << "PrepareGENIEEvents  [-h,-help,--h,--help] [-i inputfile1.root,inputfile2.root,inputfile3.root,...] " 
-	    << "[-f flux_root_file.root,flux_hist_name] [-t target1[frac1],target2[frac2],...]" 
-	    << std::endl << std::endl;
+            << "Takes GHep Outputs and prepares events for NUISANCE." << std::endl << std::endl
+            << "PrepareGENIEEvents  [-h,-help,--h,--help] [-i inputfile1.root,inputfile2.root,inputfile3.root,...] "
+            << "[-f flux_root_file.root,flux_hist_name] [-t target1[frac1],target2[frac2],...]"
+            << 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 << "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 << " [ -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 << " [ -t target ] : Target that GHepRecords were generated with. Comma seperated list. E.g. for CH2 target=1000060120,1000010010,1000010010" << std::endl;
 
   /*
-  std::cout << "Merger Mode [activate with -m] : Takes the list of input files assuming 'Prepare Mode' has already been ran on them and merges them " 
-	    << "into a single file with associated Friend Tree to help with conserving ratios of events (e.g. adding nue and nueb beams together into a single file" << std::endl;
+  std::cout << "Merger Mode [activate with -m] : Takes the list of input files assuming 'Prepare Mode' has already been ran on them and merges them "
+      << "into a single file with associated Friend Tree to help with conserving ratios of events (e.g. adding nue and nueb beams together into a single file" << std::endl;
   std::cout << "Following optoins are required for Merger Mode:" << std::endl;
   std::cout << " [ -i inputfile1.root,inputfile2.root ] : Comma Seperated list of files to be merged. " << std::endl;
   std::cout << " [ -o outputfile.root ] : Output file for merger." << std::endl;
   */
 
 }
 
-void ParseOptions(int argc, char* argv[]){
+void ParseOptions(int argc, char* argv[]) {
   bool flagopt = false;
 
   // If No Arguments print commands
-  for (int i = 1; i< argc; ++i){
+  for (int i = 1; i < argc; ++i) {
     if (!std::strcmp(argv[i], "-h"))   { flagopt  = true; break; }
     //    if (!std::strcmp(argv[i], "-m"))   { gFlagMerge = true; break; }
-    if (i+1 != argc){
+    if (i + 1 != argc) {
 
-      // Cardfile                                                                                                                                                                                                                          
+      // 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], "-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 {
-	ERR(FTL) << "ERROR: unknown command line option given! - '"
-                  <<argv[i]<<" "<<argv[i+1]<<"'"<< std::endl;
-	PrintOptions();
-	break;
+        ERR(FTL) << "ERROR: unknown command line option given! - '"
+                 << argv[i] << " " << argv[i + 1] << "'" << std::endl;
+        PrintOptions();
+        break;
       }
     }
   }
 
   /*
-  if (gOutputFile == "" && !flagopt){ 
-    ERR(FTL) << "No output file specificed!" << std::endl; 
+  if (gOutputFile == "" && !flagopt){
+    ERR(FTL) << "No output file specificed!" << std::endl;
     flagopt = true;
   }
   */
 
-  if (gInputFiles == "" && !flagopt){
+  if (gInputFiles == "" && !flagopt) {
     ERR(FTL) << "No input file(s) specified!" << std::endl;
     flagopt = true;
   }
-    
-  if (!gFlagMerge && gFluxFile == "" && !flagopt){
+
+  if (!gFlagMerge && gFluxFile == "" && !flagopt) {
     ERR(FTL) << "No flux input specified for Prepare Mode" << std::endl;
     flagopt = true;
   }
 
-  if (!gFlagMerge && gTarget == "" && !flagopt){
+  if (!gFlagMerge && gTarget == "" && !flagopt) {
     ERR(FTL) << "No target specified for Prepare Mode" << std::endl;
     flagopt = true;
   }
 
-  if (argc < 1 || flagopt){
-     PrintOptions();
-     exit(-1);
+  if (argc < 1 || flagopt) {
+    PrintOptions();
+    exit(-1);
   }
 
   return;
 }
diff --git a/app/nuiscomp.cxx b/app/nuiscomp.cxx
index 7b97775..f06b5e0 100644
--- a/app/nuiscomp.cxx
+++ b/app/nuiscomp.cxx
@@ -1,75 +1,228 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "ComparisonRoutines.h"
 
 //*******************************
-void printInputCommands(){
+void printInputCommands() {
 //*******************************
-  
-  std::cout << "nuiscomp -c cardfile -o outfile [-q configname=configval] \n";
-  std::cout << "\n Arguments : \n";
-  std::cout << "   -c cardfile: Path to NUISANCE card file defining fit samples \n";
-  std::cout <<"     -o outFile:    Path to root file that will be created to save output file.\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" << std::endl;
+
+  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"
+            << "                                '$EXT_FIT/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"
+            << "<nuisance>"
+            << "\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 name = \"ID\" input = \"TYPE : FILE\" type = \"TYPE\" norm = \"1.0\" /> --> \n"
+            << "\n"
+            << "<sample name=\"MiniBooNE_CCQE_XSec_1DQ2_nu\"   input=\"GENIE:genieevents.root\" /> \n"
+            << "<sample name=\"MiniBooNE_CC1pip_XSec_1DQ2_nu\" input=\"GENIE:genieevents.root\" type=\"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"
+            << "<!-- <parameter name=\"ID\" type=\"TYPE_parameter\" nominal=\"VAL\" /> --> \n"
+            << "\n"
+            << "<parameter name=\"MaCCQE\" type=\"norm_parameter\" nominal=\"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"
+            << "<!-- <fakeparameter name=\"ID\" nominal=\"VAL\" /> --> \n"
+            << "\n"
+            << "<fakeparameter name=\"MaCCQE\" nominal=\"1.0\" /> \n"
+            << "\n"
+            << "</nuisance> \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[]){ 
-//*******************************
+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){
+
+  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
-  LOG(FIT)<<"Starting nuiscomp.exe"<<std::endl;
+  LOG(FIT) << "Starting nuiscomp.exe" << std::endl;
 
   // Make minimizer class and run fit
-  ComparisonRoutines* min = new ComparisonRoutines(argc, argv);
-  
-  // Save Starting States
-  if (FitPar::Config().GetParB("savenominal")) min->SaveNominal();
-
-  // Run the fit rotines
-  min->Run();
-  min->SaveCurrentState();
+  ComparisonRoutines* comp = new ComparisonRoutines(argc, argv);
+  comp->Run();
 
   // Show Final Status
-  LOG(FIT)<<"-------------------------------------"<<std::endl;
-  LOG(FIT)<<"Comparison Complete."<<std::endl;
-  LOG(FIT)<<"-------------------------------------"<<std::endl;
-  
+  LOG(FIT) << "------------------------------------ -" << std::endl;
+  LOG(FIT) << "Comparison Complete." << std::endl;
+  LOG(FIT) << "------------------------------------ -" << std::endl;
+
   return status;
 }
 
 
 
diff --git a/app/nuisflat.cxx b/app/nuisflat.cxx
index ba4771c..48ad995 100644
--- a/app/nuisflat.cxx
+++ b/app/nuisflat.cxx
@@ -1,133 +1,212 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "InputUtils.h"
 
 #include "ComparisonRoutines.h"
 
 //*******************************
 void printInputCommands() {
   //*******************************
 
   std::cout << "nuisflat [-c cardfile] -o outfile [-q configname=configval] \n";
   std::cout << "\n Arguments : \n";
   std::cout
       << "   -i inputvector: Path to input vector of events to flatten \n";
   std::cout
       << "   -c cardfile: Path to NUISANCE card file defining fit samples \n";
   std::cout << "    -o outFile:    Path to root file that will be created to "
                "save output file.\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"
             << std::endl;
 
   exit(-1);
 };
 
 //*******************************
 int main(int argc, char* argv[]) {
   //*******************************
 
+  //<<<<<<< HEAD
+  // // Program status;
+  // int status = 0;
+
+  // std::string inpFileName = "";
+  // std::string OutputFile = "";
+  // std::string maxevents_flag = "";
+
+  // // If No Arguments print commands
+  // if (argc == 1) printInputCommands();
+
+  // for (int i = 1; i < argc; ++i) {
+  //   if (!std::strcmp(argv[i], "-h")) {
+  //     printInputCommands();
+  //   } else if (!std::strcmp(argv[i], "-i")) {
+  //     inpFileName = argv[++i];
+  //   } else if (!std::strcmp(argv[i], "-n")) {
+  //     maxevents_flag = argv[++i];
+  //   } else if (!std::strcmp(argv[i], "-o")) {
+  //     OutputFile = argv[++i];
+  //   }
+  // }
+
+  // // Read input arguments such as card file, parameter arguments, and fit
+  // // routines
+  // LOG(FIT) << "Starting nuisflat.exe" << std::endl;
+
+  // if (!inpFileName.length()) {  // Run with card file
+  //   // Make minimizer class and run fit
+  //   ComparisonRoutines* flat = new ComparisonRoutines(argc, argv);
+
+  //   // Run the fit rotines
+  //   flat->Run();
+  //   flat->SaveCurrentState();
+  // } else {  // Run standalone
+
+  //   if (!OutputFile.length()) {
+  //     OutputFile = inpFileName + ".root";
+  //     ERR(WRN) << "Didn't recieve outputfile name. Using \"" << OutputFile
+  //              << "\" instead." << std::endl;
+  //   }
+
+  //   std::string fullInputName =
+  //       InputUtils::PrependGuessedInputTypeToName(inpFileName);
+  //   std::string par_dir = GeneralUtils::GetTopLevelDir() + "/parameters/";
+  //   FitPar::Config().ReadParamFile(par_dir + "config.list.dat");
+
+  //   if (!maxevents_flag.empty()) {
+  //     FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
+  //   }
+
+  //   LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
+  //   ERR_VERB(FitPar::Config().GetParI("ERROR"));
+  //   // Outputs
+  //   // ---------------------------
+  //   // Save Configs to output file
+  //   FitPar::Config().out = new TFile(OutputFile.c_str(), "RECREATE");
+  //   FitPar::Config().out->cd();
+  //   FitPar::Config().Write();
+
+  //   std::list<MeasurementBase*> fChain;
+  //   bool LoadedSample =
+  //       SampleUtils::LoadSample(&fChain, "GenericFlux_", fullInputName,
+  //                               "DEFAULT", "", FitBase::GetRW());
+
+  //   if (!LoadedSample) {
+  //     ERR(FTL) << "Could not Flattener sample. Please report this as a bug."
+  //              << std::endl;
+  //     throw;
+  //   }
+
+  //   fChain.front()->Reconfigure();
+
+  //   FitPar::Config().out->Write();
+  //   FitPar::Config().out->Close();
+  // }
+
+    /*
   // Program status;
   int status = 0;
 
   std::string inpFileName = "";
   std::string OutputFile = "";
   std::string maxevents_flag = "";
 
   // If No Arguments print commands
   if (argc == 1) printInputCommands();
 
   for (int i = 1; i < argc; ++i) {
     if (!std::strcmp(argv[i], "-h")) {
       printInputCommands();
     } else if (!std::strcmp(argv[i], "-i")) {
       inpFileName = argv[++i];
     } else if (!std::strcmp(argv[i], "-n")) {
       maxevents_flag = argv[++i];
     } else if (!std::strcmp(argv[i], "-o")) {
       OutputFile = argv[++i];
     }
   }
 
   // Read input arguments such as card file, parameter arguments, and fit
   // routines
   LOG(FIT) << "Starting nuisflat.exe" << std::endl;
 
   if (!inpFileName.length()) {  // Run with card file
     // Make minimizer class and run fit
     ComparisonRoutines* flat = new ComparisonRoutines(argc, argv);
 
     // Run the fit rotines
     flat->Run();
     flat->SaveCurrentState();
   } else {  // Run standalone
 
     if (!OutputFile.length()) {
       OutputFile = inpFileName + ".root";
       ERR(WRN) << "Didn't recieve outputfile name. Using \"" << OutputFile
                << "\" instead." << std::endl;
     }
 
     std::string fullInputName =
         InputUtils::PrependGuessedInputTypeToName(inpFileName);
     std::string par_dir = GeneralUtils::GetTopLevelDir() + "/parameters/";
     FitPar::Config().ReadParamFile(par_dir + "config.list.dat");
 
     if (!maxevents_flag.empty()) {
       FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
     }
 
     LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
     ERR_VERB(FitPar::Config().GetParI("ERROR"));
     // Outputs
     // ---------------------------
     // Save Configs to output file
     FitPar::Config().out = new TFile(OutputFile.c_str(), "RECREATE");
     FitPar::Config().out->cd();
     FitPar::Config().Write();
 
     std::list<MeasurementBase*> fChain;
     bool LoadedSample =
         SampleUtils::LoadSample(&fChain, "GenericFlux_", fullInputName,
                                 "DEFAULT", "", FitBase::GetRW());
 
     if (!LoadedSample) {
       ERR(FTL) << "Could not Flattener sample. Please report this as a bug."
                << std::endl;
       throw;
     }
 
     fChain.front()->Reconfigure();
     fChain.front()->Write();
 
     //    FitPar::Config().out->Write();
     FitPar::Config().out->Close();
   }
 
+  */
   // Show Final Status
   LOG(FIT) << "-------------------------------------" << std::endl;
   LOG(FIT) << "Flattree Generation Complete." << std::endl;
   LOG(FIT) << "-------------------------------------" << std::endl;
 
-  return status;
+  return 0;
 }
diff --git a/app/nuispreload.sh b/app/nuispreload.sh
new file mode 100644
index 0000000..bacb0cc
--- /dev/null
+++ b/app/nuispreload.sh
@@ -0,0 +1,239 @@
+#!/bin/sh
+
+opt=$1
+fullcard=$2
+
+if [[ card == "-copy" || card == "-clean"  || card == "-make" ]]
+then
+    echo "Switching"
+    opt=$2
+    fullcard=$1
+fi
+
+card=$(basename $fullcard)
+fulldir=$(dirname $fullcard)
+if [[ $card != ${fullcard} && $fulldir != $PWD ]]
+then
+    cp $fullcard $card
+fi
+
+allfiles=""
+if [[ $opt == "-make" ]]
+then
+    if [[ -e "$card" ]]
+    then
+	allfiles=""
+#        echo "Copying files across from $card"
+    else
+        echo ""
+        return
+    fi
+
+    # Copy File                                                                                                                                                                                                                             
+    cp $card preload_${card}
+
+    # Strip out config replacers                                                                                                                                                                                                            
+    for obj in $(\grep config $card);
+    do
+        for events in "NEUT_DIR" "GENIE_DIR" "NUWRO_DIR" "NUSANCE_DIR" "EVSPLN_DIR" "GIBUU_DIR"
+        do
+
+            if [[ $obj == ${events}"="* ]]
+            then
+                obj=${obj//\/\>/}
+                obj=${obj//${events}=/}
+                obj=${obj//\"/}
+
+#                echo "Sedding : " sed -i -e "s#$events#$obj#g" preload_${card}
+                sed -i -e "s#@$events#$obj#g" preload_${card}
+            fi
+        done
+    done
+
+    # Make preload                                                                                                                                                                                                                          
+    for obj in $(\grep input preload_${card});
+    do
+
+        if [[ $obj != "input="* ]]
+        then
+            continue
+        fi
+
+        file=${obj//\"/}
+        file=${file//input=/}
+        file=${file//\/\>/}
+        file=${file//\.\//}
+
+        file=${file//\(/ }
+        file=${file//\)/ }
+        file=${file//\,/ }
+        file=${file//\;/ }
+
+        file=${file//GENIE:/ }
+        file=${file//NEUT:/ }
+        file=${file//NUWRO:/ }
+        file=${file//ROOT:/ }
+        file=${file//FEVENT:/ }
+
+	for newfile in $file;
+        do
+            base=$(basename $newfile)
+            if [[ "$base" != "$newfile" ]]
+            then
+                sed -i -e "s#$newfile#$base#g" preload_${card}
+            fi
+	    allfiles=$newfile,$allfiles
+        done
+    done
+    echo $allfiles
+fi
+
+
+# Copy Files
+if [[ $opt == "-copy" ]]
+then
+    
+    if [[ -e "$card" ]]
+    then
+        echo "Copying files across from $card"
+    else
+	echo "$card not found!"
+	return
+    fi
+    
+    # Copy File
+    cp $card preload_${card}
+
+    # Strip out config replacers
+    for obj in $(\grep config $card);
+    do
+	for events in "NEUT_DIR" "GENIE_DIR" "NUWRO_DIR" "NUSANCE_DIR" "EVSPLN_DIR" "GIBUU_DIR" 
+	do
+	    
+	    if [[ $obj == ${events}"="* ]]
+	    then
+		obj=${obj//\/\>/}
+		obj=${obj//${events}=/}
+		obj=${obj//\"/}
+		
+		echo "Sedding : " sed -i -e "s#$events#$obj#g" preload_${card} 
+		sed -i -e "s#@$events#$obj#g" preload_${card}
+	    fi
+	done
+    done
+
+    # Make preload
+    for obj in $(\grep input preload_${card});
+    do 
+	
+	if [[ $obj != "input="* ]] 
+	then
+	    continue
+	fi
+
+	file=${obj//\"/}
+	file=${file//input=/}
+	file=${file//\/\>/}
+	file=${file//\.\//}
+
+	file=${file//\(/ }
+	file=${file//\)/ }
+	file=${file//\,/ }
+	file=${file//\;/ }
+	
+	file=${file//GENIE:/ }
+	file=${file//NEUT:/ }
+	file=${file//NUWRO:/ }
+	file=${file//ROOT:/ }
+	file=${file//FEVENT:/ }
+
+	for newfile in $file;
+	do
+	    base=$(basename $newfile)
+	    if [[ "$base" != "$newfile" ]]
+            then
+                #echo cp $newfile $base
+		cp -rvf $newfile $base
+		sed -i -e "s#$newfile#$base#g" preload_${card}
+            else
+		echo "Not copying $base $newfile"
+            fi
+	done
+    done
+fi
+
+if [[ $opt == "-clean" ]]
+then
+    
+    if [[ -e "preload_${card}" ]] 
+    then
+	echo "Cleaning from preload_${card}"
+    else
+	echo "No preload card found!" 
+	return 0
+    fi
+
+    # Strip out config replacers
+    for obj in $(\grep config $card);
+    do
+        for events in "NEUT_DIR" "GENIE_DIR" "NUWRO_DIR" "NUSANCE_DIR" "EVSPLN_DIR" "GIBUU_DIR"
+        do
+
+            if [[ $obj == ${events}"="* ]]
+            then
+                obj=${obj//\/\>/}
+                obj=${obj//${events}=/}
+                obj=${obj//\"/}
+
+                echo "Sedding : " sed -i -e "s#$events#$obj#g" preload_${card}
+                sed -i -e "s#@$events#$obj#g" preload_${card}
+            fi
+        done
+    done
+
+    # Make preload
+    for obj in $(\grep input ${card});
+    do
+        if [[ $obj != "input="* ]]
+        then
+            continue
+        fi
+
+        file=${obj//\"/}
+        file=${file//input=/}
+        file=${file//\/\>/}
+	file=${file//\.\//}
+
+        file=${file//\(/ }
+        file=${file//\)/ }
+        file=${file//\,/ }
+        file=${file//\;/ }
+
+        file=${file//GENIE:/ }
+        file=${file//NEUT:/ }
+        file=${file//NUWRO:/ }
+        file=${file//ROOT:/ }
+	file=${file//FEVENT:/ }
+
+        for newfile in $file;
+        do
+            base=$(basename $newfile)
+	    if [[ "$base" != "$newfile" ]]
+	    then
+#		echo rm $base
+		rm -v $base
+	    else
+		echo "Not removing current folder file : $base $newfile"
+	    fi
+        done
+    done
+
+    # Remove file
+    rm preload_${card}
+
+    if [[ $card != $fullcard ]]
+    then
+	rm $card
+    fi
+fi
+
diff --git a/app/nuissplines.cxx b/app/nuissplines.cxx
index 56f85a8..eb30d7c 100644
--- a/app/nuissplines.cxx
+++ b/app/nuissplines.cxx
@@ -1,96 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 // 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 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 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<<"     -f fakeDataFile: Uses the MC generated from a previous fit as a fake data set for these fits \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
   LOG(FIT)<<"Starting ExtFit_splines.exe"<<std::endl;
 
   // Make minimizer class and run fit
   SplineRoutines* splRt = new SplineRoutines(argc, argv);
   splRt->Run();
 
   // Show Final Status
   LOG(FIT)<<"-------------------------------------"<<std::endl;
   LOG(FIT)<<"Spline Generation/Validation Finished."<<std::endl;
   LOG(FIT)<<"-------------------------------------"<<std::endl;
   
-  return status;
+  return 0;
 }
 
 
 
diff --git a/cmake/GENIESetup.cmake b/cmake/GENIESetup.cmake
index a31b42d..ec28dd6 100644
--- a/cmake/GENIESetup.cmake
+++ b/cmake/GENIESetup.cmake
@@ -1,147 +1,166 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 # TODO
 # check system for libxml2
 # check whether we need the includes
 # check if we can use a subset of the GENIE libraries
 
 ################################################################################
 #                            Check Dependencies
 ################################################################################
 
 #################################  GENIE  ######################################
 if(NOT DEFINED GENIE AND NOT DEFINED ENV{GENIE})
 
   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 and environment vairable"
     " $ export GENIE=/path/to/GENIE")
 
 endif()
 
 if(NOT DEFINED GENIE AND DEFINED ENV{GENIE})
   set(GENIE $ENV{GENIE})
 endif()
 
+if (DEFINED BUILD_GEVGEN AND BUILD_GEVGEN)
+  cmessage(STATUS "Building custom gevgen")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GEVGEN_ENABLED__ ")
+endif()
+
 execute_process (COMMAND genie-config
   --libs OUTPUT_VARIABLE GENIE_LD_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process (COMMAND genie-config
   --topsrcdir OUTPUT_VARIABLE GENIE_INCLUDES OUTPUT_STRIP_TRAILING_WHITESPACE)
 
 ################################  LHAPDF  ######################################
 if(NOT DEFINED LHAPDF_LIB AND NOT DEFINED ENV{LHAPDF_LIB})
 
   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 and environment vairable"
     " $ export LHAPDF_LIB=/path/to/LHAPDF_libraries")
 
 endif()
 
 if(NOT DEFINED LHAPDF_LIB AND DEFINED ENV{LHAPDF_LIB})
   set(LHAPDF_LIB $ENV{LHAPDF_LIB})
 endif()
 
 if(NOT DEFINED LHAPDF_INC AND NOT DEFINED ENV{LHAPDF_INC})
 
   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 and environment vairable"
     " $ export LHAPDF_INC=/path/to/LHAPDF_includes")
 
 endif()
 
 if(NOT DEFINED LHAPDF_INC AND DEFINED ENV{LHAPDF_INC})
   set(LHAPDF_INC $ENV{LHAPDF_INC})
 endif()
 
 
+if(NOT DEFINED LHAPATH AND NOT DEFINED ENV{LHAPATH})
+
+  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 and environment variable"
+    " $ export LHAPATH=/path/to/LHAPATH")
+
+endif()
+
+if(NOT DEFINED LHAPATH AND DEFINED ENV{LHAPATH})
+  set(LHAPATH $ENV{LHAPATH})
+endif()
+
+
 ################################  LIBXML  ######################################
 if(NOT DEFINED LIBXML2_LIB AND NOT DEFINED ENV{LIBXML2_LIB})
 
   cmessage(FATAL_ERROR "Variable LIBXML2_LIB is not defined. "
     "The location of a pre-built libxml2 install must be defined either as"
     " $ cmake -DLIBXML2_LIB=/path/to/LIBXML2_libraries or as and environment vairable"
     " $ export LIBXML2_LIB=/path/to/LIBXML2_libraries")
 
 endif()
 
 if(NOT DEFINED LIBXML2_LIB AND DEFINED ENV{LIBXML2_LIB})
   set(LIBXML2_LIB $ENV{LIBXML2_LIB})
 endif()
 
 if(NOT DEFINED LIBXML2_INC AND NOT DEFINED ENV{LIBXML2_INC})
 
   cmessage(FATAL_ERROR "Variable LIBXML2_INC is not defined. "
     "The location of a pre-built libxml2 install must be defined either as"
     " $ cmake -DLIBXML2_INC=/path/to/LIBXML2_includes or as and environment vairable"
     " $ export LIBXML2_INC=/path/to/LIBXML2_includes")
 
 endif()
 
 if(NOT DEFINED LIBXML2_INC AND DEFINED ENV{LIBXML2_INC})
   set(LIBXML2_INC $ENV{LIBXML2_INC})
 endif()
 
 
 ###############################  log4cpp  ######################################
 if(NOT DEFINED LOG4CPP_LIB AND NOT DEFINED ENV{LOG4CPP_LIB})
 
   cmessage(FATAL_ERROR "Variable LOG4CPP_LIB is not defined. "
     "The location of a pre-built log4cpp install must be defined either as"
     " $ cmake -DLOG4CPP_LIB=/path/to/LOG4CPP_libraries or as and environment vairable"
     " $ export LOG4CPP_LIB=/path/to/LOG4CPP_libraries")
 
 endif()
 
 if(NOT DEFINED LOG4CPP_LIB AND DEFINED ENV{LOG4CPP_LIB})
   set(LOG4CPP_LIB $ENV{LOG4CPP_LIB})
 endif()
 
 if(NOT DEFINED LOG4CPP_INC AND NOT DEFINED ENV{LOG4CPP_INC})
 
   cmessage(FATAL_ERROR "Variable LOG4CPP_INC is not defined. "
     "The location of a pre-built log4cpp install must be defined either as"
     " $ cmake -DLOG4CPP_INC=/path/to/LOG4CPP_includes or as and environment vairable"
     " $ export LOG4CPP_INC=/path/to/LOG4CPP_includes")
 
 endif()
 
 if(NOT DEFINED LOG4CPP_INC AND DEFINED ENV{LOG4CPP_INC})
   set(LOG4CPP_INC $ENV{LOG4CPP_INC})
 endif()
 ################################################################################
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__GENIE_ENABLED__ ")
 
 set(RWENGINE_INCLUDE_DIRECTORIES ${RWENGINE_INCLUDE_DIRECTORIES}
   ${GENIE_INCLUDES}
   ${GENIE_INCLUDES}/GHEP
   ${GENIE_INCLUDES}/Ntuple
   ${GENIE_INCLUDES}/ReWeight
   ${LHAPDF_INC}
   ${LIBXML2_INC}
   ${LOG4CPP_INC})
 
 set(RWENGINE_LINKER_FLAGS "${RWENGINE_LINKER_FLAGS} ${GENIE_LD_FLAGS} -L${LHAPDF_LIB} -lLHAPDF -L${LIBXML2_LIB} -lxml2 -L${LOG4CPP_LIB} -llog4cpp")
 
 set(NEED_PYTHIA6 TRUE)
 set(NEED_ROOTPYTHIA6 TRUE)
 set(NEED_ROOTEVEGEN TRUE)
diff --git a/cmake/HepMC.cmake b/cmake/HepMC.cmake
new file mode 100644
index 0000000..6133831
--- /dev/null
+++ b/cmake/HepMC.cmake
@@ -0,0 +1,36 @@
+# Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+################################################################################
+#    This file is part of NUISANCE.
+#
+#    NUISANCE is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    NUISANCE is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+################################################################################
+
+
+
+if(NOT DEFINED ENV{HEPMC})
+
+    cmessage(FATAL_ERROR "Environment variable NUWRO is not defined. "
+      "This must be set to point to a prebuilt NuWro instance.")
+
+endif()
+
+set(HEPMC $ENV{HEPMC})
+
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__HEPMC_ENABLED__  ")
+
+LIST(APPEND RWENGINE_INCLUDE_DIRECTORIES  ${HEPMC}/include/HepMC/ ${HEPMC}/include/ ${HEPMC}/include/SimpleVector.h  )
+
+set(RWENGINE_LINKER_FLAGS "${RWENGINE_LINKER_FLAGS} -L${HEPMC}/lib/ -lHepMC -lHepMCfio")
+
diff --git a/cmake/NEUTSetup.cmake b/cmake/NEUTSetup.cmake
index b80c0f3..d9f4653 100644
--- a/cmake/NEUTSetup.cmake
+++ b/cmake/NEUTSetup.cmake
@@ -1,52 +1,59 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 
 if(NOT DEFINED ENV{NEUT_ROOT} OR $ENV{NEUT_ROOT} STREQUAL "")
 
   cmessage(FATAL_ERROR "Environment variable NEUT_ROOT is not defined. "
     "This must be set to point to a prebuilt NEUT instance.")
 
 endif()
 
 if(NOT DEFINED ENV{CERN} OR $ENV{CERN} STREQUAL "")
 
   cmessage(FATAL_ERROR "Environment variable CERN is not defined. "
     "This must be set to point to a prebuilt CERNLIB instance.")
 
 endif()
 
 if(NOT DEFINED ENV{CERN_LEVEL} OR $ENV{CERN_LEVEL} STREQUAL "")
 
   cmessage(FATAL_ERROR "Environment variable CERN_LEVEL is not defined. "
     "This must be set correctly for a prebuilt CERNLIB instance.")
 
 endif()
 
 set(NEUT_ROOT $ENV{NEUT_ROOT})
 set(NEUT_LIB_DIR ${NEUT_ROOT}/lib/Linux_pc)
 set(CERN $ENV{CERN})
 set(CERN_LEVEL $ENV{CERN_LEVEL})
 set(NEUT_CLASS ${NEUT_ROOT}/src/neutclass)
 
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NEUT_ENABLED__ ")
 
 set(RWENGINE_INCLUDE_DIRECTORIES ${RWENGINE_INCLUDE_DIRECTORIES} ${NEUT_ROOT}/include ${NEUT_ROOT}/src/neutclass ${NEUT_ROOT}/src/reweight)
 
-set(RWENGINE_LINKER_FLAGS "-L${NEUT_ROOT}/lib/Linux_pc  -lNReWeight -L${CERN}/${CERN_LEVEL}/lib -ljetset74 -lpdflib804 -lmathlib -lpacklib -lpawlib ${NEUT_CLASS}/neutctrl.so ${NEUT_CLASS}/neutfsivert.so ${NEUT_CLASS}/neutnucfsivert.so ${NEUT_CLASS}/neutrootTreeSingleton.so ${NEUT_CLASS}/neutvtx.so ${NEUT_CLASS}/neutfsipart.so  ${NEUT_CLASS}/neutnucfsistep.so ${NEUT_CLASS}/neutpart.so ${NEUT_CLASS}/neutvect.so -L${NEUT_ROOT}/lib/Linux_pc  -lneutcore -lnuccorrspl -lnuceff -lpartnuck -lskmcsvc -ltauola -L${NEUT_ROOT}/src/reweight -lNReWeight")
+set(RWENGINE_LINKER_FLAGS "-L${NEUT_ROOT}/lib/Linux_pc  -lNReWeight -L${CERN}/${CERN_LEVEL}/lib -ljetset74 -lpdflib804 -lmathlib -lpacklib -lpawlib ${NEUT_CLASS}/neutctrl.so ${NEUT_CLASS}/neutfsivert.so ${NEUT_CLASS}/neutrootTreeSingleton.so ${NEUT_CLASS}/neutvtx.so ${NEUT_CLASS}/neutfsipart.so  ${NEUT_CLASS}/neutpart.so ${NEUT_CLASS}/neutvect.so -L${NEUT_ROOT}/lib/Linux_pc  -lneutcore -lnuccorrspl -lnuceff -lpartnuck -lskmcsvc -ltauola -L${NEUT_ROOT}/src/reweight -lNReWeight")
+
+# Check for old versions of NEUT without NUCLEON FSI
+if(EXISTS "${NEUT_CLASS}/neutnucfsistep.so")
+  set(NEUT_NUCFSI 1)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__NEUT_NUCFSI_ENABLED__ ")
+  set(RWENGINE_LINKER_FLAGS "${RWENGINE_LINKER_FLAGS} ${NEUT_CLASS}/neutnucfsistep.so ${NEUT_CLASS}/neutnucfsivert.so")
+endif()
diff --git a/cmake/ROOTSetup.cmake b/cmake/ROOTSetup.cmake
index e12deb9..c7d7e74 100644
--- a/cmake/ROOTSetup.cmake
+++ b/cmake/ROOTSetup.cmake
@@ -1,159 +1,159 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 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 OUTPUT_STRIP_TRAILING_WHITESPACE)
 # 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)
 
 set(ROOT_LD_FLAGS "-L${ROOT_LIBDIR}")
 
-set(ROOT_LIBS Core;Cint;RIO;Net;Hist;Graf;Graf3d;Gpad;Tree;Rint;Postscript;Matrix;Physics;MathCore;Thread;EG;Geom;GenVector)
+set(ROOT_LIBS Core;Cint;RIO;Net;Hist;Graf;Graf3d;Gpad;Tree;TreePlayer;Rint;Postscript;Matrix;Physics;MathCore;Thread;EG;Geom;GenVector;XMLIO)
 
 # Check GENIE requirements
 if(USE_GENIE)
   cmessage(STATUS "GENIE requires eve generation libraries")
   set(ROOT_LIBS Eve;EG;TreePlayer;Geom;Ged;Gui;${ROOT_LIBS})
 endif()
 
 # Check if we have Minuit2 enabled
 if(NOT DEFINED USE_MINIMIZER)
   if("${ROOT_FEATURES}" MATCHES "minuit2")
     cmessage(STATUS "ROOT built with MINUIT2 support")
     set(USE_MINIMIZER 1)
   else()
     cmessage(STATUS "ROOT built without MINUIT2 support, minimizer functionality will be disabled.")
     set(USE_MINIMIZER 0)
   endif()
 endif()
 
 # Check ROOT version is 5.34/34 or 5.34/36
 string(REGEX MATCH "5.34/([0-9]+)" ROOTVERSMATCH ${ROOT_VERSION})
 if( NOT ROOTVERSMATCH OR  ${CMAKE_MATCH_1} LESS "19")
   cmessage(WARNING "ROOT Version: ${ROOT_VERSION} has out of date minimizer interface. Disabling minimizer, please update to 5.34/19 or greater to enable minimization features.")
   set(USE_MINIMIZER 0)
 endif()
 
 
 if("${ROOT_VERSION}" MATCHES "5.34/34" OR "${ROOT_VERSION}" MATCHES "5.34/36" OR "${ROOT_VERSION}" MATCHES "5.34/32")
   cmessage(STATUS "Found valid ROOT version ${ROOT_VERSION}")
 else()
   cmessage(STATUS "You've supplied an invalid ROOT version! NUISANCE only support 5.34/34 and 5.34/36: turning minimizer OFF")
   set(USE_MINIMIZER 0)
 endif()
 
 if("${ROOT_FEATURES}" MATCHES "opengl")
   cmessage(STATUS "ROOT built with OpenGL support")
   set(ROOT_LIBS ${ROOT_LIBS};RGL)
 endif()
 
 if(DEFINED NEED_ROOTPYTHIA6 AND NEED_ROOTPYTHIA6)
   set(ROOT_LIBS ${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} )
 
 set(CMAKE_CXX_FLAGS "${CMAKE_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 "${CMAKE_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 a36bcb3..8f99135 100644
--- a/cmake/ReweightEnginesSetup.cmake
+++ b/cmake/ReweightEnginesSetup.cmake
@@ -1,67 +1,83 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 set(RWENGINE_INCLUDE_DIRECTORIES "")
 
 ##################################  NEUT  ######################################
 if(DEFINED USE_NEUT AND USE_NEUT)
   include(${CMAKE_SOURCE_DIR}/cmake/NEUTSetup.cmake)
   cmessage(STATUS "Using NEUT Reweight engine.")
 else()
   set(USE_NEUT 0)
 endif()
 #################################  NuWro  ######################################
 if(DEFINED USE_NuWro AND USE_NuWro)
   include(${CMAKE_SOURCE_DIR}/cmake/NuWroSetup.cmake)
   cmessage(STATUS "Using NuWro Reweight engine.")
 else()
   set(USE_NuWro 0)
 endif()
 ##################################  GENIE  #####################################
 if(DEFINED USE_GENIE AND USE_GENIE)
   include(${CMAKE_SOURCE_DIR}/cmake/GENIESetup.cmake)
   cmessage(STATUS "Using GENIE Reweight engine.")
 else()
   set(USE_GENIE 0)
 endif()
+
+if(DEFINED BUILD_GEVGEN AND BUILD_GEVGEN)
+	   cmessage(STATUS "Building custom gevgen.")
+else()
+set(BUILD_GEVGEN 0)
+endif()
+
 ##################################  NIWG  ######################################
 if(DEFINED USE_NIWG AND USE_NIWG)
   include(${CMAKE_SOURCE_DIR}/cmake/NIWGSetup.cmake)
   cmessage(STATUS "Using NIWG Reweight engine.")
 else()
   set(USE_NIWG 0)
 endif()
 ##################################  T2K   ######################################
 if(DEFINED USE_T2K AND USE_T2K)
   include(${CMAKE_SOURCE_DIR}/cmake/T2KSetup.cmake)
   cmessage(STATUS "Using T2K Reweight engine.")
 else()
   set(USE_T2K 0)
 endif()
+################################# HEPMC ########################################
+if(DEFINED USE_HEPMC AND USE_HEPMC)
+  include(${CMAKE_SOURCE_DIR}/cmake/HepMC.cmake)
+  cmessage(STATUS "Using HepMC engine.")
+else()
+  set(USE_HEPMC 0)
+endif()
+
+
 
 cmessage(STATUS "Reweight engine include directories: ${RWENGINE_INCLUDE_DIRECTORIES}")
 
 if(DEFINED NEED_ROOTEVEGEN AND NEED_ROOTEVEGEN)
   cmessage(STATUS "Require ROOT eve generation libraries")
   set(ROOT_LIBS Eve;EG;TreePlayer;Geom;Ged;Gui;${ROOT_LIBS})
 endif()
 if(DEFINED NEED_ROOTPYTHIA6 AND NEED_ROOTPYTHIA6)
   cmessage(STATUS "Require ROOT Pythia6 libraries")
   set(ROOT_LIBS ${ROOT_LIBS};EGPythia6;Pythia6)
 endif()
diff --git a/cmake/c++CompilerSetup.cmake b/cmake/c++CompilerSetup.cmake
index cc6a31a..9146ca0 100644
--- a/cmake/c++CompilerSetup.cmake
+++ b/cmake/c++CompilerSetup.cmake
@@ -1,63 +1,71 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 set(CXX_WARNINGS "-Wall ") #-Wextra")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNINGS}")
 
 if(DEFINED USE_EXP AND USE_EXP)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
 endif()
 
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
+
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O3")
 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(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} ")
 set(CMAKE_DEPENDLIB_FLAGS "${ROOT_LD_FLAGS}")
 
 if(NOT ${RWENGINE_LINKER_FLAGS} STREQUAL "")
   set(CMAKE_DEPENDLIB_FLAGS "${CMAKE_DEPENDLIB_FLAGS} ${RWENGINE_LINKER_FLAGS}")
 endif()
 
 if (DEFINED USE_MYPERFTOOLS AND USE_MYPERFTOOLS)
 #  add_dependencies(gperftools libunwind)
   set(CMAKE_CXX_FLAGS "-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free ${CMAKE_CXX_FLAGS}")
   set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} -ltcmalloc_and_profiler")
   cmessage(STATUS "Using google performance libraries")
 endif()
 
 if(DEFINED USE_EXP AND USE_EXP)
-  set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} -fopenmp")
+  set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS}")
+endif()
+
+if(DEFINED USE_OPENMP AND USE_OPENMP)
+  set(CMAKE_C_FLAGS "-fopenmp ${CMAKE_C_FLAGS}")
+  set(CMAKE_CXX_FLAGS "-fopenmp ${CMAKE_CXX_FLAGS} -D__USE_OPENMP__")
+  set(CMAKE_DEPENDLIB_FLAGS "-lgomp ${CMAKE_DEPENDLIB_FLAGS}")
 endif()
 
+
 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/setup.sh.in b/cmake/setup.sh.in
index f658bc2..e4a28cf 100644
--- a/cmake/setup.sh.in
+++ b/cmake/setup.sh.in
@@ -1,120 +1,120 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 #!/bin/sh
 if ! [[ ":$PATH:" == *":@CMAKE_INSTALL_PREFIX@/bin:"* ]]; then
   export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
 fi
 
 if ! [[ ":$LD_LIBRARY_PATH:" == *":@CMAKE_INSTALL_PREFIX@/lib:"* ]]; then
   export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
 fi
 
 if [[ ! "${ROOTSYS}" ]]; then
   echo "[INFO]: Sourcing ROOT from: @CMAKE_ROOTSYS@"
   source "@CMAKE_ROOTSYS@/bin/thisroot.sh"
 fi
 
 
 if [[ "@USE_NEUT@" != "0" ]]; then
   echo "[INFO]: Adding NEUT library paths to the environment."
   export NEUT_ROOT=@NEUT_ROOT@
   export CERN=@CERN@
   export CERN_LEVEL=@CERN_LEVEL@
   if ! [[ ":$LD_LIBRARY_PATH:" == *":${NEUT_ROOT}/lib/Linux_pc:"* ]]; then
     export LD_LIBRARY_PATH=${NEUT_ROOT}/lib/Linux_pc:$LD_LIBRARY_PATH
   fi
   if ! [[ ":$LD_LIBRARY_PATH:" == *":${NEUT_ROOT}/src/reweight:"* ]]; then
     export LD_LIBRARY_PATH=${NEUT_ROOT}/src/reweight:$LD_LIBRARY_PATH
   fi
 fi
 
 if [[ "@USE_NuWro@" != "0" ]]; then
   echo "[INFO]: Adding NuWro library paths to the environment."
   export NUWRO="@NUWRO@"
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@NUWRO@/build/@CMAKE_SYSTEM_NAME@/lib:"* ]]; then
     export LD_LIBRARY_PATH=@NUWRO@/build/@CMAKE_SYSTEM_NAME@/lib:$LD_LIBRARY_PATH
   fi
 fi
 
 if [[ "@NEED_PYTHIA6@" != "0" ]]; then
   echo "[INFO]: Adding PYTHIA6 library paths to the environment."
   export PYTHIA6="@PYTHIA6@"
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@PYTHIA6@:"* ]]; then
     export LD_LIBRARY_PATH=@PYTHIA6@:$LD_LIBRARY_PATH
   fi
 fi
 
 if [[ "@USE_GENIE@" != "0" ]]; 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@"
 
   export LHAPATH="@LHAPATH@"
 
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@GENIE@/lib:"* ]]; then
     export LD_LIBRARY_PATH=@GENIE@/lib:$LD_LIBRARY_PATH
   fi
 
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@LHAPDF_LIB@:"* ]]; then
     export LD_LIBRARY_PATH=@LHAPDF_LIB@:$LD_LIBRARY_PATH
   fi
 
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@LIBXML2_LIB@:"* ]]; then
     export LD_LIBRARY_PATH=@LIBXML2_LIB@:$LD_LIBRARY_PATH
   fi
 
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@LOG4CPP_LIB@:"* ]]; then
     export LD_LIBRARY_PATH=@LOG4CPP_LIB@:$LD_LIBRARY_PATH
   fi
 fi
 
 if [[ "@USE_NIWG@" != "0" ]]; then
   echo "[INFO]: Adding NIWG paths to the environment."
   export NIWG=@NIWG@
   export NIWGREWEIGHT_INPUTS=@NIWG@/inputs
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@NIWG@:"* ]]; then
     export LD_LIBRARY_PATH=${NIWG}:${LD_LIBRARY_PATH}
   fi
 
 fi
 
 if [[ "@USE_T2K@" != "0" ]]; then
   echo "[INFO]: Adding T2K paths to the environment."
   export T2KREWEIGHT=@T2KREWEIGHT@
   if ! [[ ":$LD_LIBRARY_PATH:" == *":@T2KREWEIGHT@/lib:"* ]]; then
     export LD_LIBRARY_PATH=${T2KREWEIGHT}/lib:${LD_LIBRARY_PATH}
   fi
 fi
 
-if [[ "@USE_GiBUU@" != "0" ]]; then
+if [[ "@BUILD_GiBUU@" != "0" ]]; then
   echo "[INFO]: Sourcing GiBUU tools."
   source @CMAKE_BINARY_DIR@/GiBUUTools/src/GiBUUTools-build/Linux/setup.sh
 fi
 
 export EXT_FIT="@CMAKE_SOURCE_DIR@"
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986.txt b/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986.txt
new file mode 100755
index 0000000..5b02ae1
--- /dev/null
+++ b/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986.txt
@@ -0,0 +1,10 @@
+0.5 2.27E-39  4.70E-40
+0.8 4.84E-39  3.30E-40
+1.0 6.05E-39  3.90E-40
+1.2 6.40E-39  4.00E-40
+1.4 6.91E-39  5.21E-40
+1.6 7.57E-39  7.70E-40
+1.8 6.90E-39  4.61E-40
+2.1 8.07E-39  5.10E-40
+4.0 8.34E-39  8.90E-40
+14.0 0.0 0.0
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr.txt b/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr.txt
new file mode 100755
index 0000000..806ca51
--- /dev/null
+++ b/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr.txt
@@ -0,0 +1,9 @@
+0.50 0.161311E-38 0.0403278E-38
+0.80 0.387146E-38 0.07259E-38
+1.00 0.479467E-38 0.0799112E-38
+1.20 0.508099E-38 0.0793904E-38
+1.40 0.547304E-38 0.0793194E-38
+1.60 0.595319E-38 0.095251E-38
+1.80 0.548641E-38 0.111318E-38
+2.20 0.639106E-38 0.111843E-38
+4.00 0.000000E-38 0.000000E-38
diff --git a/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr_edges.txt b/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr_edges.txt
deleted file mode 100755
index 5eaa8ef..0000000
--- a/data/BNL/CC1pip_on_p/BNL_CC1pip_on_p_W14_1986_corr_edges.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-0.5 0.161E-38 0.040E-38
-0.8 0.387E-38 0.073E-38
-1.0 0.479E-38 0.078E-38
-1.2 0.508E-38 0.079E-38
-1.4 0.547E-38 0.079E-38
-1.6 0.595E-38 0.095E-38
-1.8 0.549E-38 0.111E-38
-2.2 0.639E-38 0.112E-38
-4.0 0.000E-38 0.000E-38
diff --git a/data/Electron/12C.dat b/data/Electron/12C.dat
new file mode 100644
index 0000000..2dc9a51
--- /dev/null
+++ b/data/Electron/12C.dat
@@ -0,0 +1,2883 @@
+  6  12   0.160  36.000   0.013  4.1060e+05  1.8320e+05 Barreau:1983ht 
+  6  12   0.160  36.000   0.018  4.0900e+05  1.4750e+05 Barreau:1983ht 
+  6  12   0.160  36.000   0.022  7.9080e+05  1.4650e+05 Barreau:1983ht 
+  6  12   0.160  36.000   0.028  5.4210e+05  1.2300e+05 Barreau:1983ht 
+  6  12   0.161  60.000   0.008  1.4680e+05  1.9250e+04 Barreau:1983ht 
+  6  12   0.161  60.000   0.013  8.1090e+04  1.0790e+04 Barreau:1983ht 
+  6  12   0.161  60.000   0.018  9.6280e+04  9.2500e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.023  1.4710e+05  9.3300e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.028  1.3280e+05  8.3500e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.033  1.0100e+05  7.3500e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.038  8.4780e+04  6.8000e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.043  7.1350e+04  6.3800e+03 Barreau:1983ht 
+  6  12   0.161  60.000   0.048  5.8670e+04  6.0400e+03 Barreau:1983ht 
+  6  12   0.200  36.000   0.018  4.3560e+05  7.8200e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.022  6.0110e+05  7.5400e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.028  6.5010e+05  7.0570e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.033  4.5580e+05  5.8990e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.037  3.7560e+05  5.3380e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.043  2.7620e+05  4.7410e+04 Barreau:1983ht 
+  6  12   0.200  36.000   0.048  2.0030e+05  4.2920e+04 Barreau:1983ht 
+  6  12   0.200  60.000   0.007  1.6400e+05  1.2880e+04 Barreau:1983ht 
+  6  12   0.200  60.000   0.013  8.4410e+04  5.9900e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.018  5.1280e+04  4.2700e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.022  7.7990e+04  4.7600e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.028  8.2410e+04  4.7000e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.033  7.4080e+04  4.3500e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.037  6.8520e+04  4.1700e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.043  6.4950e+04  4.0700e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.048  5.6440e+04  3.8400e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.052  4.7050e+04  3.6400e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.058  3.9000e+04  3.5700e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.062  3.1660e+04  3.3800e+03 Barreau:1983ht 
+  6  12   0.200  60.000   0.068  2.6050e+04  3.2000e+03 Barreau:1983ht 
+  6  12   0.240  36.000   0.013  3.6130e+05  5.0450e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.018  3.0410e+05  4.1200e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.022  4.9720e+05  4.3530e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.028  4.6210e+05  3.9490e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.033  3.6150e+05  3.4100e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.037  2.9120e+05  3.0190e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.043  2.6000e+05  2.8030e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.048  2.0660e+05  2.5240e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.052  1.9790e+05  2.4360e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.058  1.3830e+05  1.9810e+04 Barreau:1983ht 
+  6  12   0.240  36.000   0.062  1.0220e+05  1.8420e+04 Barreau:1983ht 
+  6  12   0.240  60.000   0.003  2.7070e+05  7.1800e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.008  1.0670e+05  4.1200e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.013  6.0580e+04  1.8000e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.018  3.3090e+04  1.3200e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.023  4.3270e+04  1.4000e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.028  4.5830e+04  1.3700e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.033  4.8900e+04  1.4000e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.038  4.7980e+04  1.4000e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.043  4.8650e+04  1.4400e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.048  4.6260e+04  1.4200e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.053  4.3750e+04  1.4100e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.058  3.9630e+04  1.3900e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.063  3.3680e+04  1.3100e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.068  2.9580e+04  1.2500e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.073  2.4830e+04  1.2200e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.078  1.9880e+04  1.1600e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.083  1.6970e+04  1.1100e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.088  1.4830e+04  1.1100e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.093  1.2020e+04  1.0900e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.098  1.0710e+04  1.1000e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.103  9.6500e+03  1.1400e+03 Barreau:1983ht 
+  6  12   0.240  60.000   0.108  7.1400e+03  1.1200e+03 Barreau:1983ht 
+  6  12   0.280  60.000   0.003  4.8190e+04  1.1800e+03 Barreau:1983ht 
+  6  12   0.280  60.000   0.008  5.6900e+04  1.6500e+03 Barreau:1983ht 
+  6  12   0.280  60.000   0.013  3.9620e+04  8.1000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.018  2.1640e+04  5.3000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.023  2.6140e+04  5.8000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.028  2.6300e+04  5.7000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.033  3.1910e+04  6.5000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.038  3.4420e+04  7.1000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.043  3.6160e+04  7.4000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.048  3.8100e+04  7.9000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.053  3.8150e+04  8.1000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.058  3.6760e+04  8.1000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.063  3.4670e+04  8.0000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.068  3.1680e+04  7.8000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.073  2.8410e+04  7.4000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.078  2.4830e+04  7.0000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.083  2.1360e+04  6.6000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.088  1.8460e+04  6.3000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.093  1.5560e+04  5.9000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.098  1.3460e+04  5.7000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.103  1.1320e+04  5.5000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.108  1.0140e+04  5.5000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.113  8.6400e+03  5.4000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.118  7.6600e+03  5.4000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.123  6.4900e+03  5.4000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.128  5.8400e+03  5.5000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.133  5.3700e+03  5.7000e+02 Barreau:1983ht 
+  6  12   0.280  60.000   0.138  4.9300e+03  6.0000e+02 Barreau:1983ht 
+  6  12   0.320  36.000   0.013  2.8410e+05  1.7800e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.018  1.5420e+05  1.1790e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.022  1.8710e+05  1.1970e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.028  2.6020e+05  1.3810e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.033  2.2770e+05  1.2390e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.037  2.0430e+05  1.1440e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.043  1.8800e+05  1.0770e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.048  1.7590e+05  1.0270e+04 Barreau:1983ht 
+  6  12   0.320  36.000   0.052  1.5170e+05  9.4100e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.058  1.3370e+05  8.7700e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.062  1.0750e+05  7.8600e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.068  9.1440e+04  7.2700e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.072  7.8750e+04  6.8000e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.077  6.1850e+04  6.1900e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.083  5.1520e+04  5.8100e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.087  4.3880e+04  5.5200e+03 Barreau:1983ht 
+  6  12   0.320  36.000   0.092  3.2750e+04  4.7900e+03 Barreau:1983ht 
+  6  12   0.320  60.000   0.003  4.6900e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.008  3.0210e+04  7.8000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.013  2.3290e+04  4.3000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.018  1.6330e+04  3.2000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.023  1.8660e+04  3.6000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.028  1.7660e+04  3.5000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.033  2.0770e+04  4.0000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.038  2.1380e+04  4.1000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.043  2.3300e+04  4.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.048  2.4740e+04  4.7000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.053  2.5830e+04  4.9000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.058  2.6260e+04  5.1000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.063  2.6370e+04  5.3000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.068  2.5960e+04  5.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.073  2.4810e+04  5.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.078  2.2320e+04  5.1000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.083  2.0460e+04  4.9000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.088  1.8140e+04  4.6000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.093  1.5960e+04  4.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.098  1.4210e+04  4.2000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.103  1.2220e+04  4.0000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.108  1.0730e+04  3.8000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.113  9.3200e+03  3.7000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.118  8.1500e+03  3.5000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.123  7.1400e+03  3.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.128  6.1800e+03  3.3000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.133  5.6800e+03  3.2000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.138  5.2600e+03  3.2000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.143  4.6000e+03  3.2000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.148  4.1800e+03  3.3000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.153  3.8100e+03  3.4000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.158  3.3900e+03  3.5000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.163  3.0500e+03  3.6000e+02 Barreau:1983ht 
+  6  12   0.320  60.000   0.168  2.8600e+03  3.9000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.003  2.0000e+02  8.0000e+01 Barreau:1983ht 
+  6  12   0.361  60.000   0.008  8.0100e+03  2.7000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.013  8.5300e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.018  8.8100e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.023  9.2000e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.028  9.2400e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.033  1.0600e+04  1.9000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.038  1.1880e+04  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.043  1.3230e+04  2.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.048  1.4690e+04  2.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.053  1.6020e+04  2.8000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.058  1.7330e+04  3.0000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.063  1.8280e+04  3.2000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.068  1.9050e+04  3.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.073  1.9330e+04  3.5000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.078  1.9400e+04  3.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.083  1.8910e+04  3.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.088  1.7980e+04  3.5000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.093  1.7180e+04  3.4000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.098  1.5760e+04  3.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.103  1.4450e+04  3.2000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.108  1.2910e+04  3.0000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.113  1.1670e+04  2.9000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.118  1.0250e+04  2.7000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.123  9.0500e+03  2.5000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.128  8.0700e+03  2.4000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.133  7.0500e+03  2.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.138  6.3500e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.143  5.5600e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.148  5.0200e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.153  4.6700e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.158  4.2300e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.163  3.8100e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.168  3.7100e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.173  3.4200e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.178  3.3300e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.183  3.2000e+03  2.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.188  3.1800e+03  2.5000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.193  3.2200e+03  2.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.198  3.2400e+03  2.8000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.203  3.3300e+03  3.0000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.208  3.4000e+03  3.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.213  3.5900e+03  3.6000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.218  3.8700e+03  3.9000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.223  4.0600e+03  4.3000e+02 Barreau:1983ht 
+  6  12   0.361  60.000   0.228  4.2900e+03  4.8000e+02 Barreau:1983ht 
+  6  12   0.400  36.000   0.013  1.8100e+05  7.5500e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.018  1.2450e+05  5.7000e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.022  1.1090e+05  5.2600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.028  1.2570e+05  5.6500e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.033  1.3790e+05  5.9900e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.037  1.3980e+05  6.0600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.043  1.3240e+05  5.8700e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.048  1.3420e+05  5.5100e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.052  1.2990e+05  5.4000e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.058  1.2290e+05  5.1900e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.062  1.1540e+05  4.9800e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.068  9.6580e+04  4.4400e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.072  8.9120e+04  4.2200e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.077  7.7230e+04  3.8500e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.083  6.3340e+04  3.4300e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.087  5.6660e+04  3.2100e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.092  4.8490e+04  2.9500e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.098  4.1300e+04  2.7200e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.102  3.4030e+04  2.4900e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.107  3.0360e+04  2.3700e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.113  2.4060e+04  2.1700e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.117  2.1810e+04  1.9700e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.122  1.9590e+04  2.0600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.128  1.6400e+04  1.9600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.133  1.5700e+04  1.9600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.138  1.3260e+04  1.9000e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.142  1.2450e+04  1.9000e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.147  1.3530e+04  1.9600e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.152  1.1870e+04  1.9400e+03 Barreau:1983ht 
+  6  12   0.400  36.000   0.158  1.0200e+04  1.9200e+03 Barreau:1983ht 
+  6  12   0.401  60.000   0.009  1.0500e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.401  60.000   0.013  4.4400e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.018  4.7100e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.024  4.2000e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.401  60.000   0.029  6.1500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.034  5.8300e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.038  6.9400e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.043  7.8800e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.049  8.9100e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.053  1.0170e+04  1.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.059  1.0980e+04  1.9000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.064  1.1980e+04  2.0000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.069  1.2940e+04  2.2000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.073  1.3590e+04  2.4000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.079  1.3680e+04  2.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.084  1.4260e+04  2.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.088  1.4610e+04  2.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.093  1.4300e+04  2.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.099  1.3830e+04  2.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.103  1.3420e+04  2.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.108  1.2540e+04  2.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.114  1.2050e+04  2.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.118  1.1140e+04  2.4000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.123  1.0350e+04  2.3000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.129  9.1100e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.134  8.2800e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.139  7.5300e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.143  6.8000e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.148  6.2700e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.153  5.6400e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.159  5.1400e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.164  4.7400e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.169  4.4100e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.173  4.1500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.178  3.8400e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.183  3.6900e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.189  3.5200e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.194  3.4500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.199  3.4300e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.203  3.4500e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.208  3.4200e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.213  3.4900e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.218  3.6500e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.224  3.7700e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.229  3.8800e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.234  4.0400e+03  2.4000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.238  4.2300e+03  2.6000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.243  4.4200e+03  2.8000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.248  4.5700e+03  3.1000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.254  4.7800e+03  3.4000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.259  5.0800e+03  3.7000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.264  5.1700e+03  4.1000e+02 Barreau:1983ht 
+  6  12   0.401  60.000   0.269  5.1100e+03  4.4000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.007  8.3000e+02  3.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.013  1.2100e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.018  1.3200e+03  3.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.022  1.7700e+03  3.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.028  2.9600e+03  5.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.033  3.1400e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.037  3.6400e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.043  4.3600e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.048  4.9400e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.052  5.8000e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.440  60.000   0.058  6.5300e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.062  7.4400e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.068  8.0900e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.072  8.9200e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.077  9.4700e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.083  9.9500e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.087  1.0260e+04  1.7000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.092  1.0760e+04  1.8000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.098  1.0920e+04  1.9000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.102  1.1230e+04  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.107  1.1070e+04  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.113  1.0810e+04  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.117  1.0590e+04  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.122  1.0170e+04  2.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.128  9.6400e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.133  8.8100e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.138  8.3800e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.142  7.5600e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.147  7.0100e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.152  6.2900e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.158  5.2900e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.163  5.3600e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.168  4.7300e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.172  4.4100e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.177  3.9000e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.182  3.5500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.188  3.5500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.193  3.2500e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.198  3.3800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.203  3.2800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.207  3.1600e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.212  3.2000e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.217  3.2300e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.223  3.2500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.228  3.2800e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.233  3.3800e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.237  3.4900e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.242  3.6800e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.247  3.7600e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.253  3.9000e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.258  3.9900e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.263  4.1000e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.268  4.2600e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.273  4.3800e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.440  60.000   0.278  4.5400e+03  2.4000e+02 Barreau:1983ht 
+  6  12   0.480  36.000   0.013  1.0170e+05  3.3800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.018  8.2540e+04  2.8800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.022  6.2480e+04  2.3800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.028  6.0700e+04  2.3600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.033  7.4870e+04  2.7900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.037  7.6930e+04  2.8800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.043  8.2520e+04  2.8200e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.048  8.6860e+04  2.9700e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.052  9.0870e+04  3.1300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.058  9.0590e+04  3.1800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.062  8.8260e+04  3.1500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.068  8.6560e+04  3.1300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.072  8.0110e+04  2.9700e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.077  7.4390e+04  2.8200e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.083  6.8270e+04  2.6600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.087  6.2230e+04  2.4900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.092  5.5530e+04  2.2900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.098  4.8520e+04  2.0900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.102  4.2720e+04  1.9100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.107  3.6610e+04  1.7300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.113  3.2870e+04  1.6100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.117  2.8140e+04  1.4600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.122  2.4910e+04  1.3600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.128  2.2050e+04  1.2400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.133  1.9570e+04  1.1600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.138  1.7090e+04  1.2300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.142  1.4850e+04  1.1500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.147  1.4320e+04  1.1300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.152  1.2820e+04  1.0900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.158  1.1860e+04  1.0600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.163  1.1580e+04  1.0500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.168  1.1460e+04  1.0500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.172  1.1510e+04  1.0600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.177  1.1320e+04  1.0600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.182  1.0280e+04  1.0400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.188  9.8700e+03  1.0400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.193  9.1000e+03  1.0300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.198  9.8700e+03  9.6000e+02 Barreau:1983ht 
+  6  12   0.480  36.000   0.203  1.0450e+04  9.9000e+02 Barreau:1983ht 
+  6  12   0.480  36.000   0.207  1.1760e+04  1.1300e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.212  1.2070e+04  1.1700e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.217  1.2000e+04  1.1900e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.223  1.2410e+04  1.2400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.228  1.3280e+04  1.3000e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.233  1.3460e+04  1.3500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.237  1.3960e+04  1.4100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.242  1.3920e+04  1.4500e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.247  1.4660e+04  1.5200e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.253  1.5660e+04  1.6100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.258  1.4070e+04  1.6100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.263  1.5270e+04  1.7100e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.268  1.4210e+04  1.7400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.273  1.6380e+04  1.9800e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.278  1.6540e+04  1.9700e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.282  1.6230e+04  2.0400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.287  1.6310e+04  2.1400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.292  1.6800e+04  2.2600e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.297  1.5240e+04  2.2400e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.302  1.6810e+04  2.4200e+03 Barreau:1983ht 
+  6  12   0.480  36.000   0.307  1.9220e+04  2.7200e+03 Barreau:1983ht 
+  6  12   0.480  60.000   0.012  3.8000e+02  1.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.017  3.5000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.022  4.9000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.027  1.2600e+03  3.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.032  1.7000e+03  3.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.037  1.7700e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.042  2.2500e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.047  2.6000e+03  5.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.052  3.1400e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.057  3.6000e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.062  4.1500e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.067  4.7800e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.072  5.2700e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.077  5.7400e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.082  6.2600e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.087  6.6600e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.092  6.9900e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.097  7.5100e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.102  7.6900e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.107  7.8900e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.112  8.1900e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.117  8.0100e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.122  8.1200e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.127  8.1500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.132  7.9300e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.137  7.6500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.142  7.1400e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.147  6.6400e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.152  6.2900e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.157  5.8600e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.162  5.5000e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.167  5.1700e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.172  4.6800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.177  4.3300e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.182  3.9900e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.187  3.6800e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.192  3.4100e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.197  3.2600e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.202  3.1000e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.207  2.9600e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.212  2.8500e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.217  2.7600e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.222  2.6900e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.227  2.7100e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.232  2.7000e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.237  2.7900e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.480  60.000   0.242  2.7700e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.247  2.9400e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.252  3.0700e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.257  3.1800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.262  3.2100e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.267  3.3000e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.272  3.3300e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.277  3.4700e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.282  3.6500e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.287  3.7000e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.292  3.8200e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.297  4.0400e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.302  4.0000e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.307  4.1100e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.312  4.3400e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.317  4.3800e+03  2.2000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.322  4.2600e+03  2.4000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.327  4.4500e+03  2.6000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.332  4.5500e+03  2.9000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.337  4.5300e+03  3.1000e+02 Barreau:1983ht 
+  6  12   0.480  60.000   0.342  4.6200e+03  4.0000e+02 Barreau:1983ht 
+  6  12   0.500  60.000   0.020  1.7900e+02  1.9000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.026  1.0200e+02  1.3000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.030  5.7500e+02  5.2000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.036  1.3800e+03  1.1000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.040  1.2000e+03  9.0000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.046  9.2100e+02  7.1000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.056  1.2600e+03  7.0000e+01 Whitney:1974hr 
+  6  12   0.500  60.000   0.060  2.5900e+03  1.3000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.066  2.9900e+03  1.4000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.076  3.7500e+03  1.5000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.086  4.7500e+03  1.9000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.096  5.4600e+03  2.2000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.100  6.2500e+03  2.5000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.105  6.3200e+03  2.6000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.114  7.0900e+03  2.8000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.125  6.9700e+03  2.8000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.135  7.2800e+03  2.9000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.140  6.6100e+03  2.8000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.145  6.9700e+03  2.8000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.155  6.5400e+03  2.6000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.165  5.9100e+03  2.4000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.174  5.2300e+03  2.1000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.184  4.4300e+03  1.8000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.194  3.7900e+03  1.5000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.204  3.3800e+03  1.4000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.214  2.9600e+03  1.4000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.224  2.6400e+03  1.3000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.234  2.6100e+03  1.4000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.244  2.4300e+03  1.5000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.253  2.5500e+03  1.6000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.263  2.5400e+03  1.6000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.273  2.8800e+03  1.9000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.283  2.9400e+03  2.1000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.293  2.9400e+03  2.1000e+02 Whitney:1974hr 
+  6  12   0.500  60.000   0.303  3.4200e+03  2.4000e+02 Whitney:1974hr 
+  6  12   0.519  60.000   0.011  2.5000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.021  9.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.031  8.2000e+02  3.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.041  1.0400e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.051  1.5900e+03  4.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.061  2.3000e+03  5.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.071  3.1300e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.081  3.8300e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.091  4.6600e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.101  5.3000e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.111  5.9800e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.121  6.2800e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.131  6.4000e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.141  6.4400e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.151  6.0600e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.161  5.4900e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.171  4.9100e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.181  4.2800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.191  3.5300e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.201  3.1900e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.211  2.8800e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.221  2.5100e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.231  2.3600e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.241  2.3100e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.251  2.4300e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.261  2.6200e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.519  60.000   0.271  2.6500e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.281  3.0900e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.291  3.2000e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.301  3.4700e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.311  3.5600e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.321  3.8100e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.331  3.8500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.341  3.8400e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.351  4.1300e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.361  4.0000e+03  2.3000e+02 Barreau:1983ht 
+  6  12   0.519  60.000   0.371  3.9200e+03  2.7000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.013  5.2550e+04  1.6500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.022  3.0650e+04  1.0900e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.033  3.5030e+04  1.2500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.043  4.4090e+04  1.5500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.052  5.1190e+04  2.0000e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.062  5.5510e+04  2.1700e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.072  5.8570e+04  2.3000e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.083  5.5270e+04  2.2500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.092  5.3500e+04  2.2200e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.102  4.5030e+04  2.0000e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.113  3.7340e+04  1.7700e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.122  3.0420e+04  1.3500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.133  2.3200e+04  1.1300e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.142  1.8790e+04  1.0400e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.152  1.5700e+04  9.4000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.163  1.2760e+04  8.4000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.172  1.0740e+04  7.6000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.182  9.1500e+03  7.1000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.193  9.9900e+03  7.3000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.203  9.5600e+03  7.2000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.212  9.8300e+03  6.3000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.223  9.7600e+03  6.7000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.233  1.0560e+04  7.1000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.242  1.0890e+04  7.4000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.253  1.2560e+04  8.1000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.263  1.1700e+04  8.2000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.273  1.3180e+04  9.0000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.282  1.4010e+04  9.2000e+02 Barreau:1983ht 
+  6  12   0.560  36.000   0.292  1.4230e+04  1.0500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.302  1.3360e+04  1.0800e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.312  1.4040e+04  1.1600e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.323  1.3960e+04  1.2300e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.333  1.4960e+04  1.3500e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.343  1.4280e+04  1.4600e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.352  1.4780e+04  1.5900e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.362  1.3780e+04  1.6800e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.372  1.4170e+04  1.8600e+03 Barreau:1983ht 
+  6  12   0.560  36.000   0.383  1.2780e+04  1.9200e+03 Barreau:1983ht 
+  6  12   0.560  60.000   0.013  3.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.022  3.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.033  3.2000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.043  4.8000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.052  7.5000e+02  4.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.062  1.1700e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.072  1.6200e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.083  2.2100e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.560  60.000   0.092  2.7800e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.102  3.4300e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.113  3.9300e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.122  4.5400e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.133  4.7600e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.142  4.9600e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.152  4.9500e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.163  4.8200e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.172  4.6700e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.182  4.2600e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.193  3.9700e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.203  3.5100e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.212  2.9300e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.223  2.5600e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.233  2.3800e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.242  2.1200e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.253  2.1000e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.263  2.0500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.273  2.2100e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.282  2.2400e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.292  2.3300e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.302  2.5200e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.312  2.7600e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.323  2.8200e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.333  3.1100e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.343  3.2400e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.352  3.1000e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.362  3.4200e+03  2.3000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.372  3.6300e+03  2.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.383  3.4000e+03  2.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.393  3.3600e+03  3.0000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.403  3.2800e+03  3.3000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.412  3.1300e+03  3.6000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.422  2.8900e+03  4.2000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.432  2.8600e+03  4.9000e+02 Barreau:1983ht 
+  6  12   0.560  60.000   0.443  2.4900e+03  5.9000e+02 Barreau:1983ht 
+  6  12   0.560 145.000   0.193  1.0000e+01  2.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.203  1.6000e+01  3.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.212  2.3000e+01  1.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.223  3.4000e+01  2.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.233  4.9000e+01  3.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.242  6.6000e+01  3.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.253  9.2000e+01  4.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.263  1.2300e+02  5.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.273  1.5100e+02  7.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.282  1.7100e+02  7.0000e+00 Barreau:1983ht 
+  6  12   0.560 145.000   0.292  1.8500e+02  1.0000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.302  2.1100e+02  1.1000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.312  2.2000e+02  1.2000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.323  2.3400e+02  1.3000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.333  2.4100e+02  1.3000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.343  2.3600e+02  1.4000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.352  2.1700e+02  1.3000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.362  2.0700e+02  1.4000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.372  2.0500e+02  1.4000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.383  2.1500e+02  1.4000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.393  2.3500e+02  1.7000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.403  2.5800e+02  1.9000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.412  2.9000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.422  3.3100e+02  2.5000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.432  3.6100e+02  2.8000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.443  4.0600e+02  3.4000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.453  4.0100e+02  3.7000e+01 Barreau:1983ht 
+  6  12   0.560 145.000   0.463  4.2100e+02  4.3000e+01 Barreau:1983ht 
+  6  12   0.620  36.000   0.013  1.6870e+04  5.9000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.022  1.8290e+04  6.6000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.033  1.8310e+04  6.9000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.043  2.5880e+04  9.3000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.052  3.0210e+04  1.0800e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.062  3.5980e+04  1.2700e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.072  4.1130e+04  1.3700e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.083  4.2830e+04  1.4500e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.092  4.2220e+04  1.4600e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.102  3.9590e+04  1.4100e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.113  3.6340e+04  1.3500e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.122  3.0800e+04  1.2000e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.133  2.6490e+04  1.0800e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.142  2.1550e+04  9.3000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.152  1.7850e+04  8.1000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.163  1.4580e+04  7.1000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.172  1.2240e+04  6.3000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.182  1.0630e+04  5.6000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.193  9.7600e+03  5.2000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.203  9.1000e+03  5.7000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.212  8.3800e+03  5.5000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.223  8.5400e+03  5.5000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.233  9.1500e+03  5.8000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.242  9.7300e+03  5.9000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.253  9.8800e+03  6.0000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.263  1.0880e+04  6.4000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.273  1.1160e+04  6.1000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.282  1.1500e+04  7.0000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.292  1.2170e+04  7.4000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.302  1.2420e+04  7.7000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.312  1.2290e+04  7.9000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.323  1.3420e+04  8.5000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.333  1.3190e+04  8.8000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.343  1.3440e+04  8.6000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.352  1.2860e+04  9.7000e+02 Barreau:1983ht 
+  6  12   0.620  36.000   0.362  1.2710e+04  1.0100e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.372  1.1580e+04  1.0300e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.383  1.2510e+04  1.1200e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.393  1.2170e+04  1.1800e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.403  1.1130e+04  1.2100e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.412  1.1570e+04  1.3200e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.422  9.9900e+03  1.3700e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.432  9.7200e+03  1.5000e+03 Barreau:1983ht 
+  6  12   0.620  36.000   0.443  1.0150e+04  1.6100e+03 Barreau:1983ht 
+  6  12   0.620  60.000   0.037  9.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.048  1.5000e+02  1.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.058  2.6000e+02  1.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.068  4.3000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.077  6.6000e+02  3.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.087  9.8000e+02  4.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.098  1.3200e+03  5.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.107  1.7000e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.117  2.0100e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.128  2.4800e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.138  2.9100e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.147  3.1100e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.158  3.3500e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.168  3.6700e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.177  3.6500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.188  3.5700e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.198  3.4900e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.207  3.1400e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.217  2.8400e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.228  2.5100e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.237  2.3800e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.247  2.1600e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.258  1.9700e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.268  1.8700e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.620  60.000   0.278  1.6700e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.287  1.6700e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.297  1.7900e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.307  1.8300e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.318  1.8900e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.328  2.1500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.338  2.2700e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.347  2.3200e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.357  2.3700e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.367  2.5800e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.378  2.6400e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.388  2.8000e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.398  2.6800e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.407  2.7500e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.417  2.5900e+03  1.9000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.427  2.6900e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.438  2.6800e+03  2.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.448  2.4300e+03  2.7000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.458  2.1800e+03  2.9000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.468  2.3000e+03  3.2000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.477  2.0000e+03  3.1000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.487  2.1700e+03  3.7000e+02 Barreau:1983ht 
+  6  12   0.620  60.000   0.497  1.8900e+03  4.3000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.013  3.7700e+03  2.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.022  8.2000e+03  3.9000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.033  1.1500e+04  5.0000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.043  1.4740e+04  6.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.052  1.8490e+04  7.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.062  2.3630e+04  9.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.072  2.6870e+04  1.0200e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.083  2.9420e+04  1.1200e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.092  3.1890e+04  1.2100e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.102  3.1620e+04  1.2300e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.113  3.0230e+04  1.2000e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.122  2.8090e+04  1.1500e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.133  2.6550e+04  1.0400e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.142  2.2520e+04  9.3000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.152  1.9110e+04  8.3000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.163  1.6730e+04  7.6000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.172  1.2990e+04  6.5000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.182  1.1710e+04  6.0000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.193  1.0240e+04  5.5000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.203  9.2600e+03  5.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.212  8.3800e+03  4.8000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.223  7.4600e+03  4.5000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.233  8.0100e+03  4.6000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.242  7.9400e+03  4.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.253  8.2600e+03  4.2000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.263  8.3800e+03  4.7000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.273  9.1700e+03  5.0000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.282  9.6800e+03  5.2000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.292  1.0210e+04  5.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.302  1.0200e+04  5.5000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.312  1.0870e+04  5.8000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.323  1.0930e+04  5.9000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.333  1.1280e+04  5.7000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.343  1.1430e+04  6.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.352  1.1700e+04  6.7000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.362  1.1680e+04  6.8000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.372  1.1920e+04  7.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.383  1.0860e+04  7.0000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.393  1.0860e+04  7.2000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.403  9.4600e+03  7.1000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.412  9.5000e+03  7.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.422  9.0600e+03  7.7000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.432  8.5500e+03  7.9000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.443  8.3500e+03  8.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.453  8.3900e+03  8.4000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.463  7.6500e+03  9.3000e+02 Barreau:1983ht 
+  6  12   0.680  36.000   0.472  7.2000e+03  1.0000e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.482  7.2000e+03  1.0900e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.492  7.0900e+03  1.2100e+03 Barreau:1983ht 
+  6  12   0.680  36.000   0.502  7.0500e+03  1.4000e+03 Barreau:1983ht 
+  6  12   0.680  60.000   0.048  5.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.058  4.0000e+01  1.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.068  1.2000e+02  1.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.077  1.6000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.087  3.1000e+02  2.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.098  4.5000e+02  3.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.107  6.1000e+02  4.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.117  7.7000e+02  4.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.128  1.0200e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.138  1.2200e+03  5.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.147  1.5700e+03  6.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.158  1.8300e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.168  1.9900e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.177  2.2400e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.188  2.4000e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.198  2.5100e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.207  2.4500e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.217  2.5300e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.228  2.4300e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.237  2.2900e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.247  2.1300e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.258  1.9500e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.268  1.6200e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.278  1.6000e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.287  1.4700e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.297  1.4400e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.307  1.3900e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.318  1.5100e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.328  1.4300e+03  7.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.338  1.4600e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.347  1.5400e+03  8.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.357  1.6500e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.367  1.7400e+03  9.0000e+01 Barreau:1983ht 
+  6  12   0.680  60.000   0.378  1.7800e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.388  1.9900e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.398  1.9800e+03  1.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.407  1.9900e+03  1.1000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.417  2.0500e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.427  2.2200e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.438  2.0000e+03  1.2000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.448  2.2500e+03  1.3000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.458  2.0800e+03  1.4000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.468  2.1400e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.477  1.9500e+03  1.5000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.487  2.0300e+03  1.7000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.497  1.7400e+03  1.6000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.507  1.7400e+03  1.8000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.517  1.6800e+03  2.0000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.527  1.5800e+03  2.3000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.537  1.4800e+03  2.5000e+02 Barreau:1983ht 
+  6  12   0.680  60.000   0.547  1.4800e+03  3.0000e+02 Barreau:1983ht 
+  6  12   0.730  37.100   0.005  1.1174e+03  4.2759e+01 O'Connell:1987ag 
+  6  12   0.730  37.100   0.015  1.4180e+03  3.7414e+01 O'Connell:1987ag 
+  6  12   0.730  37.100   0.025  3.6748e+03  6.5014e+01 O'Connell:1987ag 
+  6  12   0.730  37.100   0.045  7.4353e+03  1.9283e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.055  1.0019e+04  2.2633e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.065  1.2674e+04  2.6096e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.085  1.8846e+04  2.9542e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.095  2.0188e+04  3.0471e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.105  2.1519e+04  2.6191e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.115  2.1858e+04  4.4757e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.125  2.1542e+04  2.8092e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.135  2.0625e+04  3.4395e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.145  1.8881e+04  3.3278e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.165  1.5554e+04  3.2286e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.175  1.2795e+04  2.0623e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.195  9.9127e+03  3.0260e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.205  7.4581e+03  2.5900e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.215  7.6062e+03  2.5459e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.225  6.8892e+03  2.6737e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.235  6.3334e+03  2.4752e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.245  6.0953e+03  2.4339e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.255  6.4939e+03  2.5976e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.265  7.1649e+03  2.6313e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.275  7.0671e+03  2.6520e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.285  7.6411e+03  2.8420e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.295  7.7949e+03  1.9823e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.305  8.5938e+03  3.0396e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.315  8.8331e+03  3.0356e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.325  8.1816e+03  2.9986e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.335  9.6579e+03  2.8874e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.345  9.7302e+03  2.0204e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.365  9.9032e+03  2.1629e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.375  9.5356e+03  3.0291e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.385  9.2973e+03  2.1999e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.395  9.4580e+03  3.1211e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.405  9.0358e+03  2.2700e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.425  8.6668e+03  1.6094e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.435  8.3703e+03  2.2314e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.445  8.1043e+03  2.3677e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.455  8.0652e+03  3.3520e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.465  7.5875e+03  2.0834e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.475  6.6721e+03  2.9563e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.485  6.1654e+03  4.0253e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.495  6.6862e+03  2.5589e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.505  6.0604e+03  3.2902e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.515  6.6416e+03  3.4600e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.525  6.1781e+03  3.5921e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.545  5.3309e+03  3.9896e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.565  4.2407e+03  4.1378e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.595  4.3216e+03  6.7109e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.605  5.3500e+03  5.1360e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.615  3.8220e+03  6.1944e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.625  7.2773e+03  7.5061e+02 O'Connell:1987ag 
+  6  12   0.730  37.100   0.415  8.2295e+03  3.0870e+02 O'Connell:1987ag 
+  6  12   0.961  37.500   0.073  7.4640e+02  8.3040e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.083  1.1450e+03  7.9320e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.093  1.5960e+03  9.3120e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.103  2.2210e+03  1.0820e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.113  2.8610e+03  1.2420e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.123  3.4820e+03  1.3580e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.133  4.1660e+03  1.2960e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.143  5.1670e+03  1.3270e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.153  5.2980e+03  1.9430e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.163  5.7300e+03  2.0140e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.173  6.3830e+03  2.0990e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.183  6.6380e+03  1.8120e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.193  6.7900e+03  1.5200e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.203  6.6010e+03  1.6620e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.213  6.1550e+03  2.0150e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.223  6.0130e+03  1.9900e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.233  5.8130e+03  1.7200e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.243  5.3220e+03  1.2230e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.253  4.8130e+03  1.4390e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.263  4.4030e+03  1.4690e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.273  3.9130e+03  1.3670e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.283  3.9640e+03  1.1390e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.293  3.6140e+03  9.3960e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.303  3.6220e+03  1.2200e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.313  3.3410e+03  1.1750e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.323  3.4360e+03  1.1880e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.333  3.5470e+03  8.6760e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.343  3.4000e+03  1.1230e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.353  3.7310e+03  1.2940e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.363  3.7040e+03  1.2780e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.373  3.9060e+03  1.0030e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.383  4.0570e+03  1.2820e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.393  4.1320e+03  1.4360e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.403  4.0810e+03  1.4230e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.413  4.3440e+03  1.0420e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.423  4.1120e+03  1.4260e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.433  4.6660e+03  1.5280e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.443  4.5080e+03  1.2700e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.453  4.4030e+03  1.1960e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.463  4.5100e+03  1.5460e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.473  4.3620e+03  1.5060e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.483  4.4340e+03  1.0440e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.493  4.2460e+03  1.3970e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.503  4.0820e+03  1.3500e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.513  3.9350e+03  9.5880e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.523  3.6600e+03  1.1880e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.533  3.5270e+03  1.1630e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.543  3.5240e+03  8.9640e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.553  3.3440e+03  1.2530e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.563  3.3900e+03  1.2310e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.573  3.1700e+03  9.4920e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.583  3.1150e+03  1.1950e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.593  3.0180e+03  1.0120e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.603  2.9690e+03  1.0880e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.613  2.8450e+03  1.1770e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.623  2.9420e+03  9.1680e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.633  2.6760e+03  1.0990e+02 Sealock:1989nx 
+  6  12   0.961  37.500   0.643  2.7950e+03  7.8000e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.653  2.8680e+03  9.3960e+01 Sealock:1989nx 
+  6  12   0.961  37.500   0.663  2.9980e+03  1.2640e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.127  7.9560e+02  6.2160e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.137  1.1870e+03  7.0080e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.147  1.2830e+03  7.4280e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.157  1.6120e+03  8.2320e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.167  2.1300e+03  9.3720e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.177  2.3450e+03  9.9240e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.187  2.8330e+03  8.2680e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.197  2.9990e+03  7.5960e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.207  3.3530e+03  9.5400e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.217  3.6880e+03  1.1470e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.227  3.7380e+03  1.1570e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.237  3.7790e+03  1.1500e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.247  3.8140e+03  9.8880e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.257  3.9020e+03  8.5680e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.267  3.8000e+03  1.1420e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.277  3.6290e+03  1.2230e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.287  3.4620e+03  1.1870e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.297  3.1790e+03  1.1300e+02 Sealock:1989nx 
+  6  12   1.108  37.500   0.307  3.0740e+03  7.7160e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.317  2.7590e+03  7.1520e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.327  2.5940e+03  8.8440e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.337  2.5140e+03  8.6280e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.347  2.2660e+03  8.1480e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.357  2.2990e+03  6.3240e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.367  2.2250e+03  5.8320e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.377  2.1730e+03  7.7040e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.387  2.2980e+03  7.8720e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.397  2.3280e+03  8.0160e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.407  2.4700e+03  6.6840e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.417  2.4900e+03  6.7680e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.427  2.5240e+03  8.8800e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.437  2.6260e+03  9.1200e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.447  2.7590e+03  9.3480e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.457  2.6780e+03  6.6480e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.467  2.7460e+03  8.8440e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.477  2.7640e+03  9.7440e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.487  2.8610e+03  9.9000e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.497  2.9210e+03  7.3080e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.507  2.8850e+03  8.0040e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.517  2.7830e+03  9.1320e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.527  2.9040e+03  9.3360e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.537  2.7950e+03  6.6720e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.547  2.7480e+03  7.2960e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.557  2.4620e+03  8.1120e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.567  2.4520e+03  7.9920e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.577  2.4300e+03  5.5080e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.587  2.4310e+03  7.5960e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.597  2.3630e+03  7.4520e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.607  2.2450e+03  5.9040e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.617  2.2660e+03  5.6160e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.627  2.2620e+03  6.4440e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.637  2.2490e+03  5.8200e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.647  2.1380e+03  4.6320e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.657  2.1540e+03  5.6400e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.667  2.1530e+03  5.6520e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.677  2.1050e+03  4.2720e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.687  2.1130e+03  5.3160e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.697  2.0030e+03  4.5360e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.707  2.1520e+03  3.6600e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.717  2.0320e+03  4.2480e+01 Sealock:1989nx 
+  6  12   1.108  37.500   0.727  2.0750e+03  4.2840e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.163  2.5800e+02  1.8840e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.173  2.9400e+02  1.9560e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.183  3.9840e+02  1.7760e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.193  4.6560e+02  1.8960e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.203  6.1200e+02  2.7720e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.213  7.3560e+02  3.8520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.223  8.4840e+02  4.1280e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.233  9.5160e+02  4.3800e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.243  1.1680e+03  4.7280e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.253  1.3420e+03  3.9240e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.263  1.4500e+03  3.8760e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.273  1.4570e+03  4.7160e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.283  1.5890e+03  5.8560e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.293  1.7630e+03  6.1080e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.303  1.7510e+03  6.0720e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.313  1.7500e+03  6.1080e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.323  1.8430e+03  4.4520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.333  1.7560e+03  4.0560e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.343  1.8290e+03  5.5320e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.353  1.7120e+03  5.3520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.363  1.7040e+03  5.2920e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.373  1.6210e+03  5.1120e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.383  1.5710e+03  6.6720e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.393  1.4860e+03  5.0520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.403  1.4260e+03  4.9200e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.413  1.3550e+03  4.7880e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.423  1.3540e+03  4.6800e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.433  1.3430e+03  4.7280e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.443  1.4400e+03  3.7440e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.453  1.3550e+03  3.2400e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.463  1.3390e+03  4.0800e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.473  1.4180e+03  4.5600e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.483  1.3980e+03  4.5600e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.493  1.4480e+03  4.6440e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.503  1.4750e+03  3.5280e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.513  1.6070e+03  4.1880e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.523  1.5710e+03  5.5800e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.533  1.6340e+03  5.6520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.543  1.6920e+03  5.7120e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.553  1.6930e+03  4.4880e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.563  1.5980e+03  4.0920e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.573  1.6540e+03  5.5200e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.583  1.6540e+03  5.5680e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.593  1.6780e+03  5.5920e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.603  1.6400e+03  4.1400e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.613  1.6250e+03  4.4640e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.623  1.6790e+03  5.7840e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.633  1.6130e+03  5.5800e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.643  1.5980e+03  5.0280e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.653  1.5430e+03  3.8520e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.663  1.4800e+03  5.2440e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.673  1.5290e+03  5.2440e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.683  1.4960e+03  5.2320e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.693  1.5120e+03  3.6240e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.703  1.3860e+03  4.4040e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.713  1.3370e+03  4.6560e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.723  1.4350e+03  4.8240e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.733  1.4080e+03  3.3600e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.743  1.2960e+03  4.5240e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.753  1.4140e+03  4.7160e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.763  1.4320e+03  4.0080e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.773  1.4950e+03  3.6480e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.783  1.4020e+03  4.7040e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.793  1.3620e+03  4.6320e+01 Sealock:1989nx 
+  6  12   1.299  37.500   0.803  1.5170e+03  4.8840e+01 Sealock:1989nx 
+  6  12   1.300  11.950   0.030  9.3096e+05  2.2404e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.040  9.5960e+05  1.6964e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.050  9.5579e+05  1.6637e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.060  9.3811e+05  2.3700e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.070  8.7454e+05  2.1925e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.080  7.3970e+05  1.9792e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.090  6.0424e+05  1.1974e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.100  5.1212e+05  1.3913e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.110  4.1230e+05  1.2092e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.120  3.0604e+05  1.0284e+04 Baran:1988tw 
+  6  12   1.300  11.950   0.130  2.4189e+05  8.9093e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.140  1.9607e+05  4.5681e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.150  1.5900e+05  4.8132e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.160  1.3388e+05  4.3140e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.170  1.2098e+05  4.0319e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.180  1.1141e+05  2.4924e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.190  1.0174e+05  2.8199e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.200  1.0702e+05  2.8597e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.210  1.0706e+05  2.3781e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.220  1.1605e+05  2.5063e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.230  1.1563e+05  2.5642e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.240  1.2260e+05  2.8734e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.250  1.3136e+05  2.9695e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.260  1.3610e+05  3.0673e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.270  1.3904e+05  3.0968e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.280  1.4416e+05  3.1696e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.290  1.4284e+05  4.0396e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.300  1.5251e+05  4.2621e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.310  1.5945e+05  3.3964e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.320  1.5615e+05  4.5136e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.330  1.4944e+05  4.4287e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.340  1.5708e+05  3.4597e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.350  1.5474e+05  4.3355e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.360  1.5569e+05  4.3229e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.370  1.3791e+05  2.8918e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.380  1.3770e+05  3.2793e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.390  1.2245e+05  3.1715e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.400  1.2043e+05  3.2436e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.410  1.1306e+05  3.2007e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.420  1.0740e+05  3.2221e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.430  1.0277e+05  3.1792e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.440  9.3566e+04  3.0632e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.450  8.8613e+04  3.0445e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.460  8.3624e+04  2.4836e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.470  7.8446e+04  2.6320e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.480  7.2782e+04  2.6413e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.490  7.0460e+04  2.4374e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.500  6.4244e+04  2.6066e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.510  6.1710e+04  2.6234e+03 Baran:1988tw 
+  6  12   1.300  11.950   0.520  5.8797e+04  2.6612e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.020  7.9665e+05  1.9757e+04 Baran:1988tw 
+  6  12   1.300  13.540   0.030  4.3789e+05  1.1086e+04 Baran:1988tw 
+  6  12   1.300  13.540   0.040  4.8234e+05  7.8653e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.050  5.1574e+05  7.8977e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.060  5.4700e+05  1.0394e+04 Baran:1988tw 
+  6  12   1.300  13.540   0.070  5.2658e+05  1.0155e+04 Baran:1988tw 
+  6  12   1.300  13.540   0.080  4.8480e+05  9.7893e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.090  4.3454e+05  5.8223e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.100  3.7067e+05  6.5790e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.110  3.0080e+05  5.7413e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.120  2.3744e+05  5.0021e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.130  1.8793e+05  4.3324e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.140  1.5489e+05  2.3946e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.150  1.3254e+05  2.6790e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.160  1.0987e+05  2.3566e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.170  9.1335e+04  2.1211e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.180  8.5560e+04  1.3401e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.190  7.6155e+04  1.5841e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.200  7.4381e+04  1.5328e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.210  7.5515e+04  1.5730e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.220  7.5660e+04  1.6664e+03 Baran:1988tw 
+  6  12   1.300  13.540   0.230  7.9371e+04  1.7831e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.030  5.2613e+05  6.1979e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.040  5.6523e+05  9.5412e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.050  6.0897e+05  9.5758e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.060  6.7542e+05  9.8335e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.070  6.4316e+05  9.5982e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.080  6.1945e+05  6.2595e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.090  5.4940e+05  5.8666e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.100  4.6340e+05  6.6168e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.110  3.9202e+05  6.0078e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.120  3.1907e+05  5.3120e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.130  2.4783e+05  4.6023e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.140  2.1501e+05  2.9294e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.150  1.8415e+05  3.5698e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.160  1.5314e+05  3.1745e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.170  1.2977e+05  2.8399e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.180  1.1229e+05  2.6106e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.190  1.0291e+05  1.4794e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.200  9.8618e+04  1.6941e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.210  9.5424e+04  1.6507e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.220  9.2986e+04  1.6264e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.230  9.4808e+04  1.6769e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.240  9.8356e+04  1.3005e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.250  1.0601e+05  1.3675e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.260  1.0763e+05  1.8524e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.270  1.1598e+05  1.9504e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.280  1.1818e+05  2.0481e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.290  1.1834e+05  1.4992e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.300  1.2304e+05  2.0988e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.310  1.2725e+05  2.0746e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.320  1.2407e+05  2.0647e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.330  1.2415e+05  2.0889e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.340  1.2612e+05  1.5412e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.350  1.2688e+05  2.0853e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.360  1.2310e+05  2.0312e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.370  1.2231e+05  2.0159e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.380  1.1874e+05  1.3887e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.390  1.1597e+05  1.7139e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.400  1.1021e+05  1.6417e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.410  1.0792e+05  1.6383e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.420  1.0274e+05  1.6489e+03 Baran:1988tw 
+  6  12   1.500  11.950   0.430  9.2295e+04  1.6215e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.040  2.4373e+05  5.3800e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.050  2.8296e+05  5.6584e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.060  2.9919e+05  5.6276e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.070  3.3836e+05  6.0564e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.080  3.6145e+05  4.8982e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.090  3.3493e+05  4.5756e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.100  3.2352e+05  6.7916e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.110  2.6514e+05  5.9406e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.120  2.4541e+05  5.5796e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.130  2.1072e+05  5.1966e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.140  1.7345e+05  2.9898e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.150  1.5438e+05  3.5335e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.160  1.2324e+05  2.9807e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.170  1.0264e+05  2.6183e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.180  8.5607e+04  2.3732e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.190  7.9920e+04  1.3836e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.200  7.1877e+04  1.2952e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.210  6.7310e+04  1.4759e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.220  6.5397e+04  1.4435e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.230  6.6201e+04  1.4722e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.240  6.4869e+04  1.1090e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.250  6.7608e+04  1.1471e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.260  6.8399e+04  1.6210e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.270  7.4223e+04  1.6639e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.280  7.5058e+04  1.7109e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.290  8.1059e+04  1.3419e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.300  8.2755e+04  1.9084e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.310  8.2211e+04  1.8567e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.320  8.5495e+04  1.9022e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.330  8.4328e+04  1.9218e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.340  8.6021e+04  1.4137e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.350  8.6772e+04  1.9931e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.360  8.5897e+04  1.9487e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.370  8.3131e+04  1.9442e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.380  8.3651e+04  1.1879e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.390  7.9108e+04  1.3719e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.400  7.6460e+04  1.2998e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.410  7.1875e+04  1.2499e+03 Baran:1988tw 
+  6  12   1.500  13.540   0.420  6.9097e+04  1.2526e+03 Baran:1988tw 
+  6  12   1.501  37.500   0.256  1.7880e+02  9.2400e+00 Sealock:1989nx 
+  6  12   1.501  37.500   0.266  2.2800e+02  1.0200e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.276  3.0120e+02  8.7600e+00 Sealock:1989nx 
+  6  12   1.501  37.500   0.286  3.4920e+02  9.3600e+00 Sealock:1989nx 
+  6  12   1.501  37.500   0.296  3.9480e+02  1.1160e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.306  4.5480e+02  1.5600e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.316  5.2200e+02  1.6440e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.326  5.4840e+02  1.7160e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.336  6.3480e+02  1.8240e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.346  6.7080e+02  1.8720e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.356  7.7880e+02  1.6080e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.366  7.8120e+02  1.5360e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.376  8.2560e+02  1.9440e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.386  8.3280e+02  2.4360e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.396  8.4960e+02  2.4480e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.406  8.5800e+02  2.4240e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.416  8.7000e+02  2.4480e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.426  8.7600e+02  2.0400e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.436  8.7720e+02  1.6680e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.446  8.2080e+02  1.7040e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.456  8.3880e+02  2.2560e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.466  8.2440e+02  2.2200e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.476  8.4240e+02  2.2200e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.486  7.7520e+02  2.1240e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.496  7.4160e+02  1.8000e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.506  7.6200e+02  1.5840e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.516  6.9840e+02  1.5960e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.526  6.9960e+02  2.2800e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.536  6.8400e+02  2.2440e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.546  7.1520e+02  2.3040e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.556  7.6080e+02  2.3640e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.566  8.0040e+02  1.7640e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.576  8.0280e+02  1.6800e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.586  8.0640e+02  2.1120e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.596  8.7600e+02  2.3760e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.606  8.9640e+02  2.4240e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.616  8.8200e+02  2.4120e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.626  9.0120e+02  1.9320e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.636  9.3600e+02  1.7400e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.646  9.2880e+02  2.2800e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.656  9.2520e+02  2.4840e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.666  9.6480e+02  2.5320e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.676  9.2280e+02  2.4480e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.686  9.6720e+02  1.8720e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.696  9.2880e+02  1.8120e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.706  9.5280e+02  2.4600e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.716  9.1440e+02  2.4000e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.726  9.0600e+02  2.4000e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.736  8.9760e+02  1.8000e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.746  8.6760e+02  1.5960e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.756  9.0600e+02  2.2320e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.766  8.7000e+02  2.1600e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.776  9.0000e+02  2.1960e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.786  8.8320e+02  1.8720e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.796  8.9280e+02  1.7160e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.806  8.7720e+02  2.3880e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.816  8.6400e+02  2.3760e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.826  8.6280e+02  2.3640e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.836  8.8080e+02  1.8480e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.846  8.6640e+02  2.1360e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.856  8.8320e+02  2.6400e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.866  9.3240e+02  2.6880e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.876  9.2400e+02  2.6760e+01 Sealock:1989nx 
+  6  12   1.501  37.500   0.886  8.7240e+02  2.8680e+01 Sealock:1989nx 
+  6  12   1.650  11.950   0.030  3.2396e+05  5.2538e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.040  3.7859e+05  5.5755e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.050  4.0692e+05  4.5048e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.060  4.5161e+05  4.6554e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.070  4.7909e+05  4.7964e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.080  4.7089e+05  6.8944e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.090  4.7808e+05  6.9656e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.100  4.1963e+05  6.5213e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.110  3.7603e+05  6.2365e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.120  3.2397e+05  3.9117e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.130  2.7178e+05  3.4161e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.140  2.2411e+05  3.9785e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.150  1.8254e+05  3.5514e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.160  1.5556e+05  3.2185e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.170  1.3564e+05  1.7955e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.180  1.1360e+05  1.4351e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.190  1.0032e+05  1.5417e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.200  9.1758e+04  1.4253e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.210  8.6537e+04  1.3824e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.220  8.2889e+04  1.3627e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.230  8.6643e+04  1.0507e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.240  8.9520e+04  1.0556e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.250  9.2661e+04  1.4839e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.260  9.2073e+04  1.4540e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.270  9.6154e+04  1.5206e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.280  9.9363e+04  1.5870e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.290  1.0806e+05  1.6783e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.300  1.0922e+05  1.7732e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.310  1.1394e+05  2.0073e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.320  1.1618e+05  1.9293e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.330  1.1763e+05  1.8512e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.340  1.1951e+05  2.0853e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.350  1.1915e+05  2.0421e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.360  1.1530e+05  1.9651e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.370  1.1596e+05  1.9498e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.380  1.1512e+05  1.9601e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.390  1.0841e+05  1.3507e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.400  1.0227e+05  1.3152e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.410  9.8445e+04  1.7340e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.420  9.6016e+04  1.7210e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.430  9.2806e+04  1.6817e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.440  8.7306e+04  1.1706e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.450  8.3263e+04  1.5386e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.460  7.5245e+04  1.4123e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.470  7.2463e+04  1.3936e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.480  7.0795e+04  1.3848e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.490  6.6436e+04  9.9066e+02 Baran:1988tw 
+  6  12   1.650  11.950   0.500  6.4571e+04  1.3411e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.510  6.2391e+04  1.2900e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.520  5.7711e+04  1.2656e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.530  5.5144e+04  9.6666e+02 Baran:1988tw 
+  6  12   1.650  11.950   0.540  5.3845e+04  1.3578e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.550  5.1175e+04  1.2995e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.560  4.8190e+04  1.2861e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.570  4.4998e+04  1.2845e+03 Baran:1988tw 
+  6  12   1.650  11.950   0.580  4.5271e+04  1.3267e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.040  1.4550e+05  2.5269e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.050  1.7543e+05  2.2920e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.060  1.9897e+05  2.3776e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.070  2.2176e+05  2.5087e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.080  2.4380e+05  4.0760e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.090  2.5818e+05  4.1586e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.100  2.5209e+05  4.0963e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.110  2.4213e+05  4.0746e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.120  2.2738e+05  2.3708e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.130  2.0664e+05  2.2299e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.140  1.7368e+05  2.3360e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.150  1.4879e+05  2.1218e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.160  1.2741e+05  1.9747e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.170  1.0738e+05  1.7872e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.180  9.4917e+04  1.2134e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.190  8.1590e+04  1.2957e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.200  7.4192e+04  1.4876e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.210  6.4032e+04  1.3372e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.220  6.1780e+04  1.3313e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.230  5.7887e+04  7.7605e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.240  5.7631e+04  7.5243e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.250  5.6187e+04  8.9025e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.260  5.7123e+04  8.9187e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.270  5.8900e+04  9.1254e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.280  6.1353e+04  9.6195e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.290  6.5783e+04  7.3892e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.300  6.8219e+04  7.7838e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.310  6.7295e+04  1.1029e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.320  6.8595e+04  1.1147e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.330  7.2950e+04  1.1336e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.340  7.2924e+04  8.7124e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.350  7.3388e+04  8.8248e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.360  7.4758e+04  1.2962e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.370  7.3952e+04  1.2788e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.380  7.6922e+04  1.3209e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.390  7.3000e+04  9.0101e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.400  7.0635e+04  8.7027e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.410  7.2046e+04  1.1355e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.420  6.9352e+04  1.1141e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.430  6.4596e+04  1.0962e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.440  6.2484e+04  7.6616e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.450  5.9815e+04  1.0173e+03 Baran:1988tw 
+  6  12   1.650  13.540   0.460  5.6697e+04  9.5349e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.470  5.1094e+04  9.0767e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.480  4.9635e+04  9.0237e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.490  4.9112e+04  6.2486e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.500  4.8227e+04  8.2415e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.510  4.5892e+04  7.8630e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.520  4.2609e+04  7.5900e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.530  4.0271e+04  4.8688e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.540  4.0295e+04  6.0142e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.550  3.7745e+04  5.6283e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.560  3.4448e+04  5.3211e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.570  3.3056e+04  5.3444e+02 Baran:1988tw 
+  6  12   1.650  13.540   0.580  3.2832e+04  5.5849e+02 Baran:1988tw 
+  6  12   1.930  16.000   0.000  2.0700e+03  3.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.018  4.4400e+03  5.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.036  8.2400e+03  6.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.054  1.4600e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.073  2.3500e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.091  3.3800e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.109  4.3200e+04  2.1000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.127  5.1100e+04  2.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.145  5.3000e+04  2.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.164  6.0200e+04  2.8000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.182  5.5300e+04  2.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.200  5.3300e+04  2.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.218  4.2500e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.236  3.6200e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.262  3.1400e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.278  3.0500e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.293  2.7200e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.309  2.7000e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.324  2.1600e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.340  2.4300e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.355  2.2400e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.371  2.4900e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.386  2.6100e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.401  2.5400e+04  2.1000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.417  2.5900e+04  2.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.432  2.7200e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.448  2.7500e+04  2.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.463  2.7000e+04  2.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.479  2.4300e+04  2.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.504  2.4400e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  16.000   0.510  2.3100e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.000  3.8000e+02  1.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.018  8.0000e+02  2.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.036  2.1400e+03  3.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.054  2.6000e+03  3.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.073  5.7700e+03  5.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.092  8.7100e+03  7.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.109  1.2500e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.127  1.6800e+04  1.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.145  2.3100e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.164  2.6300e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.182  2.7600e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.200  3.1300e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.218  2.8600e+04  1.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.236  2.7000e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.255  2.4200e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.270  2.2000e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.285  2.0700e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.301  1.8800e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.316  1.9200e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.332  1.8600e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.347  1.7700e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.364  1.6900e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.380  1.6600e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.394  1.9700e+04  1.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.409  1.8400e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.424  1.9700e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.439  1.9000e+04  1.5000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.454  2.0100e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.469  1.9800e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.484  2.0300e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.499  1.8500e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.514  1.9900e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.526  1.8000e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.541  1.8800e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.555  1.7900e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   1.930  18.000   0.570  1.7800e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.000  15.000   0.030  7.1076e+03  2.9710e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.040  1.2529e+04  4.0720e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.050  1.9548e+04  5.1607e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.060  2.7763e+04  6.1634e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.070  3.7016e+04  7.0331e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.080  4.7376e+04  7.9592e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.090  5.8369e+04  8.8137e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.100  6.9192e+04  9.5485e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.110  7.9181e+04  1.0056e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.120  8.8087e+04  1.0570e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.130  9.5264e+04  1.0955e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.140  9.9616e+04  1.1057e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.150  1.0128e+05  1.1040e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.160  1.0052e+05  1.0857e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.170  9.7810e+04  1.0563e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.180  9.3515e+04  1.0287e+03 Zeller:1973ge 
+  6  12   2.000  15.000   0.190  8.6876e+04  9.9039e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.200  7.8488e+04  9.0262e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.210  7.0250e+04  8.4300e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.220  6.2899e+04  7.7995e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.230  5.6008e+04  7.3370e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.240  4.9319e+04  6.6580e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.250  4.3849e+04  6.2266e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.260  3.9661e+04  5.7905e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.270  3.6758e+04  5.5505e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.280  3.5168e+04  5.4159e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.290  3.4420e+04  5.4039e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.300  3.3758e+04  5.3676e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.310  3.3215e+04  5.3144e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.320  3.3229e+04  5.3831e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.330  3.3577e+04  5.3388e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.340  3.4775e+04  5.4944e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.350  3.6208e+04  5.7208e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.360  3.7064e+04  5.7450e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.370  3.7583e+04  5.8629e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.380  3.8134e+04  5.9488e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.390  3.8740e+04  5.9659e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.400  3.9557e+04  6.0917e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.410  3.9976e+04  6.1562e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.420  3.9614e+04  5.9818e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.430  3.9292e+04  5.9723e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.440  3.9341e+04  6.0585e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.450  3.9116e+04  5.9848e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.460  3.8507e+04  5.9300e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.470  3.7669e+04  5.8011e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.480  3.6841e+04  5.7104e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.490  3.5683e+04  5.6379e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.500  3.4472e+04  5.3777e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.510  3.3274e+04  5.3238e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.520  3.1962e+04  5.1459e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.530  3.0605e+04  5.0498e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.540  2.8960e+04  4.8652e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.550  2.7517e+04  4.7054e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.560  2.6542e+04  4.6979e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.570  2.5564e+04  4.4736e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.580  2.4880e+04  4.5778e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.590  2.4101e+04  4.4345e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.600  2.3086e+04  4.3170e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.610  2.2409e+04  4.3025e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.620  2.2061e+04  4.3460e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.630  2.1616e+04  4.3447e+02 Zeller:1973ge 
+  6  12   2.000  15.000   0.640  2.0642e+04  4.2111e+02 Zeller:1973ge 
+  6  12   2.015  35.510   0.550  2.0680e+02  1.6800e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.560  2.1930e+02  1.4380e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.571  2.3620e+02  1.4460e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.582  2.6100e+02  1.5400e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.593  2.7210e+02  1.5670e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.605  2.7970e+02  1.5950e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.616  2.8130e+02  1.6070e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.627  2.8580e+02  1.5900e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.638  2.9690e+02  1.6440e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.649  2.9400e+02  1.6040e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.660  3.0100e+02  1.6320e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.671  3.1690e+02  1.7430e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.682  3.2050e+02  1.8750e+00 Arrington:1995hs 
+  6  12   2.015  35.510   0.693  3.3100e+02  2.0650e+00 Arrington:1995hs 
+  6  12   2.020  15.022   0.075  2.7980e+04  4.8200e+02 Day:1993md 
+  6  12   2.020  15.022   0.090  3.7590e+04  5.6200e+02 Day:1993md 
+  6  12   2.020  15.022   0.105  5.0770e+04  1.1690e+03 Day:1993md 
+  6  12   2.020  15.022   0.120  5.6920e+04  1.2240e+03 Day:1993md 
+  6  12   2.020  15.022   0.135  6.4680e+04  9.8860e+02 Day:1993md 
+  6  12   2.020  15.022   0.150  6.7040e+04  1.0000e+03 Day:1993md 
+  6  12   2.020  15.022   0.165  6.7860e+04  1.4700e+03 Day:1993md 
+  6  12   2.020  15.022   0.180  6.4310e+04  1.3740e+03 Day:1993md 
+  6  12   2.020  15.022   0.195  5.7740e+04  1.2650e+03 Day:1993md 
+  6  12   2.020  15.022   0.210  5.3760e+04  9.7580e+02 Day:1993md 
+  6  12   2.020  15.022   0.225  4.8690e+04  9.3360e+02 Day:1993md 
+  6  12   2.020  15.022   0.240  4.0050e+04  1.2440e+03 Day:1993md 
+  6  12   2.020  15.022   0.255  3.4220e+04  1.1400e+03 Day:1993md 
+  6  12   2.020  15.022   0.270  2.9530e+04  1.0430e+03 Day:1993md 
+  6  12   2.020  15.022   0.285  2.8320e+04  7.3930e+02 Day:1993md 
+  6  12   2.020  15.022   0.300  2.8960e+04  1.0410e+03 Day:1993md 
+  6  12   2.020  15.022   0.315  2.6140e+04  9.7930e+02 Day:1993md 
+  6  12   2.020  15.022   0.330  2.9150e+04  1.0340e+03 Day:1993md 
+  6  12   2.020  15.022   0.345  2.9440e+04  1.0750e+03 Day:1993md 
+  6  12   2.020  15.022   0.360  2.7920e+04  1.0710e+03 Day:1993md 
+  6  12   2.020  20.016   0.075  4.6420e+02  1.4280e+01 Day:1993md 
+  6  12   2.020  20.016   0.090  8.5330e+02  1.9270e+01 Day:1993md 
+  6  12   2.020  20.016   0.105  1.3640e+03  2.4010e+01 Day:1993md 
+  6  12   2.020  20.016   0.120  2.0290e+03  1.3620e+02 Day:1993md 
+  6  12   2.020  20.016   0.135  3.3430e+03  1.6790e+02 Day:1993md 
+  6  12   2.020  20.016   0.150  4.3020e+03  1.5040e+02 Day:1993md 
+  6  12   2.020  20.016   0.165  5.8500e+03  1.7170e+02 Day:1993md 
+  6  12   2.020  20.016   0.180  7.6370e+03  1.6980e+02 Day:1993md 
+  6  12   2.020  20.016   0.195  9.2340e+03  1.8540e+02 Day:1993md 
+  6  12   2.020  20.016   0.210  1.0550e+04  2.5760e+02 Day:1993md 
+  6  12   2.020  20.016   0.225  1.1210e+04  2.3380e+02 Day:1993md 
+  6  12   2.020  20.016   0.240  1.1680e+04  2.9120e+02 Day:1993md 
+  6  12   2.020  20.016   0.255  1.2000e+04  2.2720e+02 Day:1993md 
+  6  12   2.020  20.016   0.270  1.1700e+04  2.7250e+02 Day:1993md 
+  6  12   2.020  20.016   0.285  1.1220e+04  2.6200e+02 Day:1993md 
+  6  12   2.020  20.016   0.300  1.0630e+04  2.5240e+02 Day:1993md 
+  6  12   2.020  20.016   0.315  9.7040e+03  2.9330e+02 Day:1993md 
+  6  12   2.020  20.016   0.330  9.3460e+03  2.0240e+02 Day:1993md 
+  6  12   2.020  20.016   0.345  8.6900e+03  2.6120e+02 Day:1993md 
+  6  12   2.020  20.016   0.360  8.3230e+03  2.4760e+02 Day:1993md 
+  6  12   2.020  20.016   0.375  7.5720e+03  2.2900e+02 Day:1993md 
+  6  12   2.020  20.016   0.390  7.4060e+03  1.6220e+02 Day:1993md 
+  6  12   2.020  20.016   0.405  7.0630e+03  1.5940e+02 Day:1993md 
+  6  12   2.020  20.016   0.420  6.6280e+03  2.1040e+02 Day:1993md 
+  6  12   2.020  20.016   0.435  6.9370e+03  2.1750e+02 Day:1993md 
+  6  12   2.020  20.016   0.450  7.6020e+03  2.3470e+02 Day:1993md 
+  6  12   2.130  16.000   0.021  1.1100e+03  2.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.040  3.3800e+03  4.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.063  6.7100e+03  6.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.082  9.8900e+03  7.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.102  1.7300e+04  1.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.121  2.2800e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.141  2.9300e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.160  3.5500e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.179  3.7000e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.199  3.8500e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.218  3.7600e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.237  3.6000e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.256  3.3400e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.272  2.8600e+04  1.7000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.297  2.5600e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.315  2.1700e+04  1.5000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.334  2.1800e+04  1.6000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.353  1.9200e+04  1.5000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.373  2.2400e+04  1.8000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.389  2.2100e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.406  2.2100e+04  1.9000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.423  2.4500e+04  2.1000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.440  2.3600e+04  2.1000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.457  2.3800e+04  2.2000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.474  2.5400e+04  2.1000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.491  2.1100e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.508  2.2300e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.521  1.8800e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.537  2.4400e+04  2.6000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.554  2.0700e+04  2.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.570  2.2600e+04  2.6000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.586  2.3000e+04  2.6000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.602  1.6600e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  16.000   0.619  1.6500e+04  2.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.035  5.6000e+02  1.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.054  1.0500e+03  1.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.074  1.7200e+03  2.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.093  3.0500e+03  3.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.112  5.5100e+03  4.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.132  7.4600e+03  4.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.151  9.9800e+03  5.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.171  1.3500e+04  7.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.190  1.5600e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.209  1.6200e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.229  1.8500e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.246  2.0400e+04  1.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.265  1.9900e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.283  1.8300e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.301  1.5700e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.314  1.5800e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.329  1.3700e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.347  1.4400e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.367  1.4500e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.384  1.3400e+04  8.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.401  1.3700e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.419  1.3400e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.436  1.3400e+04  9.0000e+02 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.454  1.4600e+04  1.0000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.470  1.5100e+04  1.1000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.487  1.4300e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.504  1.5200e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.516  1.4400e+04  1.2000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.531  1.4500e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.547  1.4700e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.562  1.4300e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.578  1.4300e+04  1.3000e+03 Bagdasaryan:1988hp 
+  6  12   2.130  18.000   0.594  1.4200e+04  1.4000e+03 Bagdasaryan:1988hp 
+  6  12   2.500  15.000   0.030  3.4320e+02  6.8057e+01 Zeller:1973ge 
+  6  12   2.500  15.000   0.040  6.6720e+02  6.3718e+01 Zeller:1973ge 
+  6  12   2.500  15.000   0.050  1.0572e+03  9.5888e+01 Zeller:1973ge 
+  6  12   2.500  15.000   0.060  1.5468e+03  1.1756e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.070  2.2536e+03  1.2575e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.080  3.2364e+03  1.5664e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.090  4.4940e+03  1.9774e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.100  6.0336e+03  2.2867e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.110  7.9608e+03  2.7783e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.120  1.0270e+04  2.9371e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.130  1.2659e+04  3.2913e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.140  1.5206e+04  3.6799e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.150  1.7626e+04  3.8953e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.160  1.9801e+04  4.1583e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.170  2.1704e+04  4.4277e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.180  2.3634e+04  4.5377e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.190  2.5409e+04  4.5736e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.200  2.7019e+04  4.7554e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.210  2.8216e+04  4.8249e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.220  2.8904e+04  4.9137e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.230  2.9201e+04  4.8181e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.240  2.9066e+04  4.7669e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.250  2.8524e+04  4.7065e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.260  2.7716e+04  4.5455e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.270  2.6570e+04  4.4904e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.280  2.5002e+04  4.3253e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.290  2.3359e+04  4.0645e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.300  2.2134e+04  3.9399e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.310  2.0880e+04  3.8419e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.320  1.9570e+04  3.6399e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.330  1.8652e+04  3.5252e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.340  1.7860e+04  3.2504e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.350  1.6850e+04  3.2184e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.360  1.6084e+04  3.2006e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.370  1.5618e+04  3.0143e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.380  1.5341e+04  3.0682e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.390  1.5148e+04  3.0295e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.400  1.4962e+04  3.0372e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.410  1.4900e+04  3.0397e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.420  1.5044e+04  3.0540e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.430  1.5270e+04  3.0998e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.440  1.5445e+04  3.0273e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.450  1.5592e+04  3.1495e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.460  1.5883e+04  3.1608e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.470  1.6097e+04  3.2516e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.480  1.6228e+04  3.2293e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.490  1.6357e+04  3.2224e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.500  1.6456e+04  3.1924e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.510  1.6552e+04  3.2110e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.520  1.6458e+04  3.2093e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.530  1.6178e+04  3.1871e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.540  1.5944e+04  3.1251e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.550  1.5704e+04  3.1566e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.560  1.5560e+04  3.0965e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.570  1.5384e+04  2.9845e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.580  1.4988e+04  3.0426e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.590  1.4569e+04  2.9138e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.600  1.4268e+04  2.9107e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.610  1.4114e+04  2.8088e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.620  1.3866e+04  2.8425e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.630  1.3538e+04  2.7483e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.640  1.3236e+04  2.7266e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.650  1.2754e+04  2.6910e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.660  1.2180e+04  2.6065e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.670  1.1818e+04  2.5999e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.680  1.1692e+04  2.5488e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.690  1.1638e+04  2.5254e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.700  1.1364e+04  2.5114e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.710  1.1125e+04  2.5365e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.720  1.1090e+04  2.5175e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.730  1.0997e+04  2.4523e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.740  1.0853e+04  2.5178e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.750  1.0678e+04  2.4665e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.760  1.0439e+04  2.1064e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.770  1.0350e+04  2.4737e+02 Zeller:1973ge 
+  6  12   2.500  15.000   0.780  1.0412e+04  2.3532e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.040  3.8400e+01  2.7187e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.050  1.0200e+02  2.9121e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.060  2.0160e+02  5.1670e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.070  3.2760e+02  6.2768e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.080  4.9800e+02  7.0567e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.090  7.4400e+02  8.9726e+01 Zeller:1973ge 
+  6  12   2.700  15.000   0.100  1.0680e+03  1.0477e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.110  1.5564e+03  1.2451e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.120  2.2104e+03  1.6114e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.130  3.0012e+03  1.7767e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.140  4.0644e+03  2.0810e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.150  5.3508e+03  2.4239e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.160  6.8100e+03  2.7172e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.170  8.4660e+03  3.0139e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.180  1.0312e+04  3.3306e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.190  1.2383e+04  3.6034e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.200  1.4519e+04  3.9491e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.210  1.6394e+04  4.1970e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.220  1.8095e+04  4.3066e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.230  1.9872e+04  4.6103e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.240  2.1367e+04  4.6794e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.250  2.2540e+04  4.8235e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.260  2.3405e+04  4.8682e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.270  2.3879e+04  4.8952e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.280  2.4089e+04  4.8418e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.290  2.4115e+04  4.8230e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.300  2.3788e+04  4.7813e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.310  2.3069e+04  4.6368e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.320  2.2330e+04  4.5106e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.330  2.1797e+04  4.4248e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.340  2.1109e+04  4.3696e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.350  2.0072e+04  4.1751e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.360  1.9178e+04  4.0466e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.370  1.8389e+04  4.0088e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.380  1.7164e+04  3.7588e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.390  1.6001e+04  3.6162e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.400  1.5274e+04  3.5435e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.410  1.4850e+04  3.4304e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.420  1.4585e+04  3.4712e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.430  1.4419e+04  3.3597e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.440  1.4320e+04  3.4367e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.450  1.4089e+04  3.3391e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.460  1.4126e+04  3.3762e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.470  1.4316e+04  3.4072e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.480  1.4417e+04  3.3735e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.490  1.4477e+04  3.4310e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.500  1.4610e+04  3.3895e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.510  1.4958e+04  3.5450e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.520  1.5168e+04  3.4735e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.530  1.5276e+04  3.5440e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.540  1.5196e+04  3.4798e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.550  1.5020e+04  3.4697e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.560  1.4884e+04  3.4679e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.570  1.4846e+04  3.4295e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.580  1.4968e+04  3.4425e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.590  1.5070e+04  3.4961e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.600  1.4964e+04  3.4118e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.610  1.4754e+04  3.4524e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.620  1.4422e+04  3.3458e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.630  1.4188e+04  3.3057e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.640  1.4179e+04  3.2754e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.650  1.4090e+04  3.3676e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.660  1.3849e+04  3.1992e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.670  1.3637e+04  3.2865e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.680  1.2958e+04  3.1098e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.690  1.2222e+04  2.9944e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.700  1.2108e+04  2.9544e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.710  1.2320e+04  3.0801e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.720  1.2192e+04  2.9992e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.730  1.1844e+04  2.9373e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.740  1.1615e+04  2.9269e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.750  1.1545e+04  2.9209e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.760  1.1419e+04  2.9119e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.770  1.1111e+04  2.8999e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.780  1.0781e+04  2.7814e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.790  1.0704e+04  2.8366e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.800  1.0777e+04  2.8236e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.810  1.0834e+04  2.8817e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.820  1.0759e+04  2.9050e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.830  1.0576e+04  2.8131e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.840  1.0588e+04  2.8904e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.850  1.0532e+04  2.9175e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.860  1.0198e+04  2.7839e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.870  9.9708e+03  3.1725e+02 Zeller:1973ge 
+  6  12   2.700  15.000   0.880  9.8364e+03  2.8034e+02 Zeller:1973ge 
+  6  12   3.188  47.680   1.635  1.4810e+00  3.3620e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.645  1.5630e+00  2.9250e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.657  1.7810e+00  3.0590e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.668  2.0100e+00  3.2350e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.680  2.2350e+00  3.4090e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.692  2.3980e+00  3.5110e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.704  2.5360e+00  3.6200e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.716  2.7440e+00  3.7580e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.727  2.9860e+00  3.9230e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.739  3.2400e+00  4.0960e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.751  3.5390e+00  4.2780e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.762  3.9270e+00  4.6020e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.774  4.2830e+00  5.0330e-02 Arrington:1995hs 
+  6  12   3.188  47.680   1.786  4.5260e+00  5.3750e-02 Arrington:1995hs 
+  6  12   3.595  16.020   0.210  7.9870e+01  4.2470e+00 Day:1993md 
+  6  12   3.595  16.020   0.225  1.1590e+02  4.9990e+00 Day:1993md 
+  6  12   3.595  16.020   0.240  1.6210e+02  5.8460e+00 Day:1993md 
+  6  12   3.595  16.020   0.255  2.1540e+02  6.8190e+00 Day:1993md 
+  6  12   3.595  16.020   0.270  2.6840e+02  7.9340e+00 Day:1993md 
+  6  12   3.595  16.020   0.285  3.6270e+02  8.5860e+00 Day:1993md 
+  6  12   3.595  16.020   0.300  4.7090e+02  9.6100e+00 Day:1993md 
+  6  12   3.595  16.020   0.315  6.1080e+02  1.0840e+01 Day:1993md 
+  6  12   3.595  16.020   0.330  7.8750e+02  3.0520e+01 Day:1993md 
+  6  12   3.595  16.020   0.345  9.8430e+02  3.3920e+01 Day:1993md 
+  6  12   3.595  16.020   0.360  1.2150e+03  3.7700e+01 Day:1993md 
+  6  12   3.595  16.020   0.375  1.4200e+03  4.0490e+01 Day:1993md 
+  6  12   3.595  16.020   0.390  1.5980e+03  4.2840e+01 Day:1993md 
+  6  12   3.595  16.020   0.405  1.8690e+03  3.7950e+01 Day:1993md 
+  6  12   3.595  16.020   0.420  2.1250e+03  4.0160e+01 Day:1993md 
+  6  12   3.595  16.020   0.435  2.2830e+03  4.1380e+01 Day:1993md 
+  6  12   3.595  16.020   0.450  2.3100e+03  6.3090e+01 Day:1993md 
+  6  12   3.595  16.020   0.465  2.5340e+03  6.4400e+01 Day:1993md 
+  6  12   3.595  16.020   0.480  2.6450e+03  6.5000e+01 Day:1993md 
+  6  12   3.595  16.020   0.495  2.6510e+03  6.3900e+01 Day:1993md 
+  6  12   3.595  16.020   0.510  2.7400e+03  6.4440e+01 Day:1993md 
+  6  12   3.595  16.020   0.525  2.6070e+03  4.9450e+01 Day:1993md 
+  6  12   3.595  16.020   0.540  2.6530e+03  4.8890e+01 Day:1993md 
+  6  12   3.595  16.020   0.555  2.5710e+03  4.8310e+01 Day:1993md 
+  6  12   3.595  16.020   0.570  2.6060e+03  7.3660e+01 Day:1993md 
+  6  12   3.595  16.020   0.585  2.4250e+03  7.0080e+01 Day:1993md 
+  6  12   3.595  16.020   0.600  2.4210e+03  6.7020e+01 Day:1993md 
+  6  12   3.595  16.020   0.615  2.5080e+03  6.7000e+01 Day:1993md 
+  6  12   3.595  16.020   0.630  2.4070e+03  6.6110e+01 Day:1993md 
+  6  12   3.595  16.020   0.645  2.3190e+03  5.5950e+01 Day:1993md 
+  6  12   3.595  16.020   0.660  2.4350e+03  5.7020e+01 Day:1993md 
+  6  12   3.595  16.020   0.675  2.4290e+03  5.5850e+01 Day:1993md 
+  6  12   3.595  16.020   0.690  2.5520e+03  9.1670e+01 Day:1993md 
+  6  12   3.595  16.020   0.705  2.4970e+03  9.2820e+01 Day:1993md 
+  6  12   3.595  16.020   0.720  2.7380e+03  9.6960e+01 Day:1993md 
+  6  12   3.595  16.020   0.735  2.6360e+03  9.1400e+01 Day:1993md 
+  6  12   3.595  16.020   0.750  2.7660e+03  9.7520e+01 Day:1993md 
+  6  12   3.595  16.020   0.765  2.7450e+03  7.1180e+01 Day:1993md 
+  6  12   3.595  16.020   0.780  2.5570e+03  6.6480e+01 Day:1993md 
+  6  12   3.595  16.020   0.795  2.6930e+03  6.9600e+01 Day:1993md 
+  6  12   3.595  16.020   0.810  2.4400e+03  8.9870e+01 Day:1993md 
+  6  12   3.595  16.020   0.825  2.7810e+03  9.6580e+01 Day:1993md 
+  6  12   3.595  16.020   0.840  2.6750e+03  9.3790e+01 Day:1993md 
+  6  12   3.595  16.020   0.855  2.5930e+03  9.2430e+01 Day:1993md 
+  6  12   3.595  16.020   0.870  2.5050e+03  7.3950e+01 Day:1993md 
+  6  12   3.595  16.020   0.885  2.7360e+03  7.8170e+01 Day:1993md 
+  6  12   3.595  16.020   0.900  2.6740e+03  7.6540e+01 Day:1993md 
+  6  12   3.595  16.020   0.915  2.8510e+03  1.2580e+02 Day:1993md 
+  6  12   3.595  16.020   0.930  2.6540e+03  1.1920e+02 Day:1993md 
+  6  12   3.595  16.020   0.945  2.8000e+03  1.2510e+02 Day:1993md 
+  6  12   3.595  16.020   0.960  2.5310e+03  1.1820e+02 Day:1993md 
+  6  12   3.595  16.020   0.975  2.6140e+03  8.1560e+01 Day:1993md 
+  6  12   3.595  16.020   0.990  2.5980e+03  8.0600e+01 Day:1993md 
+  6  12   3.595  16.020   1.005  2.8040e+03  1.1120e+02 Day:1993md 
+  6  12   3.595  16.020   1.020  2.9450e+03  1.1610e+02 Day:1993md 
+  6  12   3.595  16.020   1.035  2.7400e+03  1.0910e+02 Day:1993md 
+  6  12   3.595  16.020   1.050  2.7340e+03  1.0660e+02 Day:1993md 
+  6  12   3.595  16.020   1.065  2.7910e+03  1.1090e+02 Day:1993md 
+  6  12   3.595  16.020   1.080  2.8040e+03  8.1830e+01 Day:1993md 
+  6  12   3.595  16.020   1.095  2.6290e+03  7.8210e+01 Day:1993md 
+  6  12   3.595  16.020   1.110  2.8400e+03  1.1450e+02 Day:1993md 
+  6  12   3.595  16.020   1.125  2.7660e+03  1.1390e+02 Day:1993md 
+  6  12   3.595  16.020   1.140  2.7760e+03  1.1650e+02 Day:1993md 
+  6  12   3.595  16.020   1.155  2.8850e+03  1.2020e+02 Day:1993md 
+  6  12   3.595  16.020   1.170  3.0620e+03  7.2990e+01 Day:1993md 
+  6  12   3.595  16.020   1.185  3.0240e+03  6.8060e+01 Day:1993md 
+  6  12   3.595  16.020   1.200  2.7430e+03  7.4940e+01 Day:1993md 
+  6  12   3.595  16.020   1.215  2.8360e+03  7.4760e+01 Day:1993md 
+  6  12   3.595  16.020   1.230  2.8890e+03  7.4130e+01 Day:1993md 
+  6  12   3.595  16.020   1.245  2.9920e+03  7.5510e+01 Day:1993md 
+  6  12   3.595  16.020   1.260  2.9380e+03  7.5200e+01 Day:1993md 
+  6  12   3.595  16.020   1.275  2.9650e+03  6.1060e+01 Day:1993md 
+  6  12   3.595  16.020   1.290  2.8720e+03  6.0770e+01 Day:1993md 
+  6  12   3.595  16.020   1.305  2.7380e+03  9.4620e+01 Day:1993md 
+  6  12   3.595  16.020   1.320  2.8340e+03  9.3410e+01 Day:1993md 
+  6  12   3.595  16.020   1.335  2.8110e+03  9.2270e+01 Day:1993md 
+  6  12   3.595  16.020   1.350  3.0710e+03  9.9130e+01 Day:1993md 
+  6  12   3.595  16.020   1.365  2.8140e+03  7.4480e+01 Day:1993md 
+  6  12   3.595  16.020   1.380  2.8350e+03  7.4120e+01 Day:1993md 
+  6  12   3.595  16.020   1.395  2.8550e+03  1.1150e+02 Day:1993md 
+  6  12   3.595  16.020   1.410  3.0070e+03  1.1350e+02 Day:1993md 
+  6  12   3.595  16.020   1.425  2.5610e+03  1.0360e+02 Day:1993md 
+  6  12   3.595  16.020   1.440  2.8160e+03  8.0240e+01 Day:1993md 
+  6  12   3.595  16.020   1.455  2.7540e+03  7.7590e+01 Day:1993md 
+  6  12   3.595  16.020   1.470  2.7990e+03  1.0790e+02 Day:1993md 
+  6  12   3.595  16.020   1.485  2.6010e+03  1.0360e+02 Day:1993md 
+  6  12   3.595  16.020   1.500  2.6600e+03  1.0520e+02 Day:1993md 
+  6  12   3.595  16.020   1.515  2.6670e+03  1.0540e+02 Day:1993md 
+  6  12   3.595  16.020   1.530  2.7290e+03  1.0770e+02 Day:1993md 
+  6  12   3.595  16.020   1.545  2.5150e+03  1.0480e+02 Day:1993md 
+  6  12   3.595  20.016   0.165  5.9550e-02  2.8440e-02 Day:1993md 
+  6  12   3.595  20.016   0.180  1.4390e-01  3.6090e-02 Day:1993md 
+  6  12   3.595  20.016   0.195  2.2000e-01  4.0460e-02 Day:1993md 
+  6  12   3.595  20.016   0.210  3.5310e-01  4.9290e-02 Day:1993md 
+  6  12   3.595  20.016   0.225  5.9720e-01  6.5580e-02 Day:1993md 
+  6  12   3.595  20.016   0.240  1.0270e+00  8.9160e-02 Day:1993md 
+  6  12   3.595  20.016   0.255  1.2490e+00  1.0150e-01 Day:1993md 
+  6  12   3.595  20.016   0.270  1.9240e+00  1.1270e-01 Day:1993md 
+  6  12   3.595  20.016   0.285  2.6550e+00  1.2840e-01 Day:1993md 
+  6  12   3.595  20.016   0.300  3.7690e+00  1.5250e-01 Day:1993md 
+  6  12   3.595  20.016   0.315  5.0060e+00  3.8180e-01 Day:1993md 
+  6  12   3.595  20.016   0.330  6.7110e+00  4.3480e-01 Day:1993md 
+  6  12   3.595  20.016   0.345  8.4460e+00  4.9010e-01 Day:1993md 
+  6  12   3.595  20.016   0.360  1.1740e+01  5.8180e-01 Day:1993md 
+  6  12   3.595  20.016   0.375  1.4480e+01  6.4550e-01 Day:1993md 
+  6  12   3.595  20.016   0.390  1.7800e+01  7.1960e-01 Day:1993md 
+  6  12   3.595  20.016   0.405  2.5050e+01  7.9510e-01 Day:1993md 
+  6  12   3.595  20.016   0.420  3.0350e+01  8.8470e-01 Day:1993md 
+  6  12   3.595  20.016   0.435  3.9920e+01  1.0350e+00 Day:1993md 
+  6  12   3.595  20.016   0.450  4.6960e+01  2.3040e+00 Day:1993md 
+  6  12   3.595  20.016   0.465  6.1050e+01  2.5620e+00 Day:1993md 
+  6  12   3.595  20.016   0.480  8.4440e+01  2.9990e+00 Day:1993md 
+  6  12   3.595  20.016   0.495  9.7260e+01  3.1620e+00 Day:1993md 
+  6  12   3.595  20.016   0.510  1.2210e+02  3.5480e+00 Day:1993md 
+  6  12   3.595  20.016   0.525  1.4380e+02  3.3490e+00 Day:1993md 
+  6  12   3.595  20.016   0.540  1.6770e+02  3.5750e+00 Day:1993md 
+  6  12   3.595  20.016   0.555  1.9860e+02  3.9590e+00 Day:1993md 
+  6  12   3.595  20.016   0.570  2.4550e+02  7.8870e+00 Day:1993md 
+  6  12   3.595  20.016   0.585  2.8180e+02  8.3900e+00 Day:1993md 
+  6  12   3.595  20.016   0.600  3.1430e+02  8.4820e+00 Day:1993md 
+  6  12   3.595  20.016   0.615  3.6190e+02  8.9340e+00 Day:1993md 
+  6  12   3.595  20.016   0.630  3.6560e+02  9.0860e+00 Day:1993md 
+  6  12   3.595  20.016   0.645  4.1680e+02  8.3140e+00 Day:1993md 
+  6  12   3.595  20.016   0.660  4.2180e+02  8.3190e+00 Day:1993md 
+  6  12   3.595  20.016   0.675  4.4120e+02  8.1820e+00 Day:1993md 
+  6  12   3.595  20.016   0.690  4.5510e+02  1.3840e+01 Day:1993md 
+  6  12   3.595  20.016   0.705  4.6200e+02  1.3780e+01 Day:1993md 
+  6  12   3.595  20.016   0.720  4.9470e+02  1.3680e+01 Day:1993md 
+  6  12   3.595  20.016   0.735  5.1210e+02  1.4340e+01 Day:1993md 
+  6  12   3.595  20.016   0.750  5.2090e+02  1.1030e+01 Day:1993md 
+  6  12   3.595  20.016   0.765  5.1760e+02  1.0580e+01 Day:1993md 
+  6  12   3.595  20.016   0.780  5.1780e+02  1.0740e+01 Day:1993md 
+  6  12   3.595  20.016   0.795  5.2570e+02  1.5370e+01 Day:1993md 
+  6  12   3.595  20.016   0.810  5.3390e+02  1.5500e+01 Day:1993md 
+  6  12   3.595  20.016   0.825  5.4390e+02  1.5490e+01 Day:1993md 
+  6  12   3.595  20.016   0.840  5.2970e+02  1.5420e+01 Day:1993md 
+  6  12   3.595  20.016   0.855  5.2230e+02  1.5390e+01 Day:1993md 
+  6  12   3.595  20.016   0.870  5.5890e+02  1.6040e+01 Day:1993md 
+  6  12   3.595  20.016   0.885  5.8700e+02  1.6840e+01 Day:1993md 
+  6  12   3.595  25.012   0.360  2.9920e-02  1.3940e-02 Day:1993md 
+  6  12   3.595  25.012   0.390  4.3800e-02  1.5970e-02 Day:1993md 
+  6  12   3.595  25.012   0.405  7.0700e-02  1.8370e-02 Day:1993md 
+  6  12   3.595  25.012   0.420  8.0210e-02  1.8580e-02 Day:1993md 
+  6  12   3.595  25.012   0.435  1.3600e-01  2.4440e-02 Day:1993md 
+  6  12   3.595  25.012   0.450  1.5990e-01  2.6620e-02 Day:1993md 
+  6  12   3.595  25.012   0.465  1.8850e-01  2.8610e-02 Day:1993md 
+  6  12   3.595  25.012   0.480  2.6640e-01  2.9820e-02 Day:1993md 
+  6  12   3.595  25.012   0.495  4.3830e-01  3.9390e-02 Day:1993md 
+  6  12   3.595  25.012   0.510  5.0800e-01  4.2780e-02 Day:1993md 
+  6  12   3.595  25.012   0.525  6.3530e-01  4.8220e-02 Day:1993md 
+  6  12   3.595  25.012   0.540  8.9350e-01  1.1630e-01 Day:1993md 
+  6  12   3.595  25.012   0.555  1.1710e+00  1.2450e-01 Day:1993md 
+  6  12   3.595  25.012   0.570  1.5930e+00  1.4540e-01 Day:1993md 
+  6  12   3.595  25.012   0.585  1.8610e+00  1.5500e-01 Day:1993md 
+  6  12   3.595  25.012   0.600  2.0430e+00  1.6680e-01 Day:1993md 
+  6  12   3.595  25.012   0.615  2.3500e+00  1.5100e-01 Day:1993md 
+  6  12   3.595  25.012   0.630  3.0690e+00  1.7320e-01 Day:1993md 
+  6  12   3.595  25.012   0.645  3.2040e+00  2.7280e-01 Day:1993md 
+  6  12   3.595  25.012   0.660  4.6830e+00  3.4340e-01 Day:1993md 
+  6  12   3.595  25.012   0.675  5.8680e+00  3.7750e-01 Day:1993md 
+  6  12   3.595  25.012   0.690  6.6100e+00  3.9070e-01 Day:1993md 
+  6  12   3.595  25.012   0.705  8.2640e+00  4.4280e-01 Day:1993md 
+  6  12   3.595  25.012   0.720  1.0670e+01  4.2740e-01 Day:1993md 
+  6  12   3.595  25.012   0.735  1.3280e+01  4.6970e-01 Day:1993md 
+  6  12   3.595  25.012   0.750  1.5720e+01  5.1570e-01 Day:1993md 
+  6  12   3.595  25.012   0.765  1.8600e+01  9.6290e-01 Day:1993md 
+  6  12   3.595  25.012   0.780  2.2460e+01  1.0540e+00 Day:1993md 
+  6  12   3.595  25.012   0.795  2.6740e+01  1.1370e+00 Day:1993md 
+  6  12   3.595  25.012   0.810  3.4050e+01  1.3050e+00 Day:1993md 
+  6  12   3.595  25.012   0.825  3.5080e+01  1.3120e+00 Day:1993md 
+  6  12   3.595  25.012   0.840  4.2240e+01  1.1380e+00 Day:1993md 
+  6  12   3.595  25.012   0.855  4.7230e+01  1.2120e+00 Day:1993md 
+  6  12   3.595  25.012   0.870  5.2190e+01  1.9330e+00 Day:1993md 
+  6  12   3.595  25.012   0.885  5.3990e+01  1.9640e+00 Day:1993md 
+  6  12   3.595  25.012   0.900  6.4130e+01  2.1130e+00 Day:1993md 
+  6  12   3.595  25.012   0.915  7.1990e+01  2.2700e+00 Day:1993md 
+  6  12   3.595  25.012   0.930  7.1310e+01  2.2480e+00 Day:1993md 
+  6  12   3.595  25.012   0.945  7.7470e+01  1.8330e+00 Day:1993md 
+  6  12   3.595  25.012   0.960  8.4070e+01  1.8980e+00 Day:1993md 
+  6  12   3.595  25.012   0.975  8.7150e+01  2.9140e+00 Day:1993md 
+  6  12   3.595  25.012   0.990  9.2960e+01  3.0530e+00 Day:1993md 
+  6  12   3.595  25.012   1.005  1.0120e+02  3.1480e+00 Day:1993md 
+  6  12   3.595  25.012   1.020  9.3660e+01  2.9020e+00 Day:1993md 
+  6  12   3.595  25.012   1.035  1.0280e+02  3.1610e+00 Day:1993md 
+  6  12   3.595  25.012   1.050  1.0130e+02  2.3300e+00 Day:1993md 
+  6  12   3.595  25.012   1.065  1.0550e+02  2.3360e+00 Day:1993md 
+  6  12   3.595  25.012   1.080  1.1320e+02  3.4850e+00 Day:1993md 
+  6  12   3.595  25.012   1.095  1.1410e+02  3.5320e+00 Day:1993md 
+  6  12   3.595  25.012   1.110  1.1550e+02  3.6360e+00 Day:1993md 
+  6  12   3.595  25.012   1.125  1.2200e+02  3.7510e+00 Day:1993md 
+  6  12   3.595  25.012   1.140  1.1970e+02  3.6390e+00 Day:1993md 
+  6  12   3.595  25.012   1.155  1.3080e+02  3.8340e+00 Day:1993md 
+  6  12   3.595  30.010   0.975  2.6750e+00  2.9530e-01 Day:1993md 
+  6  12   3.595  30.010   0.990  2.5500e+00  2.7420e-01 Day:1993md 
+  6  12   3.595  30.010   1.005  2.8370e+00  2.7850e-01 Day:1993md 
+  6  12   3.595  30.010   1.020  3.6740e+00  3.2870e-01 Day:1993md 
+  6  12   3.595  30.010   1.035  5.0640e+00  3.8440e-01 Day:1993md 
+  6  12   3.595  30.010   1.050  5.4370e+00  3.8390e-01 Day:1993md 
+  6  12   3.595  30.010   1.065  6.4630e+00  4.2270e-01 Day:1993md 
+  6  12   3.595  30.010   1.080  7.2080e+00  2.9120e-01 Day:1993md 
+  6  12   3.595  30.010   1.095  8.3410e+00  3.0990e-01 Day:1993md 
+  6  12   3.595  30.010   1.110  9.5450e+00  4.1270e-01 Day:1993md 
+  6  12   3.595  30.010   1.125  1.1240e+01  4.5340e-01 Day:1993md 
+  6  12   3.595  30.010   1.140  1.2110e+01  4.7700e-01 Day:1993md 
+  6  12   3.595  30.010   1.155  1.3110e+01  5.0240e-01 Day:1993md 
+  6  12   3.595  30.010   1.170  1.5080e+01  4.2580e-01 Day:1993md 
+  6  12   3.595  30.010   1.185  1.6750e+01  4.4570e-01 Day:1993md 
+  6  12   3.595  30.010   1.200  1.8020e+01  7.3290e-01 Day:1993md 
+  6  12   3.595  30.010   1.215  1.9410e+01  7.4080e-01 Day:1993md 
+  6  12   3.595  30.010   1.230  2.2670e+01  7.8970e-01 Day:1993md 
+  6  12   3.595  30.010   1.245  2.1680e+01  7.6580e-01 Day:1993md 
+  6  12   3.595  30.010   1.260  2.3170e+01  6.3400e-01 Day:1993md 
+  6  12   3.595  30.010   1.275  2.4620e+01  6.4980e-01 Day:1993md 
+  6  12   3.595  30.010   1.290  2.8480e+01  1.1310e+00 Day:1993md 
+  6  12   3.595  30.010   1.305  2.7890e+01  1.1210e+00 Day:1993md 
+  6  12   3.595  30.010   1.320  2.9290e+01  1.1290e+00 Day:1993md 
+  6  12   3.595  30.010   1.335  3.1350e+01  1.1440e+00 Day:1993md 
+  6  12   3.595  30.010   1.350  3.2110e+01  9.0640e-01 Day:1993md 
+  6  12   3.595  30.010   1.365  3.3310e+01  9.3340e-01 Day:1993md 
+  6  12   3.595  30.010   1.380  3.3990e+01  1.3480e+00 Day:1993md 
+  6  12   3.595  30.010   1.395  3.5930e+01  1.3930e+00 Day:1993md 
+  6  12   3.595  30.010   1.410  3.7210e+01  1.4000e+00 Day:1993md 
+  6  12   3.595  30.010   1.425  3.8120e+01  1.4290e+00 Day:1993md 
+  6  12   3.595  30.010   1.440  4.3400e+01  1.1270e+00 Day:1993md 
+  6  12   3.595  30.010   1.455  4.4030e+01  1.1280e+00 Day:1993md 
+  6  12   3.595  30.010   1.470  4.6600e+01  1.6150e+00 Day:1993md 
+  6  12   3.595  30.010   1.485  5.1830e+01  1.6880e+00 Day:1993md 
+  6  12   3.595  30.010   1.500  4.9720e+01  1.6430e+00 Day:1993md 
+  6  12   3.595  30.010   1.515  5.2890e+01  1.1770e+00 Day:1993md 
+  6  12   3.595  30.010   1.530  5.5510e+01  1.1980e+00 Day:1993md 
+  6  12   3.595  30.010   1.545  5.5900e+01  1.6050e+00 Day:1993md 
+  6  12   3.595  30.010   1.560  6.2170e+01  1.6640e+00 Day:1993md 
+  6  12   3.595  30.010   1.575  5.8910e+01  1.5800e+00 Day:1993md 
+  6  12   3.595  30.010   1.590  6.1060e+01  1.6670e+00 Day:1993md 
+  6  12   3.595  30.010   1.605  6.6630e+01  1.4710e+00 Day:1993md 
+  6  12   3.595  30.010   1.620  6.5630e+01  2.5130e+00 Day:1993md 
+  6  12   3.595  30.010   1.635  7.4620e+01  2.6890e+00 Day:1993md 
+  6  12   3.595  30.010   1.650  7.7410e+01  2.7660e+00 Day:1993md 
+  6  12   3.595  30.010   1.665  7.3860e+01  2.6830e+00 Day:1993md 
+  6  12   3.595  30.010   1.680  7.8620e+01  2.1940e+00 Day:1993md 
+  6  12   3.595  30.010   1.695  8.6650e+01  3.5620e+00 Day:1993md 
+  6  12   3.595  30.010   1.710  8.8780e+01  3.4740e+00 Day:1993md 
+  6  12   3.595  30.010   1.725  8.5290e+01  3.3240e+00 Day:1993md 
+  6  12   3.595  30.010   1.740  9.2630e+01  3.4670e+00 Day:1993md 
+  6  12   3.595  30.010   1.755  9.9540e+01  2.5510e+00 Day:1993md 
+  6  12   3.595  30.010   1.770  1.0100e+02  2.5460e+00 Day:1993md 
+  6  12   3.595  30.010   1.785  1.0410e+02  3.4600e+00 Day:1993md 
+  6  12   3.595  30.010   1.800  1.1050e+02  3.5520e+00 Day:1993md 
+  6  12   3.595  30.010   1.815  1.0820e+02  3.4770e+00 Day:1993md 
+  6  12   3.595  30.010   1.830  1.0670e+02  2.6220e+00 Day:1993md 
+  6  12   3.595  30.010   1.845  1.1710e+02  3.9250e+00 Day:1993md 
+  6  12   3.595  30.010   1.860  1.1290e+02  3.8190e+00 Day:1993md 
+  6  12   3.595  30.010   1.875  1.2040e+02  3.9020e+00 Day:1993md 
+  6  12   3.595  30.010   1.890  1.1830e+02  3.9370e+00 Day:1993md 
+  6  12   3.595  30.010   1.905  1.2560e+02  2.6750e+00 Day:1993md 
+  6  12   3.595  30.010   1.920  1.2940e+02  3.4680e+00 Day:1993md 
+  6  12   3.595  30.010   1.935  1.3440e+02  3.4460e+00 Day:1993md 
+  6  12   3.595  30.010   1.950  1.3260e+02  3.3900e+00 Day:1993md 
+  6  12   3.595  30.010   1.965  1.4210e+02  2.9230e+00 Day:1993md 
+  6  12   3.595  30.010   1.980  1.4360e+02  4.8200e+00 Day:1993md 
+  6  12   3.595  30.010   1.995  1.4790e+02  4.8540e+00 Day:1993md 
+  6  12   3.595  30.010   2.010  1.4460e+02  4.7740e+00 Day:1993md 
+  6  12   3.595  30.010   2.025  1.4510e+02  4.9090e+00 Day:1993md 
+  6  12   3.605  16.020   0.105  3.4190e+00  1.1180e-01 Day:1993md 
+  6  12   3.605  16.020   0.120  6.2230e+00  1.5570e-01 Day:1993md 
+  6  12   3.605  16.020   0.135  1.0310e+01  2.0380e-01 Day:1993md 
+  6  12   3.605  16.020   0.150  1.6480e+01  2.5070e-01 Day:1993md 
+  6  12   3.605  16.020   0.165  2.4880e+01  3.0720e-01 Day:1993md 
+  6  12   3.605  16.020   0.180  3.6690e+01  3.9790e-01 Day:1993md 
+  6  12   3.605  16.020   0.195  5.2060e+01  4.8270e-01 Day:1993md 
+  6  12   4.045  15.000   0.075  5.8300e-02  4.6090e-02 Arrington:1998ps 
+  6  12   4.045  15.000   0.090  4.9440e-01  1.8020e-01 Arrington:1998ps 
+  6  12   4.045  15.000   0.105  1.1980e+00  3.5290e-01 Arrington:1998ps 
+  6  12   4.045  15.000   0.120  1.3600e+00  4.4050e-01 Arrington:1998ps 
+  6  12   4.045  15.000   0.135  4.9920e+00  9.0360e-01 Arrington:1998ps 
+  6  12   4.045  15.000   0.150  7.2110e+00  1.1330e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.165  1.2020e+01  1.4840e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.180  1.6170e+01  1.7190e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.195  2.5340e+01  2.1230e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.210  3.6300e+01  2.5080e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.225  4.8290e+01  2.8590e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.240  7.1500e+01  3.4680e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.255  8.0040e+01  3.6420e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.270  1.1630e+02  4.3730e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.285  1.5810e+02  5.0910e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.300  2.1380e+02  5.9220e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.315  2.8190e+02  6.7940e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.330  3.4080e+02  7.4290e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.345  4.4360e+02  8.3840e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.360  5.4280e+02  9.0650e+00 Arrington:1998ps 
+  6  12   4.045  15.000   0.375  7.2450e+02  1.0800e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.390  9.1810e+02  1.2300e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.405  1.0950e+03  1.3360e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.420  1.2670e+03  1.4320e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.435  1.4810e+03  1.5550e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.450  1.6770e+03  1.6430e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.465  1.8400e+03  1.6930e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.480  1.9820e+03  1.4070e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.495  2.0690e+03  1.4070e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.510  2.1790e+03  1.3950e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.525  2.2440e+03  1.3910e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.540  2.2740e+03  1.3870e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.555  2.2650e+03  1.3360e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.570  2.2620e+03  1.3120e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.585  2.2380e+03  1.2980e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.600  2.2550e+03  1.3080e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.615  2.2420e+03  1.3000e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.630  2.2010e+03  1.7610e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.645  2.2120e+03  1.7470e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.660  2.2040e+03  1.7190e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.675  2.2480e+03  1.7760e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.690  2.2390e+03  1.7460e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.705  2.3250e+03  1.7900e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.720  2.3690e+03  1.8240e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.735  2.3680e+03  1.8230e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.750  2.3830e+03  1.8110e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.765  2.3920e+03  1.8180e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.780  2.4030e+03  1.8020e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.795  2.4130e+03  1.8100e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.810  2.4430e+03  1.8080e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.825  2.4490e+03  1.8120e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.840  2.4540e+03  1.7910e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.855  2.4650e+03  1.7990e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.870  2.5150e+03  1.8110e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.885  2.5090e+03  1.8060e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.900  2.4760e+03  1.7830e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.915  2.4600e+03  1.7710e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.930  2.4660e+03  1.7510e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.945  2.4600e+03  1.7470e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.960  2.4850e+03  1.7640e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.975  2.5090e+03  1.7810e+01 Arrington:1998ps 
+  6  12   4.045  15.000   0.990  2.4690e+03  1.7780e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.005  2.5430e+03  1.8310e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.020  2.5590e+03  1.8420e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.035  2.5830e+03  1.8860e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.050  2.6060e+03  1.9280e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.065  2.5980e+03  1.9480e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.080  2.6020e+03  1.9780e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.095  2.6090e+03  2.0350e+01 Arrington:1998ps 
+  6  12   4.045  15.000   1.110  2.6660e+03  2.1060e+01 Arrington:1998ps 
+  6  12   4.045  23.000   0.240  3.8420e-04  3.0370e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.255  3.8230e-04  3.0220e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.270  3.8020e-04  3.0060e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.285  4.9570e-04  2.7550e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.300  1.2360e-03  4.0990e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.315  2.3410e-03  5.5080e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.330  3.7130e-03  6.8910e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.345  4.9750e-03  7.9650e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.360  5.6170e-03  8.4650e-04 Arrington:1998ps 
+  6  12   4.045  23.000   0.375  9.8030e-03  1.1170e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.390  1.4200e-02  1.3480e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.405  2.1940e-02  1.6740e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.420  3.0340e-02  1.9660e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.435  4.7650e-02  2.4640e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.450  7.0980e-02  3.0020e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.465  9.2610e-02  3.4270e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.480  1.1340e-01  3.7420e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.495  1.6260e-01  4.4550e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.510  2.1550e-01  5.1290e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.525  2.6900e-01  5.7030e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.540  3.3700e-01  6.4030e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.555  4.4570e-01  7.3990e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.570  5.5000e-01  8.2500e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.585  6.7560e-01  9.1880e-03 Arrington:1998ps 
+  6  12   4.045  23.000   0.600  8.4330e-01  1.0370e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.615  1.0390e+00  1.1740e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.630  1.2730e+00  1.9990e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.645  1.5570e+00  2.2110e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.660  1.9260e+00  2.4650e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.675  2.2640e+00  2.6940e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.690  2.8060e+00  3.0300e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.705  3.4490e+00  3.3800e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.720  4.1630e+00  3.7880e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.735  5.0820e+00  4.2690e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.750  6.1950e+00  4.7700e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.765  7.4940e+00  5.3960e-02 Arrington:1998ps 
+  6  12   4.045  23.000   0.780  9.0960e+00  2.0470e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.795  1.0850e+01  2.2240e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.810  1.3270e+01  2.4280e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.825  1.6230e+01  2.7270e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.840  1.9270e+01  2.9680e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.855  2.2140e+01  3.1660e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.870  2.6770e+01  3.4800e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.885  2.9930e+01  3.6510e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.900  3.4660e+01  3.9170e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.915  3.9280e+01  4.1640e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.930  4.3630e+01  4.3630e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.945  4.8310e+01  4.5410e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.960  5.3280e+01  4.7420e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.975  5.6830e+01  4.8870e-01 Arrington:1998ps 
+  6  12   4.045  23.000   0.990  6.0630e+01  5.0320e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.005  6.5210e+01  5.1520e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.020  6.8030e+01  5.3060e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.035  7.0910e+01  5.4600e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.050  7.4710e+01  5.6030e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.065  7.9310e+01  5.8690e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.080  8.1960e+01  6.0650e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.095  8.5220e+01  6.3060e-01 Arrington:1998ps 
+  6  12   4.045  23.000   1.110  8.6920e+01  6.4320e-01 Arrington:1998ps 
+  6  12   4.045  30.000   0.660  9.0760e-04  4.8140e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.675  3.2780e-04  2.1780e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.690  4.1480e-04  2.3050e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.705  2.9710e-04  1.9740e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.720  6.6740e-04  2.6960e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.735  1.3800e-03  3.6740e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.750  1.9790e-03  4.3140e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.765  2.5690e-03  4.8530e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.780  3.3340e-03  5.4810e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.795  3.4700e-03  5.5550e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.810  3.7040e-03  5.7150e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.825  6.1550e-03  7.3060e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.840  9.2180e-03  8.8680e-04 Arrington:1998ps 
+  6  12   4.045  30.000   0.855  1.2490e-02  1.0270e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.870  1.3730e-02  1.0700e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.885  1.4800e-02  1.1060e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.900  1.9820e-02  1.2740e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.915  2.5740e-02  1.4440e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.930  3.0290e-02  1.5630e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.945  3.6360e-02  1.6980e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.960  4.6640e-02  1.9220e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.975  5.5510e-02  2.0260e-03 Arrington:1998ps 
+  6  12   4.045  30.000   0.990  6.5230e-02  2.1790e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.005  7.9770e-02  2.4010e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.020  9.9530e-02  2.6670e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.035  1.1650e-01  2.8780e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.050  1.4420e-01  3.2160e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.065  1.6600e-01  3.4530e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.080  2.0720e-01  3.8750e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.095  2.5200e-01  4.2840e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.110  2.9890e-01  4.6930e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.125  3.6450e-01  6.1970e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.140  4.4270e-01  6.8620e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.155  5.2170e-01  7.4080e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.170  6.3700e-01  8.2170e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.185  7.6120e-01  8.9820e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.200  9.1650e-01  9.8980e-03 Arrington:1998ps 
+  6  12   4.045  30.000   1.215  1.0620e+00  1.0730e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.230  1.2930e+00  1.1900e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.245  1.5530e+00  1.3360e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.260  1.8270e+00  1.4800e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.275  2.1550e+00  1.6380e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.290  2.5370e+00  4.2620e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.305  2.9560e+00  4.5820e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.320  3.3960e+00  4.8900e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.335  3.8480e+00  5.1560e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.350  4.3540e+00  5.4860e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.365  4.7900e+00  5.7480e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.380  5.3630e+00  6.0600e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.395  6.1610e+00  6.4690e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.410  6.6490e+00  6.7150e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.425  7.1290e+00  6.4870e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.440  7.8920e+00  6.7870e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.455  8.4040e+00  6.9750e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.470  9.1190e+00  7.2040e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.485  9.8170e+00  7.5590e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.500  1.0440e+01  7.8300e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.515  1.1040e+01  8.1700e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.530  1.1810e+01  8.6210e-02 Arrington:1998ps 
+  6  12   4.045  30.000   1.545  1.2250e+01  1.7890e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.560  1.3210e+01  1.8360e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.575  1.4080e+01  1.8870e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.590  1.4770e+01  1.9200e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.605  1.5620e+01  1.9680e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.620  1.6110e+01  1.9980e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.635  1.7400e+01  2.0710e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.650  1.8150e+01  2.1050e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.665  1.8980e+01  2.1450e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.680  2.0220e+01  2.2040e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.695  2.1110e+01  2.2380e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.710  2.2350e+01  2.3240e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.725  2.3950e+01  2.3950e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.740  2.4740e+01  2.4250e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.755  2.6370e+01  2.5050e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.770  2.7550e+01  2.5620e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.785  2.8910e+01  2.6310e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.800  3.0150e+01  2.6830e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.815  3.1960e+01  2.7810e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.830  3.3010e+01  2.8720e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.845  3.5110e+01  3.0190e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.860  3.6580e+01  3.1820e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.875  3.8570e+01  3.3170e-01 Arrington:1998ps 
+  6  12   4.045  30.000   1.890  4.0700e+01  3.5410e-01 Arrington:1998ps 
+  6  12   4.045  37.000   1.425  2.0090e-02  2.6720e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.440  2.6610e-02  2.8950e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.455  3.1430e-02  2.9760e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.470  3.6510e-02  3.0700e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.485  4.9210e-02  3.4500e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.500  5.9270e-02  3.6980e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.515  7.8000e-02  4.1960e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.530  9.0750e-02  4.4920e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.545  9.6900e-02  4.6120e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.560  1.1770e-01  5.0380e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.575  1.4870e-01  5.6360e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.590  1.6330e-01  5.8790e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.605  2.0750e-01  6.6190e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.620  2.4230e-01  7.1240e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.635  2.9250e-01  7.8100e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.650  3.4040e-01  8.4760e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.665  4.1890e-01  9.3410e-03 Arrington:1998ps 
+  6  12   4.045  37.000   1.680  4.9650e-01  1.0130e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.695  5.6640e-01  1.0820e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.710  6.4940e-01  1.1560e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.725  7.5800e-01  1.2430e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.740  8.6650e-01  1.3260e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.755  9.9270e-01  1.4100e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.770  1.1370e+00  1.5010e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.785  1.2550e+00  1.5810e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.800  1.4340e+00  1.6780e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.815  1.5570e+00  1.7590e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.830  1.7440e+00  1.8840e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.845  1.8660e+00  1.9590e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.860  2.0510e+00  2.0920e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.875  2.2690e+00  2.2460e-02 Arrington:1998ps 
+  6  12   4.045  37.000   1.890  2.4870e+00  2.4370e-02 Arrington:1998ps 
+  6  12   4.045  45.000   1.680  6.3460e-04  5.0170e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.695  3.1570e-04  3.8660e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.710  2.8290e-03  9.6860e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.725  1.2450e-03  6.6050e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.740  1.5630e-03  7.3300e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.755  1.2430e-03  6.5900e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.770  2.8100e-03  9.6240e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.785  3.7160e-03  1.0950e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.800  5.1880e-03  7.6470e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.815  4.9120e-03  7.0880e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.830  7.1510e-03  8.1450e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.845  8.0320e-03  8.3290e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.860  1.0220e-02  9.1780e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.875  9.9570e-03  8.9410e-04 Arrington:1998ps 
+  6  12   4.045  45.000   1.890  1.3650e-02  1.0410e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.905  1.6610e-02  1.1460e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.920  2.1470e-02  1.3010e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.935  2.6580e-02  1.4510e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.950  3.2090e-02  1.6080e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.965  3.7130e-02  1.9310e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.980  4.5070e-02  2.1140e-03 Arrington:1998ps 
+  6  12   4.045  45.000   1.995  5.5640e-02  2.3420e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.010  6.2290e-02  2.4670e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.025  7.9930e-02  2.8140e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.040  9.0860e-02  2.9980e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.055  1.1220e-01  3.3320e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.070  1.3480e-01  3.6400e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.085  1.6540e-01  4.0190e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.100  1.8890e-01  4.2690e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.115  2.1040e-01  4.5030e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.130  2.6230e-01  4.6690e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.145  2.9690e-01  4.9290e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.160  3.4130e-01  5.2900e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.175  3.9480e-01  5.7250e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.190  4.4550e-01  6.1920e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.205  4.9830e-01  6.7270e-03 Arrington:1998ps 
+  6  12   4.045  45.000   2.220  5.4770e-01  1.4400e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.235  6.1000e-01  1.5070e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.250  6.7440e-01  1.5780e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.265  7.8660e-01  1.6910e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.280  8.5350e-01  1.7500e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.295  9.2110e-01  1.8150e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.310  1.0170e+00  1.9020e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.325  1.1440e+00  2.0130e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.340  1.2370e+00  2.0910e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.355  1.3960e+00  2.2060e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.370  1.5230e+00  2.3000e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.385  1.6250e+00  2.3720e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.400  1.8060e+00  2.5100e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.415  1.9680e+00  2.6370e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.430  2.1580e+00  2.8050e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.445  2.4280e+00  3.0590e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.460  2.5760e+00  3.2970e-02 Arrington:1998ps 
+  6  12   4.045  45.000   2.460  2.5760e+00  3.2970e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.145  1.4840e-03  6.6450e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.160  6.6860e-04  4.7960e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.175  1.2670e-03  5.8510e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.190  2.2420e-03  6.9390e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.205  4.0350e-04  3.2520e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.220  1.1970e-03  5.2860e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.235  2.3500e-03  7.1600e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.250  1.7570e-03  6.3940e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.265  3.6530e-03  8.8400e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.280  2.8600e-03  7.7190e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.295  5.3020e-03  1.0360e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.310  5.8550e-03  1.0940e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.325  6.7370e-03  1.1730e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.340  8.7600e-03  1.3170e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.355  1.0920e-02  1.4670e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.370  1.2930e-02  1.5870e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.385  1.5790e-02  9.5210e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.400  1.8270e-02  9.5190e-04 Arrington:1998ps 
+  6  12   4.045  55.000   2.415  2.5650e-02  1.0570e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.430  2.9950e-02  1.0990e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.445  3.7940e-02  1.2100e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.460  4.5360e-02  1.3250e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.475  5.5900e-02  1.5930e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.490  6.7430e-02  1.7190e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.505  8.0550e-02  1.8770e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.520  9.7770e-02  2.0340e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.535  1.1410e-01  2.1680e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.550  1.2720e-01  2.2770e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.565  1.4700e-01  2.4250e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.580  1.7510e-01  2.6270e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.595  1.9750e-01  2.7850e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.610  2.2650e-01  2.8540e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.625  2.5910e-01  3.0570e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.640  3.0130e-01  3.2540e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.655  3.4600e-01  3.5290e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.670  3.9980e-01  3.9180e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.685  4.6980e-01  4.4630e-03 Arrington:1998ps 
+  6  12   4.045  55.000   2.700  5.4880e-01  1.4050e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.715  6.1570e-01  1.4900e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.730  6.7980e-01  1.5430e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.745  7.6540e-01  1.6380e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.760  8.5820e-01  1.7250e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.775  9.4510e-01  1.8050e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.790  1.0420e+00  1.8860e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.805  1.1810e+00  2.0080e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.820  1.2890e+00  1.8560e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.835  1.4370e+00  1.9260e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.850  1.6120e+00  2.0630e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.865  1.7460e+00  2.2170e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.880  1.9990e+00  4.1580e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.895  2.1230e+00  4.2460e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.910  2.3200e+00  4.4080e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.925  2.5030e+00  4.5550e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.940  2.7300e+00  4.7230e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.955  2.9790e+00  4.9450e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.970  3.3570e+00  5.2030e-02 Arrington:1998ps 
+  6  12   4.045  55.000   2.985  3.5700e+00  5.3910e-02 Arrington:1998ps 
+  6  12   4.045  55.000   3.000  3.8630e+00  5.6400e-02 Arrington:1998ps 
+  6  12   4.045  55.000   3.015  4.2410e+00  6.1070e-02 Arrington:1998ps 
+  6  12   4.045  55.000   3.030  4.6240e+00  6.7970e-02 Arrington:1998ps 
+  6  12   4.045  74.000   2.805  2.1800e-03  4.4490e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.820  1.9400e-03  3.8700e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.835  2.2000e-03  3.7620e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.850  3.7300e-03  4.3450e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.865  3.5900e-03  4.1610e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.880  4.1000e-03  4.4030e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.895  5.7900e-03  5.1470e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.910  8.5000e-03  6.0950e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.925  1.1000e-02  6.8530e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.940  1.5300e-02  7.9710e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.955  1.8800e-02  8.7980e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.970  2.3000e-02  9.6600e-04 Arrington:1998ps 
+  6  12   4.045  74.000   2.985  2.8700e-02  1.0710e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.000  3.5300e-02  1.1750e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.015  4.3400e-02  1.2930e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.030  5.0800e-02  1.2650e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.045  6.4800e-02  1.3870e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.060  7.7000e-02  1.4940e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.075  8.6500e-02  2.7160e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.090  1.0700e-01  2.9210e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.105  1.2900e-01  3.1730e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.120  1.6100e-01  3.5420e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.135  1.9400e-01  3.8610e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.150  2.2700e-01  4.1770e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.165  2.7300e-01  4.5590e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.180  3.2200e-01  4.9270e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.195  3.7300e-01  5.2970e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.210  4.2700e-01  5.7220e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.225  5.0100e-01  5.6110e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.240  5.8500e-01  6.0260e-03 Arrington:1998ps 
+  6  12   4.045  74.000   3.255  6.5600e-01  1.1480e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.270  7.7100e-01  1.1950e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.285  8.6400e-01  1.2610e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.300  1.0200e+00  1.3670e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.315  1.1600e+00  1.4620e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.330  1.3900e+00  1.5980e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.345  1.5000e+00  1.6650e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.360  1.6400e+00  1.7550e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.375  1.9300e+00  1.9490e-02 Arrington:1998ps 
+  6  12   4.045  74.000   3.390  2.0700e+00  2.1110e-02 Arrington:1998ps 
+  6  12   4.212  53.389   2.659  1.1865e-01  3.7818e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.669  1.3532e-01  3.4336e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.681  1.6154e-01  3.6948e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.692  1.8935e-01  4.0127e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.704  2.1797e-01  4.2932e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.716  2.3682e-01  4.4686e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.728  2.5283e-01  4.5718e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.739  2.9515e-01  4.9599e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.751  3.2015e-01  5.1610e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.763  3.6058e-01  5.4447e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.775  4.0399e-01  5.7839e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.786  4.6353e-01  6.3306e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.798  4.9122e-01  6.7027e-03 Arrington:1995hs 
+  6  12   4.212  53.389   2.810  5.4716e-01  7.3861e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.567  2.9522e-02  1.2218e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.578  3.3413e-02  1.1055e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.589  3.9633e-02  1.1956e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.601  5.0295e-02  1.3466e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.613  5.2522e-02  1.3684e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.625  6.3555e-02  1.5050e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.636  6.6005e-02  1.5161e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.648  7.7974e-02  1.6499e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.660  8.4903e-02  1.7115e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.672  9.7368e-02  1.8388e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.683  1.1489e-01  1.9988e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.695  1.2374e-01  2.0939e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.707  1.4123e-01  2.3308e-03 Arrington:1995hs 
+  6  12   5.120  56.639   3.719  1.7035e-01  2.7137e-03 Arrington:1995hs
+6 12 5.766 18.00 2.3101e+00 2.5728e+02 3.9088e-01 Fomin:2010ei
+6 12 5.766 18.00 2.2120e+00 2.3927e+02 3.4525e-01 Fomin:2010ei
+6 12 5.766 18.00 2.1216e+00 2.1680e+02 3.2282e-01 Fomin:2010ei
+6 12 5.766 18.00 2.0386e+00 1.9365e+02 3.1663e-01 Fomin:2010ei
+6 12 5.766 18.00 1.9618e+00 1.7247e+02 3.1227e-01 Fomin:2010ei
+6 12 5.766 18.00 1.8904e+00 1.5527e+02 3.1684e-01 Fomin:2010ei
+6 12 5.766 18.00 1.8242e+00 1.3452e+02 3.2813e-01 Fomin:2010ei
+6 12 5.766 18.00 1.7624e+00 1.1717e+02 2.0150e-01 Fomin:2010ei
+6 12 5.766 18.00 1.7046e+00 1.0399e+02 1.8956e-01 Fomin:2010ei
+6 12 5.766 18.00 1.6506e+00 9.2538e+01 1.9509e-01 Fomin:2010ei
+6 12 5.766 18.00 1.5999e+00 8.3416e+01 1.8341e-01 Fomin:2010ei
+6 12 5.766 18.00 1.5520e+00 7.5492e+01 1.7953e-01 Fomin:2010ei
+6 12 5.766 18.00 1.5071e+00 6.7108e+01 1.7391e-01 Fomin:2010ei
+6 12 5.766 18.00 1.4647e+00 6.0603e+01 1.7115e-01 Fomin:2010ei
+6 12 5.766 18.00 1.4246e+00 5.4916e+01 1.6831e-01 Fomin:2010ei
+6 12 5.766 18.00 1.3866e+00 4.9395e+01 1.6416e-01 Fomin:2010ei
+6 12 5.766 18.00 1.3507e+00 4.4147e+01 1.5943e-01 Fomin:2010ei
+6 12 5.766 18.00 1.3164e+00 3.8913e+01 1.5429e-01 Fomin:2010ei
+6 12 5.766 18.00 1.2840e+00 3.5027e+01 1.5146e-01 Fomin:2010ei
+6 12 5.766 18.00 1.2531e+00 3.0725e+01 1.4643e-01 Fomin:2010ei
+6 12 5.766 18.00 1.2236e+00 2.6010e+01 1.3834e-01 Fomin:2010ei
+6 12 5.766 18.00 1.1955e+00 2.1523e+01 1.2969e-01 Fomin:2010ei
+6 12 5.766 18.00 1.1687e+00 1.7823e+01 1.2111e-01 Fomin:2010ei
+6 12 5.766 18.00 1.1429e+00 1.4524e+01 1.1532e-01 Fomin:2010ei
+6 12 5.766 18.00 1.1184e+00 1.2001e+01 4.5638e-02 Fomin:2010ei
+6 12 5.766 18.00 1.0949e+00 9.7129e+00 4.0163e-02 Fomin:2010ei
+6 12 5.766 18.00 1.0723e+00 7.6817e+00 3.5086e-02 Fomin:2010ei
+6 12 5.766 18.00 1.0506e+00 6.2295e+00 3.1578e-02 Fomin:2010ei
+6 12 5.766 18.00 1.0299e+00 4.9778e+00 2.8078e-02 Fomin:2010ei
+6 12 5.766 18.00 1.0098e+00 4.0469e+00 2.5552e-02 Fomin:2010ei
+6 12 5.766 18.00 9.9063e-01 3.2821e+00 2.3599e-02 Fomin:2010ei
+6 12 5.766 18.00 9.7214e-01 2.7237e+00 2.1892e-02 Fomin:2010ei
+6 12 5.766 18.00 9.5428e-01 2.2719e+00 2.0507e-02 Fomin:2010ei
+6 12 5.766 18.00 9.3711e-01 1.8699e+00 1.8778e-02 Fomin:2010ei
+6 12 5.766 18.00 9.2055e-01 1.5550e+00 1.7468e-02 Fomin:2010ei
+6 12 5.766 18.00 9.0451e-01 1.2902e+00 1.6103e-02 Fomin:2010ei
+6 12 5.766 18.00 8.8907e-01 1.1184e+00 1.5516e-02 Fomin:2010ei
+6 12 5.766 18.00 8.7415e-01 9.7264e-01 1.4524e-02 Fomin:2010ei
+6 12 5.766 18.00 8.5968e-01 7.8618e-01 1.3221e-02 Fomin:2010ei
+6 12 5.766 18.00 8.4572e-01 7.0622e-01 1.2857e-02 Fomin:2010ei
+6 12 5.766 18.00 8.3221e-01 5.9549e-01 1.1837e-02 Fomin:2010ei
+6 12 5.766 18.00 8.1908e-01 5.0680e-01 1.1180e-02 Fomin:2010ei
+6 12 5.766 18.00 8.0640e-01 4.3588e-01 1.0452e-02 Fomin:2010ei
+6 12 5.766 18.00 7.9410e-01 3.9300e-01 1.0107e-02 Fomin:2010ei
+6 12 5.766 18.00 7.8214e-01 3.3961e-01 9.5410e-03 Fomin:2010ei
+6 12 5.766 18.00 7.7057e-01 2.9536e-01 9.0377e-03 Fomin:2010ei
+6 12 5.766 18.00 7.5934e-01 2.5078e-01 8.4298e-03 Fomin:2010ei
+6 12 5.766 18.00 7.4839e-01 2.2106e-01 8.0395e-03 Fomin:2010ei
+6 12 5.766 18.00 7.3779e-01 1.9023e-01 7.6093e-03 Fomin:2010ei
+6 12 5.766 18.00 7.2749e-01 1.5406e-01 6.8424e-03 Fomin:2010ei
+6 12 5.766 18.00 7.1744e-01 1.3897e-01 6.5585e-03 Fomin:2010ei
+6 12 5.766 18.00 7.0769e-01 1.2479e-01 6.2868e-03 Fomin:2010ei
+6 12 5.766 18.00 6.9820e-01 1.1448e-01 6.1455e-03 Fomin:2010ei
+6 12 5.766 18.00 6.8894e-01 9.9249e-02 5.7397e-03 Fomin:2010ei
+6 12 5.766 18.00 6.7994e-01 9.3518e-02 5.6291e-03 Fomin:2010ei
+6 12 5.766 18.00 6.7118e-01 7.1369e-02 4.9846e-03 Fomin:2010ei
+6 12 5.766 18.00 6.6262e-01 6.1549e-02 4.6930e-03 Fomin:2010ei
+6 12 5.766 18.00 6.5429e-01 6.6501e-02 4.9985e-03 Fomin:2010ei
+6 12 5.766 18.00 6.4618e-01 4.6530e-02 4.1953e-03 Fomin:2010ei
+6 12 5.766 18.00 6.3823e-01 4.4652e-02 4.1458e-03 Fomin:2010ei
+6 12 5.766 18.00 6.3051e-01 3.9887e-02 3.9884e-03 Fomin:2010ei
+6 12 5.766 18.00 6.2297e-01 3.6122e-02 3.7864e-03 Fomin:2010ei
+6 12 5.766 18.00 6.1558e-01 2.4418e-02 3.1519e-03 Fomin:2010ei
+6 12 5.766 18.00 6.0839e-01 2.5029e-02 3.2308e-03 Fomin:2010ei
+6 12 5.766 18.00 6.0137e-01 2.0738e-02 2.9926e-03 Fomin:2010ei
+6 12 5.766 18.00 5.9448e-01 2.1512e-02 3.0116e-03 Fomin:2010ei
+6 12 5.766 18.00 5.8777e-01 1.9818e-02 2.9870e-03 Fomin:2010ei
+6 12 5.766 18.00 5.8121e-01 1.5788e-02 2.6676e-03 Fomin:2010ei
+6 12 5.766 18.00 5.7478e-01 1.7101e-02 2.8492e-03 Fomin:2010ei
+6 12 5.766 18.00 5.6851e-01 1.3098e-02 2.5192e-03 Fomin:2010ei
+6 12 5.766 18.00 5.6237e-01 1.1157e-02 2.3244e-03 Fomin:2010ei
+6 12 5.766 18.00 5.5634e-01 1.0403e-02 2.2680e-03 Fomin:2010ei
+6 12 5.766 18.00 5.5046e-01 1.2690e-02 2.4870e-03 Fomin:2010ei
+6 12 5.766 18.00 5.4471e-01 8.9061e-03 2.1566e-03 Fomin:2010ei
+6 12 5.766 18.00 5.3905e-01 6.3169e-03 1.8181e-03 Fomin:2010ei
+6 12 5.766 18.00 5.3353e-01 6.2884e-03 1.8099e-03 Fomin:2010ei
+6 12 5.766 18.00 5.2812e-01 7.1497e-03 1.9779e-03 Fomin:2010ei
+6 12 5.766 18.00 5.2280e-01 6.7852e-03 1.9529e-03 Fomin:2010ei
+6 12 5.766 18.00 5.1761e-01 3.2412e-03 1.4292e-03 Fomin:2010ei
+6 12 5.766 18.00 5.1251e-01 3.7923e-03 1.5323e-03 Fomin:2010ei
+6 12 5.766 18.00 5.0751e-01 3.1853e-03 1.4046e-03 Fomin:2010ei
+6 12 5.766 18.00 5.0261e-01 4.5620e-03 1.7108e-03 Fomin:2010ei
+6 12 5.766 18.00 4.9308e-01 1.6891e-03 1.1261e-03 Fomin:2010ei
+6 12 5.766 18.00 4.8845e-01 2.2971e-03 1.2841e-03 Fomin:2010ei
+6 12 5.766 18.00 4.8391e-01 2.9273e-03 1.4341e-03 Fomin:2010ei
+6 12 5.766 18.00 4.7945e-01 1.8308e-03 1.2205e-03 Fomin:2010ei
+6 12 5.766 18.00 4.7507e-01 1.8301e-03 1.2201e-03 Fomin:2010ei
+6 12 5.766 18.00 4.7078e-01 2.3939e-03 1.3382e-03 Fomin:2010ei
+6 12 5.766 18.00 4.6655e-01 6.0780e-04 8.5955e-04 Fomin:2010ei
+6 12 5.766 18.00 4.6241e-01 3.2048e-03 1.5701e-03 Fomin:2010ei
+6 12 5.766 18.00 4.5433e-01 6.2209e-04 8.7976e-04 Fomin:2010ei
+6 12 5.766 18.00 4.5040e-01 6.6632e-04 9.4230e-04 Fomin:2010ei
+6 12 5.766 18.00 4.4273e-01 1.3016e-03 1.1272e-03 Fomin:2010ei
+6 12 5.766 18.00 4.3171e-01 1.3495e-03 1.1687e-03 Fomin:2010ei
+6 12 5.766 18.00 4.2816e-01 6.8892e-04 9.7427e-04 Fomin:2010ei
+6 12 5.766 18.00 4.2123e-01 7.0111e-04 9.9151e-04 Fomin:2010ei
+6 12 5.766 18.00 4.1785e-01 7.1296e-04 1.0083e-03 Fomin:2010ei
+6 12 5.766 18.00 4.0485e-01 2.2829e-03 1.5219e-03 Fomin:2010ei
+6 12 5.766 18.00 3.9262e-01 7.7228e-04 1.0922e-03 Fomin:2010ei
+6 12 5.766 18.00 3.8968e-01 8.1222e-04 1.1486e-03 Fomin:2010ei
+6 12 5.766 22.00 2.9858e+00 1.1154e+02 1.9416e-01 Fomin:2010ei
+6 12 5.766 22.00 2.8750e+00 9.9950e+01 1.7080e-01 Fomin:2010ei
+6 12 5.766 22.00 2.7722e+00 8.9828e+01 1.6889e-01 Fomin:2010ei
+6 12 5.766 22.00 2.6761e+00 7.9769e+01 1.8158e-01 Fomin:2010ei
+6 12 5.766 22.00 2.5868e+00 7.0708e+01 9.7967e-02 Fomin:2010ei
+6 12 5.766 22.00 2.5032e+00 6.2284e+01 9.3564e-02 Fomin:2010ei
+6 12 5.766 22.00 2.4247e+00 5.3309e+01 8.4105e-02 Fomin:2010ei
+6 12 5.766 22.00 2.3511e+00 4.5815e+01 8.0762e-02 Fomin:2010ei
+6 12 5.766 22.00 2.2819e+00 3.9388e+01 7.7530e-02 Fomin:2010ei
+6 12 5.766 22.00 2.2164e+00 3.2964e+01 7.3145e-02 Fomin:2010ei
+6 12 5.766 22.00 2.1548e+00 2.8050e+01 7.4189e-02 Fomin:2010ei
+6 12 5.766 22.00 2.0965e+00 2.3245e+01 4.2602e-02 Fomin:2010ei
+6 12 5.766 22.00 2.0411e+00 2.0109e+01 3.8673e-02 Fomin:2010ei
+6 12 5.766 22.00 1.9887e+00 1.7322e+01 3.8217e-02 Fomin:2010ei
+6 12 5.766 22.00 1.9389e+00 1.4620e+01 3.4005e-02 Fomin:2010ei
+6 12 5.766 22.00 1.8915e+00 1.2707e+01 3.2587e-02 Fomin:2010ei
+6 12 5.766 22.00 1.8464e+00 1.0873e+01 3.1015e-02 Fomin:2010ei
+6 12 5.766 22.00 1.8034e+00 9.2300e+00 2.9265e-02 Fomin:2010ei
+6 12 5.766 22.00 1.7623e+00 7.7514e+00 2.7500e-02 Fomin:2010ei
+6 12 5.766 22.00 1.7231e+00 6.5788e+00 2.6013e-02 Fomin:2010ei
+6 12 5.766 22.00 1.6856e+00 5.3424e+00 2.4024e-02 Fomin:2010ei
+6 12 5.766 22.00 1.6496e+00 4.4013e+00 2.2372e-02 Fomin:2010ei
+6 12 5.766 22.00 1.6152e+00 3.5270e+00 2.0548e-02 Fomin:2010ei
+6 12 5.766 22.00 1.5823e+00 2.7966e+00 1.8770e-02 Fomin:2010ei
+6 12 5.766 22.00 1.5505e+00 2.1878e+00 1.7061e-02 Fomin:2010ei
+6 12 5.766 22.00 1.5201e+00 1.6821e+00 1.0339e-02 Fomin:2010ei
+6 12 5.766 22.00 1.4908e+00 1.2867e+00 9.0159e-03 Fomin:2010ei
+6 12 5.766 22.00 1.4626e+00 1.0132e+00 8.0535e-03 Fomin:2010ei
+6 12 5.766 22.00 1.4355e+00 7.5247e-01 7.0285e-03 Fomin:2010ei
+6 12 5.766 22.00 1.4094e+00 5.8809e-01 6.3210e-03 Fomin:2010ei
+6 12 5.766 22.00 1.3842e+00 4.6160e-01 6.2858e-03 Fomin:2010ei
+6 12 5.766 22.00 1.3599e+00 3.7365e-01 5.7486e-03 Fomin:2010ei
+6 12 5.766 22.00 1.3364e+00 2.9707e-01 5.2287e-03 Fomin:2010ei
+6 12 5.766 22.00 1.3137e+00 2.4533e-01 4.8507e-03 Fomin:2010ei
+6 12 5.766 22.00 1.2918e+00 1.8602e-01 4.2485e-03 Fomin:2010ei
+6 12 5.766 22.00 1.2706e+00 1.5043e-01 3.8971e-03 Fomin:2010ei
+6 12 5.766 22.00 1.2500e+00 1.1964e-01 3.5370e-03 Fomin:2010ei
+6 12 5.766 22.00 1.2302e+00 9.5252e-02 3.2001e-03 Fomin:2010ei
+6 12 5.766 22.00 1.2110e+00 7.7586e-02 2.9429e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1923e+00 6.4148e-02 2.7157e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1742e+00 5.5130e-02 2.5484e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1567e+00 4.3140e-02 2.2800e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1396e+00 3.5220e-02 2.0899e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1231e+00 3.0535e-02 1.9792e-03 Fomin:2010ei
+6 12 5.766 22.00 1.1071e+00 2.7009e-02 1.8910e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0914e+00 2.3896e-02 1.8012e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0763e+00 1.8230e-02 1.5806e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0615e+00 1.5408e-02 1.4826e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0471e+00 1.3793e-02 1.4302e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0332e+00 9.9112e-03 1.2107e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0196e+00 7.5849e-03 1.0834e-03 Fomin:2010ei
+6 12 5.766 22.00 1.0063e+00 7.3284e-03 1.0803e-03 Fomin:2010ei
+6 12 5.766 22.00 9.9340e-01 4.6357e-03 8.7551e-04 Fomin:2010ei
+6 12 5.766 22.00 9.8082e-01 6.4440e-03 1.0450e-03 Fomin:2010ei
+6 12 5.766 22.00 9.6853e-01 4.7641e-03 9.1626e-04 Fomin:2010ei
+6 12 5.766 22.00 9.5657e-01 4.1371e-03 8.6190e-04 Fomin:2010ei
+6 12 5.766 22.00 9.4491e-01 2.3004e-03 6.6210e-04 Fomin:2010ei
+6 12 5.766 22.00 9.3349e-01 2.8680e-03 7.3906e-04 Fomin:2010ei
+6 12 5.766 22.00 9.2238e-01 1.6983e-03 5.9670e-04 Fomin:2010ei
+6 12 5.766 22.00 9.1153e-01 2.4512e-03 7.0550e-04 Fomin:2010ei
+6 12 5.766 22.00 9.0090e-01 1.7324e-03 6.0871e-04 Fomin:2010ei
+6 12 5.766 22.00 8.9055e-01 5.9509e-04 3.9673e-04 Fomin:2010ei
+6 12 5.766 22.00 8.8043e-01 8.0944e-04 4.5249e-04 Fomin:2010ei
+6 12 5.766 22.00 8.7051e-01 4.1697e-04 3.6111e-04 Fomin:2010ei
+6 12 5.766 22.00 8.6084e-01 8.3650e-04 4.6761e-04 Fomin:2010ei
+6 12 5.766 22.00 8.5138e-01 8.6425e-04 4.8313e-04 Fomin:2010ei
+6 12 5.766 22.00 8.4210e-01 6.4945e-04 4.3297e-04 Fomin:2010ei
+6 12 5.766 22.00 8.3304e-01 6.6554e-04 4.4369e-04 Fomin:2010ei
+6 12 5.766 22.00 8.2418e-01 4.5041e-04 3.9007e-04 Fomin:2010ei
+6 12 5.766 22.00 8.1548e-01 4.6088e-04 3.9914e-04 Fomin:2010ei
+6 12 5.766 22.00 8.0699e-01 4.7644e-04 4.1261e-04 Fomin:2010ei
+6 12 5.766 22.00 7.9867e-01 4.8674e-04 4.2153e-04 Fomin:2010ei
+6 12 5.766 22.00 7.9050e-01 4.9940e-04 4.3249e-04 Fomin:2010ei
+6 12 5.766 22.00 7.7470e-01 5.9482e-04 5.1513e-04 Fomin:2010ei
+6 12 5.766 22.00 7.6700e-01 6.7884e-04 5.8789e-04 Fomin:2010ei
+6 12 5.766 22.00 7.5949e-01 3.8013e-04 5.3759e-04 Fomin:2010ei
+6 12 5.766 22.00 7.5212e-01 4.0826e-04 5.7738e-04 Fomin:2010ei
+6 12 5.766 22.00 7.1069e-01 1.0118e-03 1.4310e-03 Fomin:2010ei
+6 12 5.766 22.00 7.0421e-01 1.1925e-03 1.6864e-03 Fomin:2010ei
+6 12 5.766 26.00 3.2448e+00 4.2437e+01 7.6571e-02 Fomin:2010ei
+6 12 5.766 26.00 3.1496e+00 3.7218e+01 6.3801e-02 Fomin:2010ei
+6 12 5.766 26.00 3.0601e+00 3.1966e+01 5.9882e-02 Fomin:2010ei
+6 12 5.766 26.00 2.9756e+00 2.7492e+01 5.8525e-02 Fomin:2010ei
+6 12 5.766 26.00 2.8953e+00 2.3738e+01 6.3794e-02 Fomin:2010ei
+6 12 5.766 26.00 2.8195e+00 1.9845e+01 2.8539e-02 Fomin:2010ei
+6 12 5.766 26.00 2.7476e+00 1.6644e+01 2.5747e-02 Fomin:2010ei
+6 12 5.766 26.00 2.6790e+00 1.3955e+01 2.3600e-02 Fomin:2010ei
+6 12 5.766 26.00 2.6140e+00 1.1338e+01 2.1736e-02 Fomin:2010ei
+6 12 5.766 26.00 2.5521e+00 9.1864e+00 2.0015e-02 Fomin:2010ei
+6 12 5.766 26.00 2.4928e+00 7.5344e+00 1.8738e-02 Fomin:2010ei
+6 12 5.766 26.00 2.4364e+00 6.1767e+00 1.8504e-02 Fomin:2010ei
+6 12 5.766 26.00 2.3825e+00 4.9535e+00 1.0594e-02 Fomin:2010ei
+6 12 5.766 26.00 2.3308e+00 4.1116e+00 9.4249e-03 Fomin:2010ei
+6 12 5.766 26.00 2.2814e+00 3.3595e+00 9.0376e-03 Fomin:2010ei
+6 12 5.766 26.00 2.2341e+00 2.7423e+00 8.0063e-03 Fomin:2010ei
+6 12 5.766 26.00 2.1886e+00 2.2324e+00 7.3852e-03 Fomin:2010ei
+6 12 5.766 26.00 2.1450e+00 1.8028e+00 6.8129e-03 Fomin:2010ei
+6 12 5.766 26.00 2.1031e+00 1.4224e+00 6.1861e-03 Fomin:2010ei
+6 12 5.766 26.00 2.0627e+00 1.1052e+00 5.5546e-03 Fomin:2010ei
+6 12 5.766 26.00 2.0239e+00 8.4955e-01 4.9627e-03 Fomin:2010ei
+6 12 5.766 26.00 1.9866e+00 6.4896e-01 4.4465e-03 Fomin:2010ei
+6 12 5.766 26.00 1.9505e+00 4.8320e-01 3.9259e-03 Fomin:2010ei
+6 12 5.766 26.00 1.9158e+00 3.5672e-01 3.4344e-03 Fomin:2010ei
+6 12 5.766 26.00 1.8823e+00 2.7114e-01 3.0800e-03 Fomin:2010ei
+6 12 5.766 26.00 1.8499e+00 1.9464e-01 2.8105e-03 Fomin:2010ei
+6 12 5.766 26.00 1.8187e+00 1.4744e-01 1.9286e-03 Fomin:2010ei
+6 12 5.766 26.00 1.7885e+00 1.1035e-01 1.7018e-03 Fomin:2010ei
+6 12 5.766 26.00 1.7592e+00 7.9346e-02 1.4748e-03 Fomin:2010ei
+6 12 5.766 26.00 1.7309e+00 6.2400e-02 1.5819e-03 Fomin:2010ei
+6 12 5.766 26.00 1.7035e+00 5.0177e-02 1.4020e-03 Fomin:2010ei
+6 12 5.766 26.00 1.6769e+00 3.7714e-02 1.2288e-03 Fomin:2010ei
+6 12 5.766 26.00 1.6512e+00 2.9720e-02 1.1145e-03 Fomin:2010ei
+6 12 5.766 26.00 1.6263e+00 2.0928e-02 9.4740e-04 Fomin:2010ei
+6 12 5.766 26.00 1.6020e+00 1.7591e-02 8.7955e-04 Fomin:2010ei
+6 12 5.766 26.00 1.5785e+00 1.3936e-02 7.9410e-04 Fomin:2010ei
+6 12 5.766 26.00 1.5557e+00 9.6023e-03 6.6899e-04 Fomin:2010ei
+6 12 5.766 26.00 1.5335e+00 8.2386e-03 6.3187e-04 Fomin:2010ei
+6 12 5.766 26.00 1.5120e+00 6.6855e-03 5.7323e-04 Fomin:2010ei
+6 12 5.766 26.00 1.4910e+00 5.0031e-03 5.0280e-04 Fomin:2010ei
+6 12 5.766 26.00 1.4706e+00 4.0199e-03 4.6107e-04 Fomin:2010ei
+6 12 5.766 26.00 1.4508e+00 3.2959e-03 4.2194e-04 Fomin:2010ei
+6 12 5.766 26.00 1.4315e+00 3.4978e-03 4.4062e-04 Fomin:2010ei
+6 12 5.766 26.00 1.4127e+00 2.4014e-03 3.7044e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3944e+00 1.7054e-03 3.1651e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3766e+00 1.3912e-03 2.8984e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3592e+00 1.7418e-03 3.2897e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3422e+00 8.5294e-04 2.3596e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3257e+00 5.0864e-04 1.9074e-04 Fomin:2010ei
+6 12 5.766 26.00 1.3095e+00 7.1738e-04 2.2592e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2938e+00 4.6664e-04 1.8855e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2784e+00 2.0604e-04 1.3736e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2634e+00 1.3958e-04 1.2087e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2488e+00 1.4394e-04 1.2465e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2344e+00 4.4208e-04 1.9493e-04 Fomin:2010ei
+6 12 5.766 26.00 1.2204e+00 1.5128e-04 1.3101e-04 Fomin:2010ei
+6 12 5.766 26.00 1.1934e+00 1.5634e-04 1.3539e-04 Fomin:2010ei
+6 12 5.766 26.00 1.1306e+00 1.1767e-04 1.6641e-04 Fomin:2010ei
+6 12 5.766 32.00 3.6288e+00 1.3513e+01 2.2261e-02 Fomin:2010ei
+6 12 5.766 32.00 3.5492e+00 1.1216e+01 1.8109e-02 Fomin:2010ei
+6 12 5.766 32.00 3.4727e+00 9.3301e+00 1.6853e-02 Fomin:2010ei
+6 12 5.766 32.00 3.3997e+00 7.5957e+00 1.5842e-02 Fomin:2010ei
+6 12 5.766 32.00 3.3297e+00 6.2864e+00 9.7686e-03 Fomin:2010ei
+6 12 5.766 32.00 3.2623e+00 5.1138e+00 8.9903e-03 Fomin:2010ei
+6 12 5.766 32.00 3.1978e+00 4.0498e+00 7.4569e-03 Fomin:2010ei
+6 12 5.766 32.00 3.1358e+00 3.2086e+00 6.7579e-03 Fomin:2010ei
+6 12 5.766 32.00 3.0760e+00 2.5021e+00 6.0910e-03 Fomin:2010ei
+6 12 5.766 32.00 3.0185e+00 1.9442e+00 5.4966e-03 Fomin:2010ei
+6 12 5.766 32.00 2.9632e+00 1.5173e+00 5.2420e-03 Fomin:2010ei
+6 12 5.766 32.00 2.9097e+00 1.1796e+00 4.3408e-03 Fomin:2010ei
+6 12 5.766 32.00 2.8583e+00 9.3559e-01 5.6746e-03 Fomin:2010ei
+6 12 5.766 32.00 2.8087e+00 7.1512e-01 4.5996e-03 Fomin:2010ei
+6 12 5.766 32.00 2.7606e+00 5.4766e-01 3.9790e-03 Fomin:2010ei
+6 12 5.766 32.00 2.7142e+00 4.1931e-01 3.5497e-03 Fomin:2010ei
+6 12 5.766 32.00 2.6694e+00 3.1130e-01 3.1057e-03 Fomin:2010ei
+6 12 5.766 32.00 2.6259e+00 2.3243e-01 2.7380e-03 Fomin:2010ei
+6 12 5.766 32.00 2.5840e+00 1.6911e-01 2.3772e-03 Fomin:2010ei
+6 12 5.766 32.00 2.5433e+00 1.2168e-01 2.0578e-03 Fomin:2010ei
+6 12 5.766 32.00 2.5038e+00 8.2795e-02 1.7283e-03 Fomin:2010ei
+6 12 5.766 32.00 2.4657e+00 6.1852e-02 1.6397e-03 Fomin:2010ei
+6 12 5.766 32.00 2.4286e+00 4.5648e-02 1.0285e-03 Fomin:2010ei
+6 12 5.766 32.00 2.3926e+00 3.0727e-02 8.4659e-04 Fomin:2010ei
+6 12 5.766 32.00 2.3577e+00 2.4401e-02 8.8221e-04 Fomin:2010ei
+6 12 5.766 32.00 2.3238e+00 1.6402e-02 7.0067e-04 Fomin:2010ei
+6 12 5.766 32.00 2.2908e+00 1.2018e-02 6.0544e-04 Fomin:2010ei
+6 12 5.766 32.00 2.2588e+00 9.1216e-03 5.3108e-04 Fomin:2010ei
+6 12 5.766 32.00 2.2277e+00 6.3312e-03 4.5223e-04 Fomin:2010ei
+6 12 5.766 32.00 2.1973e+00 4.3762e-03 3.8090e-04 Fomin:2010ei
+6 12 5.766 32.00 2.1679e+00 3.0851e-03 3.2339e-04 Fomin:2010ei
+6 12 5.766 32.00 2.1392e+00 2.9712e-03 3.2418e-04 Fomin:2010ei
+6 12 5.766 32.00 2.1112e+00 1.7932e-03 2.5354e-04 Fomin:2010ei
+6 12 5.766 32.00 2.0840e+00 1.2317e-03 2.1432e-04 Fomin:2010ei
+6 12 5.766 32.00 2.0574e+00 1.2332e-03 2.1790e-04 Fomin:2010ei
+6 12 5.766 32.00 2.0315e+00 9.6260e-04 1.9633e-04 Fomin:2010ei
+6 12 5.766 32.00 2.0063e+00 1.1095e-03 2.1339e-04 Fomin:2010ei
+6 12 5.766 32.00 1.9817e+00 5.3182e-04 1.5308e-04 Fomin:2010ei
+6 12 5.766 32.00 1.9577e+00 4.2010e-04 1.3933e-04 Fomin:2010ei
+6 12 5.766 32.00 1.9342e+00 2.9955e-04 1.2104e-04 Fomin:2010ei
+6 12 5.766 32.00 1.9114e+00 1.3473e-04 8.9820e-05 Fomin:2010ei
+6 12 5.766 32.00 1.8890e+00 1.0039e-04 8.6938e-05 Fomin:2010ei
+6 12 5.766 32.00 1.8672e+00 1.1880e-04 1.0288e-04 Fomin:2010ei
+6 12 5.766 32.00 1.8250e+00 8.6575e-05 1.2243e-04 Fomin:2010ei
+6 12 5.766 32.00 1.8046e+00 1.1173e-04 1.5800e-04 Fomin:2010ei
+6 12 5.766 40.00 4.7252e+00 1.8260e+01 4.3909e-02 Fomin:2010ei
+6 12 5.766 40.00 4.6372e+00 1.6194e+01 3.0798e-02 Fomin:2010ei
+6 12 5.766 40.00 4.5524e+00 1.3884e+01 2.2183e-02 Fomin:2010ei
+6 12 5.766 40.00 4.4704e+00 1.2019e+01 2.0251e-02 Fomin:2010ei
+6 12 5.766 40.00 4.3916e+00 1.0315e+01 1.9610e-02 Fomin:2010ei
+6 12 5.766 40.00 4.3155e+00 8.5810e+00 1.5507e-02 Fomin:2010ei
+6 12 5.766 40.00 4.2417e+00 7.2354e+00 1.2354e-02 Fomin:2010ei
+6 12 5.766 40.00 4.1707e+00 5.9965e+00 1.1464e-02 Fomin:2010ei
+6 12 5.766 40.00 4.1019e+00 4.9109e+00 9.8557e-03 Fomin:2010ei
+6 12 5.766 40.00 4.0353e+00 3.9983e+00 1.1510e-02 Fomin:2010ei
+6 12 5.766 40.00 3.9709e+00 3.2162e+00 1.0119e-02 Fomin:2010ei
+6 12 5.766 40.00 3.9086e+00 2.5516e+00 9.1648e-03 Fomin:2010ei
+6 12 5.766 40.00 3.8480e+00 2.0073e+00 9.0220e-03 Fomin:2010ei
+6 12 5.766 40.00 3.7894e+00 1.5833e+00 5.1967e-03 Fomin:2010ei
+6 12 5.766 40.00 3.7326e+00 1.2288e+00 4.7028e-03 Fomin:2010ei
+6 12 5.766 40.00 3.6773e+00 9.2892e-01 4.0928e-03 Fomin:2010ei
+6 12 5.766 40.00 3.6238e+00 6.9334e-01 3.6008e-03 Fomin:2010ei
+6 12 5.766 40.00 3.5718e+00 5.1792e-01 3.1561e-03 Fomin:2010ei
+6 12 5.766 40.00 3.5211e+00 3.9158e-01 3.0070e-03 Fomin:2010ei
+6 12 5.766 40.00 3.4720e+00 2.9165e-01 2.0784e-03 Fomin:2010ei
+6 12 5.766 40.00 3.4243e+00 2.1248e-01 2.1085e-03 Fomin:2010ei
+6 12 5.766 40.00 3.3777e+00 1.5682e-01 1.7835e-03 Fomin:2010ei
+6 12 5.766 40.00 3.3324e+00 1.0805e-01 1.5155e-03 Fomin:2010ei
+6 12 5.766 40.00 3.2884e+00 7.7139e-02 1.2926e-03 Fomin:2010ei
+6 12 5.766 40.00 3.2454e+00 5.4870e-02 1.0935e-03 Fomin:2010ei
+6 12 5.766 40.00 3.2037e+00 3.8589e-02 9.3129e-04 Fomin:2010ei
+6 12 5.766 40.00 3.1630e+00 2.6578e-02 8.2739e-04 Fomin:2010ei
+6 12 5.766 40.00 3.1232e+00 1.8786e-02 6.2212e-04 Fomin:2010ei
+6 12 5.766 40.00 3.0845e+00 1.3089e-02 5.2202e-04 Fomin:2010ei
+6 12 5.766 40.00 3.0467e+00 8.3993e-03 5.3678e-04 Fomin:2010ei
+6 12 5.766 40.00 3.0098e+00 5.4747e-03 4.2237e-04 Fomin:2010ei
+6 12 5.766 40.00 2.9738e+00 3.8246e-03 3.5207e-04 Fomin:2010ei
+6 12 5.766 40.00 2.9387e+00 2.2255e-03 2.8168e-04 Fomin:2010ei
+6 12 5.766 40.00 2.9044e+00 2.0132e-03 2.6209e-04 Fomin:2010ei
+6 12 5.766 40.00 2.8709e+00 1.2816e-03 2.2399e-04 Fomin:2010ei
+6 12 5.766 40.00 2.8381e+00 1.0476e-03 1.9443e-04 Fomin:2010ei
+6 12 5.766 40.00 2.8061e+00 5.3516e-04 1.4271e-04 Fomin:2010ei
+6 12 5.766 40.00 2.7748e+00 5.1434e-04 1.4229e-04 Fomin:2010ei
+6 12 5.766 40.00 2.7442e+00 1.7769e-04 1.2206e-04 Fomin:2010ei
+6 12 5.766 40.00 2.7142e+00 1.9849e-04 9.7241e-05 Fomin:2010ei
+6 12 5.766 40.00 2.6849e+00 1.8559e-04 1.0375e-04 Fomin:2010ei
+6 12 5.766 40.00 2.6282e+00 7.7292e-05 1.0931e-04 Fomin:2010ei
+6 12 5.766 50.00 4.9731e+00 8.7143e+00 5.0462e-02 Fomin:2010ei
+6 12 5.766 50.00 4.9089e+00 7.5890e+00 3.7068e-02 Fomin:2010ei
+6 12 5.766 50.00 4.8462e+00 6.3798e+00 2.4008e-02 Fomin:2010ei
+6 12 5.766 50.00 4.7852e+00 5.4278e+00 2.1599e-02 Fomin:2010ei
+6 12 5.766 50.00 4.7257e+00 4.5143e+00 2.0398e-02 Fomin:2010ei
+6 12 5.766 50.00 4.6675e+00 3.6620e+00 1.2016e-02 Fomin:2010ei
+6 12 5.766 50.00 4.6109e+00 2.9873e+00 9.8872e-03 Fomin:2010ei
+6 12 5.766 50.00 4.5556e+00 2.4053e+00 8.9741e-03 Fomin:2010ei
+6 12 5.766 50.00 4.5015e+00 1.9092e+00 7.6442e-03 Fomin:2010ei
+6 12 5.766 50.00 4.4488e+00 1.5157e+00 9.0158e-03 Fomin:2010ei
+6 12 5.766 50.00 4.3973e+00 1.1496e+00 7.9369e-03 Fomin:2010ei
+6 12 5.766 50.00 4.3469e+00 8.9707e-01 7.2348e-03 Fomin:2010ei
+6 12 5.766 50.00 4.2978e+00 6.9312e-01 4.5029e-03 Fomin:2010ei
+6 12 5.766 50.00 4.2497e+00 5.3602e-01 4.0800e-03 Fomin:2010ei
+6 12 5.766 50.00 4.2026e+00 3.9202e-01 3.4965e-03 Fomin:2010ei
+6 12 5.766 50.00 4.1566e+00 2.8107e-01 2.9858e-03 Fomin:2010ei
+6 12 5.766 50.00 4.1117e+00 1.9897e-01 2.5707e-03 Fomin:2010ei
+6 12 5.766 50.00 4.0675e+00 1.5190e-01 1.8075e-03 Fomin:2010ei
+6 12 5.766 50.00 4.0245e+00 1.0740e-01 1.7744e-03 Fomin:2010ei
+6 12 5.766 50.00 3.9823e+00 7.4475e-02 1.3822e-03 Fomin:2010ei
+6 12 5.766 50.00 3.9409e+00 5.2883e-02 1.1419e-03 Fomin:2010ei
+6 12 5.766 50.00 3.9005e+00 3.6467e-02 1.0001e-03 Fomin:2010ei
+6 12 5.766 50.00 3.8609e+00 2.4695e-02 8.6412e-04 Fomin:2010ei
+6 12 5.766 50.00 3.8219e+00 1.5708e-02 6.7622e-04 Fomin:2010ei
+6 12 5.766 50.00 3.7839e+00 1.0189e-02 5.1476e-04 Fomin:2010ei
+6 12 5.766 50.00 3.7466e+00 8.0087e-03 4.3952e-04 Fomin:2010ei
+6 12 5.766 50.00 3.7099e+00 5.0803e-03 4.8478e-04 Fomin:2010ei
+6 12 5.766 50.00 3.6741e+00 4.2622e-03 3.4917e-04 Fomin:2010ei
+6 12 5.766 50.00 3.6389e+00 2.6694e-03 2.7830e-04 Fomin:2010ei
+6 12 5.766 50.00 3.6043e+00 1.7491e-03 2.2768e-04 Fomin:2010ei
+6 12 5.766 50.00 3.5704e+00 8.7977e-04 3.5127e-04 Fomin:2010ei
+6 12 5.766 50.00 3.5372e+00 6.0316e-04 1.3820e-04 Fomin:2010ei
+6 12 5.766 50.00 3.5045e+00 6.1238e-04 1.4032e-04 Fomin:2010ei
+6 12 5.766 50.00 3.4725e+00 3.0087e-04 1.0572e-04 Fomin:2010ei
+6 12 5.766 50.00 3.4410e+00 8.6418e-05 7.4840e-05 Fomin:2010ei
diff --git a/data/Electron/16O.dat b/data/Electron/16O.dat
new file mode 100644
index 0000000..e5e1e35
--- /dev/null
+++ b/data/Electron/16O.dat
@@ -0,0 +1,126 @@
+  8  16  0.7000   32.0    0.0131   1.110e+04  1.414e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.0639   3.926e+04  2.946e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.1132   5.246e+04  3.417e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.1632   2.230e+04  2.356e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.2127   1.511e+04  1.885e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.2634   1.275e+04  1.767e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.3127   1.593e+04  2.121e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.3617   1.605e+04  2.238e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.4136   1.723e+04  2.356e+03  Anghinolfi:1996vm 
+  8  16  0.7000   32.0    0.4609   1.511e+04  2.710e+03  Anghinolfi:1996vm 
+  8  16    0.737   37.10  0.005 1.145274e+03 5.437932e+01 O'Connell:1987ag
+  8  16    0.737   37.10  0.015 2.072565e+03 9.286002e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.025 4.294244e+03 1.720724e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.045 1.069533e+04 6.362957e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.055 1.362179e+04 7.386101e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.065 1.566595e+04 8.562046e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.085 2.359134e+04 4.783858e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.095 2.620867e+04 5.286609e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.105 2.736528e+04 4.896991e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.115 2.676651e+04 1.077763e+03 O'Connell:1987ag
+  8  16    0.737   37.10  0.125 2.750357e+04 6.717801e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.135 2.864351e+04 8.384742e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.145 2.334026e+04 7.864340e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.165 2.054571e+04 6.587918e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.175 1.620420e+04 4.157587e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.195 1.189352e+04 6.028586e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.205 9.845611e+03 5.369455e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.215 9.780346e+03 5.247376e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.225 9.684979e+03 5.524420e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.235 9.465869e+03 5.286224e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.245 7.550561e+03 5.051374e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.255 8.699222e+03 4.518011e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.265 9.082392e+03 4.542263e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.275 8.347293e+03 4.661163e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.285 1.053541e+04 5.947030e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.295 9.777702e+03 4.146686e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.305 1.155415e+04 5.196829e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.315 1.090209e+04 5.096803e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.325 1.054513e+04 5.257814e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.335 1.156878e+04 5.789788e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.345 1.160804e+04 4.127202e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.365 1.277601e+04 5.222418e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.375 1.211411e+04 7.427255e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.385 1.209115e+04 5.704618e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.405 1.169767e+04 4.996077e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.415 1.184870e+04 5.668907e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.425 1.087115e+04 5.057672e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.435 1.125201e+04 8.026966e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.445 1.056200e+04 5.826770e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.455 1.064251e+04 8.006067e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.465 1.028915e+04 4.160326e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.475 9.250337e+03 6.439489e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.485 8.978261e+03 8.670644e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.495 7.948388e+03 4.155895e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.505 8.269516e+03 5.469043e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.515 8.277872e+03 5.741224e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.525 8.099373e+03 6.452941e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.545 8.073712e+03 8.653318e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.565 4.407392e+03 9.898168e+02 O'Connell:1987ag
+  8  16    0.737   37.10  0.595 6.908552e+03 2.205562e+03 O'Connell:1987ag
+  8  16    0.737   37.10  0.605 7.510988e+03 1.602130e+03 O'Connell:1987ag
+  8  16    0.737   37.10  0.615 7.673268e+03 1.399119e+03 O'Connell:1987ag
+  8  16    0.737   37.10  0.625 5.116644e+03 2.015953e+03 O'Connell:1987ag
+  8  16  0.8800   32.0    0.0129   2.568e+03  2.177e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.0616   1.345e+04  1.837e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.1121   2.692e+04  1.633e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.1622   2.522e+04  1.224e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.2121   1.372e+04  1.292e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.2625   1.094e+04  1.088e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.3121   1.080e+04  9.523e+02  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.3615   1.236e+04  1.088e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.4116   1.345e+04  1.156e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.4624   9.099e+03  1.156e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.5100   8.350e+03  1.088e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.5616   6.105e+03  1.020e+03  Anghinolfi:1996vm 
+  8  16  0.8800   32.0    0.6121   5.289e+03  1.224e+03  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.0644   2.464e+03  4.361e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.1108   7.464e+03  6.395e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.1618   1.310e+04  8.721e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.2136   1.331e+04  8.721e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.2617   8.801e+03  6.686e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.3137   6.359e+03  6.686e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.3622   8.103e+03  6.977e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.4097   9.498e+03  7.558e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.4606   7.725e+03  7.558e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.5117   7.725e+03  6.977e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.5611   6.853e+03  6.977e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.6104   5.458e+03  6.105e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.6593   4.673e+03  6.686e+02  Anghinolfi:1996vm 
+  8  16  1.0800   32.0    0.7380   4.702e+03  7.267e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.0371   1.401e+02  1.353e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.0880   1.551e+03  2.512e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.1385   4.372e+03  4.251e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.1887   8.546e+03  5.604e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.2394   8.121e+03  5.990e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.2883   7.039e+03  5.024e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.3381   5.589e+03  5.024e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.3885   5.396e+03  4.831e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.4357   5.570e+03  5.024e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.4885   7.676e+03  5.604e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.5395   5.377e+03  5.217e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.5902   4.758e+03  4.638e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.6383   5.280e+03  5.024e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.6857   4.527e+03  4.831e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.7389   4.121e+03  4.058e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.7867   3.947e+03  4.251e+02  Anghinolfi:1996vm 
+  8  16  1.2000   32.0    0.8428   4.681e+03  4.831e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.1380   2.873e+02  6.094e+01  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.1859   1.280e+03  1.219e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.2356   2.203e+03  1.567e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.2850   3.187e+03  2.002e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.3365   2.734e+03  1.828e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.3871   2.804e+03  1.828e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.4360   2.307e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.4847   2.508e+03  1.567e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.5356   2.429e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.5856   2.481e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.6344   2.455e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.6850   2.063e+03  1.480e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.7373   2.264e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.7879   2.098e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.8399   2.098e+03  1.567e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.8863   2.368e+03  1.480e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.9376   2.298e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    0.9901   2.516e+03  1.654e+02  Anghinolfi:1996vm 
+  8  16  1.5000   32.0    1.0362   2.577e+03  1.741e+02  Anghinolfi:1996vm 
diff --git a/data/Electron/all12Csamples.xml b/data/Electron/all12Csamples.xml
new file mode 100644
index 0000000..d1d46d5
--- /dev/null
+++ b/data/Electron/all12Csamples.xml
@@ -0,0 +1,66 @@
+<sample name="ElectronData_6_12_0.160_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.161_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.200_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.200_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.240_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.240_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.280_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.320_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.320_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.361_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.400_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.401_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.440_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.480_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.480_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.500_60.000_Whitney:1974hr" input="gntpfile" />
+<sample name="ElectronData_6_12_0.519_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.560_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.560_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.560_145.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.620_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.620_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.680_36.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.680_60.000_Barreau:1983ht" input="gntpfile" />
+<sample name="ElectronData_6_12_0.730_37.100_O'Connell:1987ag" input="gntpfile" />
+<sample name="ElectronData_6_12_0.961_37.500_Sealock:1989nx" input="gntpfile" />
+<sample name="ElectronData_6_12_1.108_37.500_Sealock:1989nx" input="gntpfile" />
+<sample name="ElectronData_6_12_1.299_37.500_Sealock:1989nx" input="gntpfile" />
+<sample name="ElectronData_6_12_1.300_11.950_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.300_13.540_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.500_11.950_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.500_13.540_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.501_37.500_Sealock:1989nx" input="gntpfile" />
+<sample name="ElectronData_6_12_1.650_11.950_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.650_13.540_Baran:1988tw" input="gntpfile" />
+<sample name="ElectronData_6_12_1.930_16.000_Bagdasaryan:1988hp" input="gntpfile" />
+<sample name="ElectronData_6_12_1.930_18.000_Bagdasaryan:1988hp" input="gntpfile" />
+<sample name="ElectronData_6_12_2.000_15.000_Zeller:1973ge" input="gntpfile" />
+<sample name="ElectronData_6_12_2.015_35.510_Arrington:1995hs" input="gntpfile" />
+<sample name="ElectronData_6_12_2.020_15.022_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_2.020_20.016_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_2.130_16.000_Bagdasaryan:1988hp" input="gntpfile" />
+<sample name="ElectronData_6_12_2.130_18.000_Bagdasaryan:1988hp" input="gntpfile" />
+<sample name="ElectronData_6_12_2.500_15.000_Zeller:1973ge" input="gntpfile" />
+<sample name="ElectronData_6_12_2.700_15.000_Zeller:1973ge" input="gntpfile" />
+<sample name="ElectronData_6_12_3.188_47.680_Arrington:1995hs" input="gntpfile" />
+<sample name="ElectronData_6_12_3.595_16.020_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_3.595_20.016_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_3.595_25.012_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_3.595_30.010_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_3.605_16.020_Day:1993md" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_15.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_23.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_30.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_37.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_45.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_55.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.045_74.000_Arrington:1998ps" input="gntpfile" />
+<sample name="ElectronData_6_12_4.212_53.389_Arrington:1995hs" input="gntpfile" />
+<sample name="ElectronData_6_12_5.120_56.639_Arrington:1995hs" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_18.00_Fomin:2010ei" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_22.00_Fomin:2010ei" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_26.00_Fomin:2010ei" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_32.00_Fomin:2010ei" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_40.00_Fomin:2010ei" input="gntpfile" />
+<sample name="ElectronData_6_12_5.766_50.00_Fomin:2010ei" input="gntpfile" />
diff --git a/data/Electron/listdatasets.py b/data/Electron/listdatasets.py
new file mode 100644
index 0000000..33647d5
--- /dev/null
+++ b/data/Electron/listdatasets.py
@@ -0,0 +1,20 @@
+import sys
+
+uniquelist = []
+for line in (open(sys.argv[1])):
+
+    entries = line.strip().split()
+    z = entries[0]
+    a = entries[1]
+    e = entries[2]
+    t = entries[3]
+    s = entries[7]
+
+
+    uid = "ElectronData_" + z + "_" + a + "_" + e + "_" + t + "_" + s
+    if (uid not in uniquelist):
+        uniquelist.append(uid)
+        print sys.argv[2] + uid + sys.argv[3]
+
+
+
diff --git a/data/Electron/tableformat.txt b/data/Electron/tableformat.txt
new file mode 100644
index 0000000..823a9e9
--- /dev/null
+++ b/data/Electron/tableformat.txt
@@ -0,0 +1,4 @@
+Z A Energy Theta Q0 XSec Error Source
+
+
+http://faculty.virginia.edu/qes-archive/
diff --git a/data/FNAL/CC1ppim_on_p/FNAL_CC1ppim_on_p_Enu.csv b/data/FNAL/CC1ppim_on_p/FNAL_CC1ppim_on_p_Enu.csv
new file mode 100644
index 0000000..f1c15f1
--- /dev/null
+++ b/data/FNAL/CC1ppim_on_p/FNAL_CC1ppim_on_p_Enu.csv
@@ -0,0 +1,5 @@
+5   3.35E-39    5.9E-40
+10  2.15E-39    4.4E-40
+15  2.47E-39    3.9E-40
+25  3.01E-39    5.4E-40
+70  0   0
\ No newline at end of file
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_C_covar.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_C_covar.txt
new file mode 100644
index 0000000..558bcf2
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_C_covar.txt
@@ -0,0 +1,5 @@
+1    0.78    0.66    0.57    0.4
+0.78    1    0.93    0.82    0.62
+0.66    0.93    1    0.92    0.75
+0.57    0.82    0.92    1    0.86
+0.4    0.62    0.75    0.86    1
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_C_data.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_C_data.txt
new file mode 100644
index 0000000..6bd8d84
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_C_data.txt
@@ -0,0 +1,6 @@
+0.15    0.938    0.25035375
+0.375    0.94    0.136014705
+0.507    1.32    0.187305205
+0.741    0.789    0.182362277
+1.1    0.659    0.316900615
+1.5    0    0
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_covar.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_covar.txt
new file mode 100644
index 0000000..4b25f09
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_covar.txt
@@ -0,0 +1,5 @@
+1    0.53    0.43    0.34    0.14
+0.53    1    0.52    0.44    0.24
+0.43    0.52    1    0.5    0.35
+0.34    0.44    0.5    1    0.4
+0.14    0.24    0.35    0.4    1
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_data.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_data.txt
new file mode 100644
index 0000000..2d4052b
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_Fe_data.txt
@@ -0,0 +1,6 @@
+0.15    1.559    0.190234066
+0.375    1.212    0.119253889
+0.507    0.932    0.099824847
+0.741    0.945    0.119519873
+1.1    0.645    0.180277564
+1.5    0    0
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_covar.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_covar.txt
new file mode 100644
index 0000000..ac63460
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_covar.txt
@@ -0,0 +1,5 @@
+1    0.61    0.43    0.22    0.03
+0.61    1    0.54    0.35    0.14
+0.43    0.54    1    0.57    0.38
+0.22    0.35    0.57    1    0.48
+0.03    0.14    0.38    0.48    1
diff --git a/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_data.txt b/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_data.txt
new file mode 100644
index 0000000..1d285c5
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_TgtRatio_Pb_data.txt
@@ -0,0 +1,6 @@
+0.15    1.454    0.24328173
+0.375    1.082    0.129274901
+0.507    0.758    0.109201648
+0.741    0.742    0.13480727
+1.1    0.626451    0.1747559
+1.5    0    0
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_C_covar.txt b/data/MINERvA/CC0pi/Q2_Tgt_C_covar.txt
new file mode 100644
index 0000000..09ae717
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_C_covar.txt
@@ -0,0 +1,5 @@
+1    0.2    0.21    0.14    0.09
+0.2    1    0.46    0.38    0.23
+0.21    0.46    1    0.41    0.27
+0.14    0.38    0.41    1    0.36
+0.09    0.23    0.27    0.36    1
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_C_data.txt b/data/MINERvA/CC0pi/Q2_Tgt_C_data.txt
new file mode 100644
index 0000000..87f5f47
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_C_data.txt
@@ -0,0 +1,6 @@
+0.15    6.82E-39    1.9774E-39
+0.375    5.3E-39    1.03247E-39
+0.507    5.17E-39    9.47629E-40
+0.741    1.71E-39    5.02494E-40
+1.1    6.5E-40    3.55719E-40
+1.5    0    0
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_Fe_covar.txt b/data/MINERvA/CC0pi/Q2_Tgt_Fe_covar.txt
new file mode 100644
index 0000000..6e30a77
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_Fe_covar.txt
@@ -0,0 +1,5 @@
+1    0.78    0.65    0.46    0.3
+0.78    1    0.8    0.62    0.43
+0.65    0.8    1    0.77    0.6
+0.46    0.62    0.77    1    0.74
+0.3    0.43    0.6    0.74    1
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_Fe_data.txt b/data/MINERvA/CC0pi/Q2_Tgt_Fe_data.txt
new file mode 100644
index 0000000..45f92b0
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_Fe_data.txt
@@ -0,0 +1,6 @@
+0.15    1.133E-38    1.76664E-39
+0.375    6.85E-39    1.41736E-39
+0.507    3.64E-39    7.05762E-40
+0.741    2.05E-39    4.531E-40
+1.1    6.3E-40    2.55539E-40
+1.5    0    0
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_Pb_covar.txt b/data/MINERvA/CC0pi/Q2_Tgt_Pb_covar.txt
new file mode 100644
index 0000000..4b25f09
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_Pb_covar.txt
@@ -0,0 +1,5 @@
+1    0.53    0.43    0.34    0.14
+0.53    1    0.52    0.44    0.24
+0.43    0.52    1    0.5    0.35
+0.34    0.44    0.5    1    0.4
+0.14    0.24    0.35    0.4    1
diff --git a/data/MINERvA/CC0pi/Q2_Tgt_Pb_data.txt b/data/MINERvA/CC0pi/Q2_Tgt_Pb_data.txt
new file mode 100644
index 0000000..23ce4db
--- /dev/null
+++ b/data/MINERvA/CC0pi/Q2_Tgt_Pb_data.txt
@@ -0,0 +1,6 @@
+0.15    1.057E-38    2.04824E-39
+0.375    6.12E-39    1.19541E-39
+0.507    2.96E-39    6.5E-40
+0.741    1.61E-39    4.07185E-40
+1.1    6.1E-40    2.33238E-40
+1.5    0    0
diff --git a/data/MiniBooNE/anti-ccqe/asqq_bkg_ccpim.txt~ b/data/MiniBooNE/anti-ccqe/asqq_bkg_ccpim.txt~
deleted file mode 100755
index f765fb9..0000000
--- a/data/MiniBooNE/anti-ccqe/asqq_bkg_ccpim.txt~
+++ /dev/null
@@ -1,36 +0,0 @@
-0.00  3.425e-39
-0.05  2.353e-39
-0.10  1.473e-39
-0.15  9.852e-40
-0.20  6.747e-40
-0.25  4.559e-40
-0.30  3.169e-40
-2.202e-40
-1.563e-40
-1.120e-40
-6.994e-41
-3.758e-41
-2.095e-41
-7.650e-42
-7.006e-43
-1.682e-44
-1.401e-45
-
-0.00
-0.05
-0.10
-0.15
-0.20
-0.25
-0.30
-0.35
-0.40
-0.45
-0.50
-0.60
-0.70
-0.80
-1.00
-1.20
-1.50
-2.00
diff --git a/data/MiniBooNE/anti-ccqe/asqq_bkg_ccqe.txt~ b/data/MiniBooNE/anti-ccqe/asqq_bkg_ccqe.txt~
deleted file mode 100755
index 85593c0..0000000
--- a/data/MiniBooNE/anti-ccqe/asqq_bkg_ccqe.txt~
+++ /dev/null
@@ -1,17 +0,0 @@
-4.400e-39
-3.023e-39
-1.920e-39
-1.297e-39
-8.972e-40
-6.183e-40
-4.397e-40
-3.126e-40
-2.260e-40
-1.661e-40
-1.081e-40
-6.207e-41
-3.882e-41
-2.119e-41
-9.146e-42
-2.368e-42
-1.037e-43
diff --git a/data/MiniBooNE/ccqe/asqq_bkg.txt~ b/data/MiniBooNE/ccqe/asqq_bkg.txt~
deleted file mode 100755
index ba586ff..0000000
--- a/data/MiniBooNE/ccqe/asqq_bkg.txt~
+++ /dev/null
@@ -1,18 +0,0 @@
-0	3.876E-39 0.0
-0.05	3.961E-39 0.0
-0.1	3.671E-39 0.0
-0.15	3.064E-39 0.0
-0.2	2.522E-39 0.0
-0.25    2.040E-39 0.0
-0.3	1.633E-39 0.0
-0.35	1.290E-39 0.0
-0.4	1.018E-39 0.0
-0.45	7.874E-40 0.0
-0.5	5.524E-40 0.0
-0.6	3.532E-40 0.0
-0.7	2.302E-40 0.0
-0.8	1.339E-40 0.0
-1.0	6.398E-41 0.0
-1.2	2.466E-41 0.0
-1.5	3.645E-42 0.0
-2.0	0.0 0.0
diff --git a/data/MiniBooNE/ccqe/asqq_con.txt.~1.1.~ b/data/MiniBooNE/ccqe/asqq_con.txt.~1.1.~
deleted file mode 100755
index d48b5f1..0000000
--- a/data/MiniBooNE/ccqe/asqq_con.txt.~1.1.~
+++ /dev/null
@@ -1,18 +0,0 @@
-0	7.681E-39	1.493E-39
-0.05	1.457E-38	1.18E-39
-0.1	1.684E-38	9.72E-40
-0.15	1.703E-38	8.216E-40
-0.2	1.589E-38	5.134E-40
-0.25	1.449E-38	3.983E-40
-0.3	1.329E-38	3.386E-40
-0.35	1.172E-38	2.629E-40
-0.4	1.03E-38	2.457E-40
-0.45	8.852E-39	2.975E-40
-0.5	7.164E-39	3.193E-40
-0.6	5.425E-39	3.212E-40
-0.7	4.032E-39	3.442E-40
-0.8	2.713E-39	2.885E-40
-1	1.62E-39	2.25E-40
-1.2	9.915E-40	1.407E-40
-1.5	5.474E-40	2.504E-40
-2	0		0
diff --git a/data/MiniBooNE/ccqe/asqq_cont_minbin.txt~ b/data/MiniBooNE/ccqe/asqq_cont_minbin.txt~
deleted file mode 100755
index fb27968..0000000
--- a/data/MiniBooNE/ccqe/asqq_cont_minbin.txt~
+++ /dev/null
@@ -1,20 +0,0 @@
-0	7.681E-39	1.493E-39
-0.05	1.457E-38	1.18E-39
-0.1	1.684E-38	9.72E-40
-0.15	1.703E-38	8.216E-40
-0.2	1.589E-38	5.134E-40
-0.25	1.449E-38	3.983E-40
-0.3	1.329E-38	3.386E-40
-0.35	1.172E-38	2.629E-40
-0.4	1.03E-38	2.457E-40
-0.45	8.852E-39	2.975E-40
-0.5	7.164E-39	3.193E-40
-0.6	5.425E-39	3.212E-40
-0.7	4.032E-39	3.442E-40
-0.8	2.713E-39	2.885E-40
-1	1.62E-39	2.25E-40
-1.2	9.915E-40	1.407E-40
-1.5	5.474E-40	2.504E-40
-2	0		0
-
-
diff --git a/data/MiniBooNE/ccqe/asqq_like.txt.~1.1.~ b/data/MiniBooNE/ccqe/asqq_like.txt.~1.1.~
deleted file mode 100755
index 6e2d649..0000000
--- a/data/MiniBooNE/ccqe/asqq_like.txt.~1.1.~
+++ /dev/null
@@ -1,18 +0,0 @@
-0	1.1557E-38	1.493E-39
-0.05	1.8531E-38	1.18E-39
-0.1	2.0511E-38	9.72E-40
-0.15	2.0094E-38	8.216E-40
-0.2	1.8412E-38	5.134E-40
-0.25	1.653E-38	3.983E-40
-0.3	1.4923E-38	3.386E-40
-0.35	1.301E-38	2.629E-40
-0.4	1.1318E-38	2.457E-40
-0.45	9.6394E-39	2.975E-40
-0.5	7.7164E-39	3.193E-40
-0.6	5.7782E-39	3.212E-40
-0.7	4.2622E-39	3.442E-40
-0.8	2.8469E-39	2.885E-40
-1	1.68398E-39	2.25E-40
-1.2	1.01616E-39	1.407E-40
-1.5	5.51045E-40	2.504E-40
-2	0		0
diff --git a/data/MiniBooNE/ncqe/Enriched-P.txt b/data/MiniBooNE/ncqe/Enriched-P.txt
new file mode 100644
index 0000000..6ee25b1
--- /dev/null
+++ b/data/MiniBooNE/ncqe/Enriched-P.txt
@@ -0,0 +1,2 @@
+4.600000e+02      4.570000e+02      4.390000e+02      4.310000e+02      3.800000e+02      3.830000e+02      3.530000e+02      3.630000e+02      3.710000e+02      3.960000e+02      2.750000e+02      2.760000e+02      2.220000e+02      2.030000e+02      2.170000e+02      2.240000e+02      2.000000e+02      1.840000e+02      1.970000e+02      1.590000e+02      1.550000e+02      1.620000e+02      1.370000e+02      1.520000e+02      1.260000e+02      1.180000e+02      1.330000e+02      1.170000e+02      1.380000e+02      1.230000e+02    
+6.544238e+01      6.131658e+01      6.802268e+01      6.614949e+01      5.759906e+01      5.948360e+01      6.494799e+01      7.288111e+01      7.266334e+01      8.067760e+01      7.378685e+01      7.559236e+01      6.692164e+01      5.954329e+01      5.842109e+01      6.112299e+01      5.521307e+01      5.631305e+01      5.625658e+01      5.765196e+01      6.470708e+01      6.157652e+01      6.896612e+01      5.997896e+01      7.765791e+01      6.953401e+01      7.666214e+01      8.304232e+01      9.066559e+01      1.028902e+02    
diff --git a/data/MiniBooNE/ncqe/bg1 b/data/MiniBooNE/ncqe/bg1
new file mode 100755
index 0000000..305f84f
--- /dev/null
+++ b/data/MiniBooNE/ncqe/bg1
@@ -0,0 +1,230 @@
+****************************************************************************************************
+This file includes true energy spectra and migration matrices for the high energy neutral current elastic sample proton (the numerator of the ratio)
+with reconstructed energy from 350 to 800 MeV
+****************************************************************************************************
+
+Table 1. True nucleon kinetic energy spectra before any cuts for different possible signal events.
+Histograms have 30 bins from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+Event type             |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Hydrogen proton        |  3.188536e+04      9.420812e+02      8.211805e+02      7.449399e+02      6.663803e+02      5.860610e+02      5.338985e+02      4.707225e+02      4.162125e+02      3.756495e+02      3.456960e+02      3.169470e+02      2.793783e+02      2.359252e+02      2.196198e+02      2.077616e+02      1.857598e+02      1.623421e+02      1.444003e+02      1.353946e+02      1.197283e+02      1.074268e+02      1.000333e+02      8.884372e+01      7.125678e+01      6.624471e+01      6.212611e+01      5.807496e+01      5.198500e+01      4.785472e+02    
+Carbon single proton   |  5.080104e+04      2.087732e+03      1.874588e+03      1.657564e+03      1.534215e+03      1.340224e+03      1.211969e+03      1.098258e+03      9.719964e+02      8.773145e+02      7.931381e+02      6.931583e+02      6.018091e+02      5.343221e+02      5.017179e+02      4.361089e+02      3.916575e+02      3.482537e+02      3.197408e+02      2.786784e+02      2.440201e+02      2.195820e+02      2.039021e+02      1.822205e+02      1.512134e+02      1.347763e+02      1.311109e+02      1.110404e+02      9.281456e+01      8.753286e+02    
+Carbon multiple proton |  1.673036e+04      7.758530e+02      7.200034e+02      6.677593e+02      5.818390e+02      5.377895e+02      4.927456e+02      4.718807e+02      4.141463e+02      3.786763e+02      3.533113e+02      3.347661e+02      2.952560e+02      2.780787e+02      2.589538e+02      2.292548e+02      2.176995e+02      1.968736e+02      1.803501e+02      1.693463e+02      1.615091e+02      1.464714e+02      1.372290e+02      1.301426e+02      1.199919e+02      1.133943e+02      1.051643e+02      9.543548e+01      9.260163e+01      1.635561e+03    
+Carbon neutron         |  8.352705e+04      3.356220e+03      3.035614e+03      2.745269e+03      2.469666e+03      2.254650e+03      1.999142e+03      1.824208e+03      1.614933e+03      1.468617e+03      1.328453e+03      1.188461e+03      1.053541e+03      9.434184e+02      8.665288e+02      7.738669e+02      6.971123e+02      6.482311e+02      5.639403e+02      5.276820e+02      4.747883e+02      4.112441e+02      3.717055e+02      3.435565e+02      3.223633e+02      2.878553e+02      2.548855e+02      2.412311e+02      2.182912e+02      2.746875e+03    
+Irreducible            |  1.732324e+03      9.586310e+02      1.204981e+03      1.401849e+03      1.506458e+03      1.575400e+03      1.598755e+03      1.582631e+03      1.543206e+03      1.495070e+03      1.431306e+03      1.300136e+03      1.235545e+03      1.206913e+03      1.109478e+03      1.036218e+03      9.363481e+02      8.711620e+02      8.197590e+02      7.586432e+02      7.026148e+02      6.515580e+02      5.948090e+02      5.515873e+02      5.110844e+02      4.731385e+02      4.315596e+02      4.156273e+02      3.654221e+02      4.277227e+03    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 2. Reconstructed nucleon kinetic energy spectra for the data and the MC background prediction.
+The histogram has 30 bins from 350.0 MeV to 800.0 MeV.
+====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)| 350.0<Trec<365.0  365.0<Trec<380.0  380.0<Trec<395.0  395.0<Trec<410.0  410.0<Trec<425.0  425.0<Trec<440.0  440.0<Trec<455.0  455.0<Trec<470.0  470.0<Trec<485.0  485.0<Trec<500.0  500.0<Trec<515.0  515.0<Trec<530.0  530.0<Trec<545.0  545.0<Trec<560.0  560.0<Trec<575.0  575.0<Trec<590.0  590.0<Trec<605.0  605.0<Trec<620.0  620.0<Trec<635.0  635.0<Trec<650.0  650.0<Trec<665.0  665.0<Trec<680.0  680.0<Trec<695.0  695.0<Trec<710.0  710.0<Trec<725.0  725.0<Trec<740.0  740.0<Trec<755.0  755.0<Trec<770.0  770.0<Trec<785.0  785.0<Trec<800.0 
+Event type             |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+Data                   |  4.600000e+02      4.570000e+02      4.390000e+02      4.310000e+02      3.800000e+02      3.830000e+02      3.530000e+02      3.630000e+02      3.710000e+02      3.960000e+02      2.750000e+02      2.760000e+02      2.220000e+02      2.030000e+02      2.170000e+02      2.240000e+02      2.000000e+02      1.840000e+02      1.970000e+02      1.590000e+02      1.550000e+02      1.620000e+02      1.370000e+02      1.520000e+02      1.260000e+02      1.180000e+02      1.330000e+02      1.170000e+02      1.380000e+02      1.230000e+02    
+Backgrounds            |  6.544238e+01      6.131658e+01      6.802268e+01      6.614949e+01      5.759906e+01      5.948360e+01      6.494799e+01      7.288111e+01      7.266334e+01      8.067760e+01      7.378685e+01      7.559236e+01      6.692164e+01      5.954329e+01      5.842109e+01      6.112299e+01      5.521307e+01      5.631305e+01      5.625658e+01      5.765196e+01      6.470708e+01      6.157652e+01      6.896612e+01      5.997896e+01      7.765791e+01      6.953401e+01      7.666214e+01      8.304232e+01      9.066559e+01      1.028902e+02    
+====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 3. Migration matrix (Ttrue vs Trec) for the neutral current elastic on hydrogen protons.
+The 2-dimensional histogram (true vs reconstructed energy) with 30 x 30 bins for the events that pass the cuts.
+True energy is from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin; reconstructed energy from 350.0 MeV to 800.0 MeV.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+energy range(MeV)      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+350.0<Trec<365.0       |  3.143109e-01      7.857774e-01      1.571555e+00      6.129064e+00      2.047963e+01      2.520700e+01      1.716288e+01      8.172085e+00      6.286219e+00      2.043021e+00      1.257244e+00      4.714664e-01      4.714664e-01      3.143109e-01      7.857774e-01      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+365.0<Trec<380.0       |  1.744198e-01      3.143109e-01      6.286219e-01      2.985954e+00      1.367253e+01      2.671643e+01      2.404479e+01      1.401282e+01      8.486396e+00      4.243198e+00      2.985954e+00      9.429328e-01      1.100088e+00      6.286219e-01      4.714664e-01      0.000000e+00      4.714664e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+380.0<Trec<395.0       |  0.000000e+00      0.000000e+00      3.143109e-01      7.857774e-01      6.914841e+00      1.917297e+01      2.504022e+01      1.795277e+01      1.040909e+01      4.086042e+00      3.961867e+00      2.357332e+00      1.571555e+00      1.571555e+00      3.143109e-01      3.143109e-01      0.000000e+00      3.143109e-01      1.571555e-01      0.000000e+00      4.714664e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      1.624532e-01    
+395.0<Trec<410.0       |  0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      2.043021e+00      1.386875e+01      2.467341e+01      2.848254e+01      1.398684e+01      8.800707e+00      3.614576e+00      3.300265e+00      9.429328e-01      6.286219e-01      6.286219e-01      4.714664e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+410.0<Trec<425.0       |  0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      9.429328e-01      6.129064e+00      2.124178e+01      2.487771e+01      1.650133e+01      1.398684e+01      6.781117e+00      2.985954e+00      1.414399e+00      1.414399e+00      7.857774e-01      6.286219e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+425.0<Trec<440.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      2.828799e+00      1.084373e+01      2.074452e+01      2.278754e+01      1.576171e+01      9.467960e+00      6.757685e+00      7.857774e-01      1.571555e+00      9.429328e-01      1.100088e+00      1.100088e+00      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+440.0<Trec<455.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.286219e-01      4.400353e+00      1.353161e+01      2.498772e+01      2.074452e+01      1.198999e+01      5.814753e+00      4.557509e+00      1.100088e+00      1.728710e+00      9.429328e-01      1.571555e-01      4.714664e-01      1.571555e-01      3.143109e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.865434e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00    
+455.0<Trec<470.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      2.671643e+00      6.286219e+00      1.873052e+01      2.388763e+01      1.681564e+01      6.757685e+00      5.186131e+00      2.671643e+00      1.885866e+00      9.429328e-01      6.286219e-01      1.571555e-01      7.857774e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01    
+470.0<Trec<485.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      2.828799e+00      8.329240e+00      1.699335e+01      2.231608e+01      1.433351e+01      6.600530e+00      3.457420e+00      2.585913e+00      8.198956e-01      9.429328e-01      4.714664e-01      1.571555e-01      1.571555e-01      4.714664e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+485.0<Trec<500.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      2.514488e+00      1.150095e+01      1.794933e+01      1.775857e+01      8.800707e+00      3.771731e+00      3.614576e+00      2.357332e+00      9.429328e-01      1.571555e-01      4.714664e-01      7.857774e-01      0.000000e+00      3.143109e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+500.0<Trec<515.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.614576e+00      1.194382e+01      1.823004e+01      1.257244e+01      4.086042e+00      2.671643e+00      2.514488e+00      7.857774e-01      9.429328e-01      7.857774e-01      3.143109e-01      4.714664e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01    
+515.0<Trec<530.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      6.286219e-01      4.400353e+00      1.667101e+01      1.524408e+01      5.657597e+00      2.514488e+00      2.043021e+00      9.429328e-01      1.257244e+00      1.100088e+00      7.857774e-01      1.571555e-01      1.100088e+00      4.714664e-01      3.143109e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      1.571555e-01      3.143109e-01    
+530.0<Trec<545.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.414399e+00      7.700618e+00      1.605332e+01      7.229152e+00      3.500324e+00      3.300265e+00      8.155019e-01      9.429328e-01      1.257244e+00      9.429328e-01      3.143109e-01      4.642729e-01      3.143109e-01      3.143109e-01      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01    
+545.0<Trec<560.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.457420e+00      1.058487e+01      1.179867e+01      4.086042e+00      2.200177e+00      6.286219e-01      9.429328e-01      7.857774e-01      6.286219e-01      4.714664e-01      4.714664e-01      3.143109e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+560.0<Trec<575.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.257244e+00      6.286219e+00      1.196658e+01      6.165328e+00      3.928887e+00      2.514488e+00      1.728710e+00      1.257244e+00      1.100088e+00      3.143109e-01      1.571555e-01      4.714664e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00    
+575.0<Trec<590.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      4.086042e+00      9.272173e+00      1.041625e+01      7.407070e+00      3.614576e+00      2.985954e+00      1.571555e+00      6.620604e-01      4.714664e-01      4.714664e-01      3.143109e-01      6.286219e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01    
+590.0<Trec<605.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      1.257244e+00      5.186131e+00      9.429328e+00      7.700618e+00      5.209603e+00      1.728710e+00      2.828799e+00      6.286219e-01      9.429328e-01      3.143109e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      3.143109e-01    
+605.0<Trec<620.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      2.200177e+00      8.014929e+00      8.643551e+00      5.500442e+00      2.985954e+00      2.828799e+00      2.076816e+00      7.857774e-01      1.728710e+00      1.273876e+00      4.714664e-01      7.857774e-01      1.571555e-01      3.143109e-01      3.143109e-01      0.000000e+00      3.143109e-01    
+620.0<Trec<635.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      7.857774e-01      3.457420e+00      1.043518e+01      7.857774e+00      2.985954e+00      1.571555e+00      1.885866e+00      4.714664e-01      1.257244e+00      9.429328e-01      4.714664e-01      4.714664e-01      0.000000e+00      4.714664e-01      3.143109e-01      3.143109e-01      6.286219e-01    
+635.0<Trec<650.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.881355e-01      0.000000e+00      0.000000e+00      3.454780e-01      0.000000e+00      6.286219e-01      3.928887e+00      6.935421e+00      3.143110e+00      2.200177e+00      1.885866e+00      1.100088e+00      6.286219e-01      3.143109e-01      1.571555e-01      6.286219e-01      3.143109e-01      1.571555e-01      0.000000e+00      6.286219e-01      7.857774e-01    
+650.0<Trec<665.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      1.728710e+00      5.500442e+00      5.028975e+00      1.728710e+00      2.671643e+00      2.043021e+00      9.429328e-01      9.429328e-01      7.857774e-01      0.000000e+00      3.143109e-01      0.000000e+00      3.143109e-01      1.571555e-01      3.143109e-01    
+665.0<Trec<680.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.100088e+00      3.928887e+00      6.600530e+00      3.457420e+00      2.514488e+00      1.257244e+00      1.100088e+00      7.857774e-01      3.143109e-01      6.286219e-01      1.571555e-01      3.143109e-01      0.000000e+00      3.143109e-01      7.857774e-01    
+680.0<Trec<695.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e+00      4.086042e+00      3.339723e+00      1.885866e+00      1.728710e+00      1.728710e+00      7.857774e-01      6.286219e-01      6.286219e-01      4.714664e-01      6.286219e-01      3.143109e-01      1.571555e-01      1.257244e+00    
+695.0<Trec<710.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      2.074188e+00      4.714664e+00      3.143110e+00      2.200177e+00      1.414399e+00      9.429328e-01      9.429328e-01      4.714664e-01      4.714664e-01      1.571555e-01      3.143109e-01      1.571555e-01      1.131068e+00    
+710.0<Trec<725.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      1.728710e+00      1.414399e+00      3.143110e+00      1.257244e+00      1.414399e+00      1.100088e+00      3.143109e-01      7.857774e-01      4.714664e-01      4.714664e-01      4.714664e-01      0.000000e+00      3.143109e-01    
+725.0<Trec<740.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      4.714664e-01      1.728710e+00      3.143110e+00      1.885866e+00      1.100088e+00      1.414399e+00      1.257244e+00      6.286219e-01      6.286219e-01      4.714664e-01      0.000000e+00      0.000000e+00      1.100088e+00    
+740.0<Trec<755.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      9.697089e-01      2.514488e+00      2.200177e+00      7.857774e-01      1.257244e+00      1.100088e+00      4.714664e-01      4.714664e-01      1.257244e+00      0.000000e+00      4.714664e-01      1.571555e+00    
+755.0<Trec<770.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e+00      1.571555e+00      2.200177e+00      1.571555e+00      1.257244e+00      1.100088e+00      3.143109e-01      9.429328e-01      6.286219e-01      4.714664e-01      1.571555e+00    
+770.0<Trec<785.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      3.143109e-01      2.043021e+00      1.257244e+00      1.257244e+00      6.286219e-01      6.286219e-01      9.429328e-01      4.714664e-01      1.571555e-01      1.571555e-01      7.857774e-01    
+785.0<Trec<800.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      9.429328e-01      9.429328e-01      1.257244e+00      1.602836e+00      9.429328e-01      1.257244e+00      8.169444e-01      4.714664e-01      1.100088e+00      1.571555e-01      1.571555e+00    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 4. Migration matrix (Ttrue vs Trec) for the neutral current elastic on Carbon protons and with no FSI.
+The 2-dimensional histogram (true vs reconstructed energy) with 30 x 30 bins for the events that pass the cuts.
+True energy is from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin; reconstructed energy from 350.0 MeV to 800.0 MeV.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+energy range(MeV)      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+350.0<Trec<365.0       |  3.143109e-01      2.200177e+00      6.600530e+00      1.665848e+01      4.970035e+01      5.307512e+01      3.837013e+01      1.933012e+01      1.021511e+01      6.443374e+00      5.028975e+00      1.257244e+00      1.728710e+00      9.429328e-01      6.286219e-01      3.143109e-01      3.143109e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+365.0<Trec<380.0       |  1.571555e-01      4.714664e-01      2.671643e+00      1.006854e+01      3.008980e+01      6.546876e+01      5.709493e+01      3.227182e+01      1.619372e+01      9.429328e+00      5.217144e+00      3.143110e+00      1.414399e+00      1.100088e+00      4.714664e-01      1.100088e+00      3.143109e-01      4.714664e-01      0.000000e+00      6.286219e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.386286e-01    
+380.0<Trec<395.0       |  1.571555e-01      1.571555e-01      1.257244e+00      2.985954e+00      1.859709e+01      5.078796e+01      6.319400e+01      4.842062e+01      2.335249e+01      1.417922e+01      8.486396e+00      3.614576e+00      1.728710e+00      1.571555e+00      9.429328e-01      6.286219e-01      6.286219e-01      1.571555e-01      1.571555e-01      4.714664e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+395.0<Trec<410.0       |  0.000000e+00      0.000000e+00      1.571555e-01      7.857774e-01      9.429328e+00      3.004492e+01      6.257623e+01      6.036700e+01      3.322394e+01      1.634417e+01      8.968615e+00      6.286219e+00      3.928887e+00      2.828799e+00      1.100088e+00      7.857774e-01      1.257244e+00      7.857774e-01      3.143109e-01      3.309427e-01      0.000000e+00      3.543093e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00    
+410.0<Trec<425.0       |  0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.457420e+00      1.764595e+01      4.786247e+01      5.726577e+01      4.595065e+01      2.658126e+01      1.492977e+01      6.600530e+00      4.243198e+00      3.485227e+00      1.571555e+00      1.414399e+00      1.100088e+00      6.286219e-01      4.714664e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.930176e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+425.0<Trec<440.0       |  0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.257244e+00      6.286219e+00      2.547524e+01      5.454475e+01      5.783676e+01      3.630291e+01      1.602986e+01      8.513765e+00      3.771731e+00      3.143110e+00      2.357332e+00      1.414399e+00      6.286219e-01      3.143109e-01      3.143109e-01      3.143109e-01      0.000000e+00      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.881355e-01    
+440.0<Trec<455.0       |  0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      4.714664e-01      1.728710e+00      1.137070e+01      4.266699e+01      6.578955e+01      5.032959e+01      2.531915e+01      1.229813e+01      6.443374e+00      4.086042e+00      2.357332e+00      9.429328e-01      9.429328e-01      6.286219e-01      7.857774e-01      0.000000e+00      1.571555e-01      0.000000e+00      4.714664e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01    
+455.0<Trec<470.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.928887e+00      1.948728e+01      4.655684e+01      5.516157e+01      4.010199e+01      2.290297e+01      9.586484e+00      4.400353e+00      3.143110e+00      1.414399e+00      9.429328e-01      9.429328e-01      9.429328e-01      7.857774e-01      3.143109e-01      3.143109e-01      3.143109e-01      6.286219e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+470.0<Trec<485.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      4.400353e+00      2.349082e+01      4.623083e+01      4.827125e+01      2.718790e+01      1.084373e+01      7.543463e+00      4.871819e+00      2.514488e+00      1.749543e+00      1.100088e+00      1.257244e+00      6.286219e-01      1.571555e-01      3.143109e-01      1.571555e-01      7.857774e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00    
+485.0<Trec<500.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.728710e+00      5.186131e+00      2.420194e+01      4.667517e+01      3.775712e+01      1.777244e+01      1.071531e+01      5.500442e+00      4.086042e+00      2.514488e+00      1.414399e+00      9.429328e-01      7.857774e-01      1.100088e+00      1.571555e-01      1.571555e-01      3.143109e-01      0.000000e+00      1.571555e-01      1.386286e-01      1.571555e-01      1.571555e-01      4.714664e-01    
+500.0<Trec<515.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.100088e+00      8.014929e+00      3.237403e+01      4.292722e+01      2.231608e+01      1.304390e+01      6.286219e+00      3.614576e+00      3.143110e+00      2.043021e+00      9.429328e-01      9.429328e-01      1.134139e+00      1.100088e+00      4.714664e-01      3.143109e-01      0.000000e+00      4.714664e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+515.0<Trec<530.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      2.828799e+00      1.194382e+01      3.095963e+01      3.127394e+01      1.461546e+01      8.172085e+00      4.557509e+00      2.671643e+00      1.728710e+00      2.043021e+00      1.571555e+00      1.100088e+00      3.143109e-01      1.571555e-01      9.845653e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01    
+530.0<Trec<545.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      1.571555e-01      3.300265e+00      2.044127e+01      2.817994e+01      1.964443e+01      1.100088e+01      5.073056e+00      3.457420e+00      3.166994e+00      1.414399e+00      1.885866e+00      9.429328e-01      1.257244e+00      4.941424e-01      6.286219e-01      1.571555e-01      1.571555e-01      1.571555e-01      3.143109e-01      0.000000e+00      6.286219e-01    
+545.0<Trec<560.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.100088e+00      6.757685e+00      2.475723e+01      2.676260e+01      1.071737e+01      7.386307e+00      3.614576e+00      2.200177e+00      2.671643e+00      1.257244e+00      4.714664e-01      3.143109e-01      7.857774e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      4.714664e-01    
+560.0<Trec<575.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      2.828799e+00      1.434669e+01      2.687359e+01      1.823004e+01      1.040289e+01      6.993340e+00      2.983570e+00      2.200177e+00      2.043021e+00      4.714664e-01      4.714664e-01      8.133068e-01      6.286219e-01      4.714664e-01      0.000000e+00      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01    
+575.0<Trec<590.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      6.286219e-01      7.386307e+00      2.154482e+01      2.797367e+01      1.241528e+01      8.643551e+00      3.958098e+00      3.018622e+00      1.885866e+00      1.571555e+00      1.100088e+00      1.414399e+00      6.286219e-01      3.143109e-01      3.143109e-01      1.571555e-01      0.000000e+00      3.143109e-01      7.857774e-01    
+590.0<Trec<605.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.885866e+00      1.211341e+01      2.424452e+01      1.461546e+01      1.084373e+01      5.657597e+00      3.614576e+00      2.514488e+00      2.200177e+00      1.414399e+00      1.414399e+00      4.714664e-01      3.143109e-01      3.143109e-01      4.714664e-01      3.143109e-01      1.571555e-01      6.286219e-01    
+605.0<Trec<620.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      9.429328e-01      4.759181e+00      1.791572e+01      2.153030e+01      1.210097e+01      7.857774e+00      3.964424e+00      2.699313e+00      9.692346e-01      1.571555e+00      4.714664e-01      4.714664e-01      6.286219e-01      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      7.857774e-01    
+620.0<Trec<635.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.257244e+00      5.841628e+00      2.013058e+01      1.683620e+01      8.643551e+00      5.186131e+00      3.300265e+00      2.043021e+00      1.571555e+00      2.043021e+00      1.257244e+00      9.429328e-01      3.143109e-01      4.714664e-01      3.143109e-01      3.143109e-01      7.857774e-01    
+635.0<Trec<650.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      4.599476e+00      1.131519e+01      1.461546e+01      9.919061e+00      5.186131e+00      3.300265e+00      2.357332e+00      1.885866e+00      1.571555e+00      1.571555e+00      3.143109e-01      6.286219e-01      6.286219e-01      7.857774e-01      0.000000e+00      7.857774e-01    
+650.0<Trec<665.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      7.857774e-01      6.129064e+00      1.147235e+01      1.293932e+01      6.600530e+00      4.243198e+00      2.985954e+00      1.571555e+00      1.257244e+00      1.257244e+00      9.429328e-01      1.100088e+00      7.857774e-01      3.457198e-01      3.143109e-01      1.100088e+00    
+665.0<Trec<680.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      9.429328e-01      7.229152e+00      1.021511e+01      7.857774e+00      5.186131e+00      4.243198e+00      1.414399e+00      2.828799e+00      7.857774e-01      6.286219e-01      9.429328e-01      9.429328e-01      6.286219e-01      0.000000e+00      1.414399e+00    
+680.0<Trec<695.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.286219e-01      3.300265e+00      7.386307e+00      1.054936e+01      3.614576e+00      4.425785e+00      2.985954e+00      2.317294e+00      1.571555e+00      9.429328e-01      1.414399e+00      9.429328e-01      1.571555e-01      1.571555e-01      3.143109e-01    
+695.0<Trec<710.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      4.714664e-01      3.771731e+00      1.005795e+01      6.805119e+00      3.645743e+00      2.671643e+00      2.200177e+00      1.257244e+00      1.571555e+00      4.714664e-01      6.286219e-01      1.414399e+00      0.000000e+00      2.200177e+00    
+710.0<Trec<725.0       |  0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      1.571555e-01      1.885866e+00      5.814753e+00      5.657597e+00      5.186131e+00      2.373049e+00      2.514488e+00      2.074188e+00      9.429328e-01      1.414399e+00      4.714664e-01      6.286219e-01      9.429328e-01      1.728710e+00    
+725.0<Trec<740.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      0.000000e+00      1.571555e-01      3.168557e+00      5.028975e+00      5.343286e+00      2.985954e+00      2.200177e+00      2.066050e+00      1.414399e+00      6.286219e-01      4.714664e-01      3.143109e-01      3.143109e-01      2.715796e+00    
+740.0<Trec<755.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.100088e+00      2.671643e+00      4.243198e+00      2.671643e+00      2.671643e+00      1.257244e+00      1.100088e+00      1.571555e+00      3.143109e-01      1.571555e-01      4.714664e-01      2.200177e+00    
+755.0<Trec<770.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      2.357332e+00      3.928887e+00      2.828799e+00      2.043021e+00      1.728710e+00      1.100088e+00      1.414399e+00      4.714664e-01      7.857774e-01      3.143109e-01      2.514488e+00    
+770.0<Trec<785.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      4.714664e-01      3.042741e+00      3.300265e+00      2.828799e+00      2.043021e+00      1.100088e+00      7.857774e-01      3.143109e-01      9.731126e-01      4.714664e-01      3.143110e+00    
+785.0<Trec<800.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      1.883225e-01      0.000000e+00      1.883225e-01      1.881355e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      9.740999e-01      1.885866e+00      3.457420e+00      2.671643e+00      3.016934e+00      1.571555e+00      9.429328e-01      1.100088e+00      1.571555e-01      9.429328e-01      2.985954e+00    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 5. Migration matrix (Ttrue vs Trec) for the neutral current elastic on Carbon protons and with FSI.
+The 2-dimensional histogram (true vs reconstructed energy) with 30 x 30 bins for the events that pass the cuts.
+True energy is from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin; reconstructed energy from 350.0 MeV to 800.0 MeV.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+energy range(MeV)      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+350.0<Trec<365.0       |  1.257244e+00      1.571555e-01      1.571555e-01      2.357332e+00      3.143110e+00      4.871819e+00      5.657597e+00      4.579905e+00      4.714664e+00      2.831502e+00      2.200177e+00      1.100088e+00      1.257244e+00      1.414399e+00      3.143109e-01      1.571555e-01      4.714664e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+365.0<Trec<380.0       |  1.571555e-01      3.143109e-01      1.571555e-01      6.286219e-01      1.275339e+00      3.457420e+00      5.028975e+00      5.028975e+00      3.928887e+00      3.928887e+00      2.200177e+00      1.571555e+00      1.571555e+00      6.286219e-01      9.429328e-01      6.316180e-01      6.286219e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+380.0<Trec<395.0       |  3.143109e-01      4.714664e-01      1.571555e-01      4.714664e-01      1.257244e+00      1.728710e+00      4.557509e+00      4.571911e+00      5.814753e+00      4.086042e+00      2.671643e+00      2.200177e+00      1.414399e+00      9.429328e-01      1.100088e+00      7.857774e-01      4.714664e-01      4.714664e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00    
+395.0<Trec<410.0       |  1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      7.857774e-01      1.257244e+00      4.086042e+00      6.443374e+00      3.614576e+00      4.400353e+00      2.357332e+00      2.058969e+00      1.571555e+00      1.100088e+00      9.429328e-01      7.857774e-01      1.571555e-01      4.714664e-01      1.571555e-01      0.000000e+00      6.286219e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+410.0<Trec<425.0       |  6.286219e-01      3.143109e-01      1.571555e-01      1.571555e-01      0.000000e+00      6.286219e-01      2.357332e+00      4.400353e+00      4.400353e+00      3.928887e+00      2.514488e+00      2.828799e+00      2.822311e+00      1.100088e+00      7.857774e-01      1.100088e+00      4.714664e-01      4.714664e-01      1.571555e-01      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      4.714664e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01    
+425.0<Trec<440.0       |  1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.100088e+00      2.828799e+00      5.214816e+00      5.500442e+00      3.771731e+00      2.357332e+00      1.885866e+00      2.357332e+00      9.429328e-01      7.857774e-01      4.714664e-01      9.429328e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      6.286219e-01    
+440.0<Trec<455.0       |  3.143109e-01      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      3.143109e-01      7.857774e-01      2.200177e+00      3.156029e+00      3.771731e+00      3.771731e+00      2.200177e+00      1.728710e+00      1.257244e+00      7.857774e-01      6.286219e-01      7.857774e-01      4.714664e-01      6.286219e-01      6.286219e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01    
+455.0<Trec<470.0       |  3.143109e-01      1.571555e-01      1.752336e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      6.286219e-01      2.357332e+00      2.828799e+00      4.243198e+00      4.557509e+00      3.457420e+00      1.414399e+00      1.100088e+00      1.257244e+00      7.857774e-01      4.714664e-01      4.714664e-01      3.143109e-01      6.286219e-01      3.143109e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      3.143109e-01    
+470.0<Trec<485.0       |  1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      4.714664e-01      1.100088e+00      2.671643e+00      2.530480e+00      3.143110e+00      5.028975e+00      2.218125e+00      2.368330e+00      6.286219e-01      7.857774e-01      9.429328e-01      1.257244e+00      3.143109e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01    
+485.0<Trec<500.0       |  3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      3.143109e-01      6.286219e-01      9.429328e-01      1.571555e+00      3.614576e+00      4.714664e+00      2.828799e+00      2.671643e+00      1.885866e+00      9.429328e-01      9.429328e-01      9.429328e-01      7.857774e-01      4.714664e-01      3.143109e-01      4.714664e-01      3.143109e-01      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01    
+500.0<Trec<515.0       |  1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      0.000000e+00      1.571555e-01      0.000000e+00      4.714664e-01      1.571555e-01      2.200177e+00      2.671643e+00      2.514488e+00      3.143110e+00      1.414399e+00      9.429328e-01      1.728710e+00      3.143109e-01      7.857774e-01      4.714664e-01      4.714664e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      4.714664e-01    
+515.0<Trec<530.0       |  3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      2.200177e+00      2.671643e+00      1.728710e+00      9.429328e-01      1.571555e+00      7.857774e-01      4.714664e-01      3.143109e-01      3.143109e-01      4.714664e-01      3.143109e-01      3.143109e-01      3.143109e-01      0.000000e+00      7.857774e-01      0.000000e+00      1.571555e-01      6.286219e-01    
+530.0<Trec<545.0       |  4.714664e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      1.571555e-01      0.000000e+00      7.857774e-01      1.100088e+00      1.571555e+00      1.257244e+00      7.857774e-01      9.429328e-01      7.857774e-01      1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      1.571555e-01      4.714664e-01      4.714664e-01      3.143109e-01      3.143109e-01      1.571555e-01      1.291708e+00    
+545.0<Trec<560.0       |  0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.143109e-01      1.257244e+00      1.414399e+00      1.100088e+00      1.571555e+00      7.857774e-01      7.857774e-01      9.429328e-01      6.286219e-01      7.857774e-01      3.143109e-01      0.000000e+00      3.143109e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      6.286219e-01    
+560.0<Trec<575.0       |  1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      7.857774e-01      1.257244e+00      1.885866e+00      1.571555e+00      9.429328e-01      6.286219e-01      6.286219e-01      7.857774e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      7.857774e-01    
+575.0<Trec<590.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      6.286219e-01      1.257244e+00      1.728710e+00      9.429328e-01      1.257244e+00      1.100088e+00      5.024465e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      1.571555e-01      4.714664e-01      3.143109e-01      0.000000e+00      1.728710e+00    
+590.0<Trec<605.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      1.571555e-01      3.143109e-01      9.429328e-01      1.414399e+00      1.257244e+00      6.286219e-01      4.714664e-01      7.857774e-01      7.857774e-01      1.100088e+00      4.714664e-01      3.143109e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01      2.357332e+00    
+605.0<Trec<620.0       |  0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      1.571555e-01      1.100088e+00      1.257244e+00      7.857774e-01      1.414399e+00      9.429328e-01      1.571555e-01      1.571555e-01      7.857774e-01      3.143109e-01      3.143109e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.100088e+00    
+620.0<Trec<635.0       |  3.454780e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      3.143109e-01      1.414399e+00      1.571555e+00      7.857774e-01      6.286219e-01      7.857774e-01      6.286219e-01      1.571555e-01      6.286219e-01      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      1.571555e-01      1.571555e+00    
+635.0<Trec<650.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      6.286219e-01      3.143109e-01      1.257244e+00      7.857774e-01      4.714664e-01      6.593191e-01      6.286219e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.917987e+00    
+650.0<Trec<665.0       |  0.000000e+00      0.000000e+00      4.714664e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.143109e-01      1.571555e-01      1.571555e-01      0.000000e+00      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      9.429328e-01      9.429328e-01      9.429328e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01      0.000000e+00      9.429328e-01    
+665.0<Trec<680.0       |  1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      7.457388e-01      1.571555e-01      3.143109e-01      3.143109e-01      1.571555e-01      3.143109e-01      9.429328e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      2.357332e+00    
+680.0<Trec<695.0       |  0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      4.714664e-01      9.429328e-01      1.571555e-01      7.857774e-01      4.714664e-01      7.457388e-01      1.571555e-01      0.000000e+00      0.000000e+00      4.714664e-01      3.143109e-01      1.414399e+00    
+695.0<Trec<710.0       |  3.454780e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      1.571555e-01      0.000000e+00      0.000000e+00      4.714664e-01      6.286219e-01      1.571555e-01      4.714664e-01      4.714664e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      1.768695e+00    
+710.0<Trec<725.0       |  2.742724e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      1.100088e+00      1.060050e+00      3.143109e-01      4.714664e-01      9.429328e-01      3.143109e-01      1.571555e-01      1.571555e-01      3.143109e-01      2.671643e+00    
+725.0<Trec<740.0       |  1.883225e-01      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      6.286219e-01      4.714664e-01      4.714664e-01      3.143109e-01      2.742724e-01      0.000000e+00      4.714664e-01      3.143109e-01      3.143109e-01      2.205474e+00    
+740.0<Trec<755.0       |  1.883225e-01      0.000000e+00      3.766451e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      1.571555e-01      2.742724e-01      3.143109e-01      4.714664e-01      3.143109e-01      0.000000e+00      0.000000e+00      9.429328e-01    
+755.0<Trec<770.0       |  3.764581e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      6.286219e-01      3.143109e-01      1.571555e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.619354e+00    
+770.0<Trec<785.0       |  3.621098e-01      1.883225e-01      0.000000e+00      0.000000e+00      1.881355e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.625950e-01      0.000000e+00      0.000000e+00      2.742724e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      4.714664e-01      0.000000e+00      1.571555e-01      1.571555e-01      3.143109e-01      1.571555e+00    
+785.0<Trec<800.0       |  0.000000e+00      0.000000e+00      3.766451e-01      1.883225e-01      0.000000e+00      4.314279e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      3.143109e-01      3.454780e-01      1.571555e-01      6.286219e-01      3.143109e-01      3.143109e-01      4.714664e-01      1.885866e+00    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 6. Migration matrix (Ttrue vs Trec) for the neutral current elastic on Carbon neutrons.
+The 2-dimensional histogram (true vs reconstructed energy) with 30 x 30 bins for the events that pass the cuts.
+True energy is from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin; reconstructed energy from 350.0 MeV to 800.0 MeV.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+energy range(MeV)      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+350.0<Trec<365.0       |  1.257244e+00      1.414399e+00      2.200177e+00      3.771731e+00      6.286219e+00      1.009395e+01      1.194382e+01      1.100088e+01      8.014929e+00      7.543463e+00      5.028975e+00      5.343286e+00      4.086042e+00      2.205597e+00      2.200177e+00      1.885866e+00      1.453695e+00      1.728710e+00      6.286219e-01      9.429328e-01      7.857774e-01      6.286219e-01      4.714664e-01      0.000000e+00      3.143109e-01      0.000000e+00      1.571555e-01      1.571555e-01      1.571555e-01      3.143109e-01    
+365.0<Trec<380.0       |  7.857774e-01      1.257244e+00      2.061663e+00      3.143110e+00      5.343286e+00      8.852232e+00      9.743639e+00      1.210097e+01      9.115018e+00      9.115018e+00      6.757685e+00      5.044682e+00      3.656028e+00      3.300265e+00      4.114686e+00      2.357332e+00      2.985954e+00      1.100088e+00      1.100088e+00      9.429328e-01      1.257244e+00      6.286219e-01      1.100088e+00      1.571555e-01      4.714664e-01      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01    
+380.0<Trec<395.0       |  6.286219e-01      4.714664e-01      6.286219e-01      1.257244e+00      2.200177e+00      6.443374e+00      8.841150e+00      1.052942e+01      8.329240e+00      6.778656e+00      7.700618e+00      5.971908e+00      4.400353e+00      2.985954e+00      3.300265e+00      2.357332e+00      1.885866e+00      1.257244e+00      3.143109e-01      1.414399e+00      6.286219e-01      6.286219e-01      6.286219e-01      3.143109e-01      4.714664e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.257244e+00    
+395.0<Trec<410.0       |  3.143109e-01      1.571555e-01      4.714664e-01      3.143109e-01      9.429328e-01      1.728710e+00      6.286219e+00      8.184884e+00      7.543463e+00      8.643551e+00      5.971908e+00      6.757685e+00      5.500442e+00      5.186131e+00      3.771731e+00      2.200177e+00      1.257244e+00      2.043021e+00      1.885866e+00      3.143109e-01      7.857774e-01      1.571555e-01      3.143109e-01      1.571555e-01      6.286219e-01      1.571555e-01      1.571555e-01      3.143109e-01      0.000000e+00      9.028943e-01    
+410.0<Trec<425.0       |  1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      1.728710e+00      4.400353e+00      4.400353e+00      7.700618e+00      6.757685e+00      6.914841e+00      5.500442e+00      4.243198e+00      2.828799e+00      2.357332e+00      2.043021e+00      1.728710e+00      7.857774e-01      1.414399e+00      7.857774e-01      7.857774e-01      9.429328e-01      9.429328e-01      1.571555e-01      2.742724e-01      1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01      7.857774e-01    
+425.0<Trec<440.0       |  4.714664e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      4.714664e-01      1.885866e+00      5.028975e+00      5.657597e+00      8.349133e+00      6.443374e+00      5.343286e+00      4.871819e+00      2.828799e+00      2.043021e+00      1.885866e+00      1.885866e+00      1.100088e+00      1.571555e+00      1.728710e+00      1.100088e+00      6.286219e-01      3.143109e-01      6.286219e-01      3.143109e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      9.429328e-01    
+440.0<Trec<455.0       |  1.571555e-01      0.000000e+00      1.571555e-01      0.000000e+00      1.571555e-01      3.143109e-01      1.257244e+00      3.457420e+00      4.945776e+00      6.757685e+00      7.543463e+00      7.857774e+00      4.243198e+00      3.457420e+00      2.881412e+00      3.143110e+00      2.043021e+00      1.728710e+00      7.857774e-01      4.714664e-01      1.571555e-01      4.714664e-01      9.429328e-01      1.571555e-01      7.857774e-01      4.662328e-01      3.143109e-01      1.571555e-01      1.571555e-01      6.286219e-01    
+455.0<Trec<470.0       |  1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.257244e+00      2.671643e+00      6.286219e+00      5.971908e+00      8.014929e+00      5.186131e+00      6.129064e+00      4.400353e+00      2.200177e+00      2.985954e+00      2.514488e+00      9.429328e-01      1.571555e+00      7.857774e-01      4.714664e-01      9.429328e-01      3.143109e-01      3.143109e-01      7.857774e-01      1.571555e-01      6.286219e-01      1.571555e-01      8.167574e-01    
+470.0<Trec<485.0       |  3.143109e-01      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      3.143109e-01      2.200177e+00      3.457420e+00      5.500442e+00      7.117031e+00      5.343286e+00      3.300265e+00      5.500442e+00      3.143110e+00      2.828799e+00      1.885866e+00      2.043021e+00      9.429328e-01      1.571555e+00      9.429328e-01      9.429328e-01      1.100088e+00      6.286219e-01      1.571555e-01      4.714664e-01      3.143109e-01      1.571555e-01      1.414399e+00    
+485.0<Trec<500.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.143109e-01      1.758596e+00      4.243198e+00      5.500442e+00      4.420914e+00      4.589070e+00      3.457420e+00      3.475897e+00      3.300265e+00      2.043021e+00      1.100088e+00      2.514488e+00      1.100088e+00      1.414399e+00      8.009896e-01      3.143109e-01      6.286219e-01      7.857774e-01      4.714664e-01      3.143109e-01      3.143109e-01      6.286219e-01    
+500.0<Trec<515.0       |  0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      0.000000e+00      1.571555e-01      4.714664e-01      1.571555e-01      1.919550e+00      2.985954e+00      5.657597e+00      3.143110e+00      2.828799e+00      3.143110e+00      2.514488e+00      3.614576e+00      1.257244e+00      1.571555e+00      1.885866e+00      1.414399e+00      4.714664e-01      1.257244e+00      6.286219e-01      1.100088e+00      6.286219e-01      1.571555e-01      4.714664e-01      1.885866e+00    
+515.0<Trec<530.0       |  1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      1.571555e+00      3.771731e+00      4.583092e+00      3.457420e+00      4.107672e+00      2.200177e+00      2.671643e+00      2.200177e+00      2.043021e+00      6.550589e-01      1.414399e+00      6.286219e-01      9.429328e-01      1.100088e+00      6.286219e-01      6.286219e-01      6.286219e-01      0.000000e+00      1.414399e+00    
+530.0<Trec<545.0       |  1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      9.429328e-01      1.885866e+00      1.885866e+00      2.514488e+00      1.728710e+00      2.043021e+00      1.571555e+00      1.728710e+00      1.414399e+00      9.429328e-01      1.374361e+00      4.314279e-01      6.286219e-01      1.100088e+00      1.257244e+00      7.857774e-01      6.286219e-01      3.143109e-01      1.728710e+00    
+545.0<Trec<560.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.257244e+00      3.143110e+00      2.357332e+00      1.885866e+00      1.571555e+00      1.728710e+00      7.857774e-01      1.571555e+00      1.257244e+00      1.100088e+00      1.571555e-01      9.429328e-01      3.143109e-01      4.714664e-01      6.286219e-01      1.571555e-01      3.143109e-01      2.200177e+00    
+560.0<Trec<575.0       |  1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.571555e-01      3.143109e-01      0.000000e+00      0.000000e+00      4.714664e-01      7.857774e-01      1.257244e+00      1.571555e+00      1.100088e+00      2.357332e+00      1.100088e+00      1.100088e+00      1.915195e+00      9.429328e-01      9.429328e-01      1.100088e+00      4.714664e-01      9.429328e-01      6.286219e-01      4.714664e-01      1.571555e-01      1.414399e+00    
+575.0<Trec<590.0       |  1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      1.571555e-01      0.000000e+00      1.571555e-01      1.571555e-01      3.143109e-01      1.414399e+00      2.828799e+00      1.100088e+00      1.414399e+00      1.414399e+00      1.292860e+00      4.714664e-01      7.857774e-01      3.456985e-01      1.100088e+00      6.286219e-01      1.571555e-01      3.143109e-01      7.857774e-01      4.314279e-01      1.100088e+00    
+590.0<Trec<605.0       |  3.143109e-01      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.143109e-01      0.000000e+00      1.571555e-01      3.143109e-01      4.714664e-01      1.728710e+00      7.857774e-01      1.728710e+00      7.857774e-01      7.857774e-01      9.429328e-01      1.257244e+00      1.257244e+00      9.429328e-01      6.286219e-01      1.100088e+00      7.857774e-01      1.100088e+00      4.714664e-01      3.457420e+00    
+605.0<Trec<620.0       |  0.000000e+00      1.571555e-01      0.000000e+00      1.883225e-01      1.883225e-01      0.000000e+00      2.742724e-01      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      4.714664e-01      1.374361e+00      9.429328e-01      2.043021e+00      1.728710e+00      1.571555e+00      1.257244e+00      1.100088e+00      6.286219e-01      4.714664e-01      6.286219e-01      4.714664e-01      3.143109e-01      3.143109e-01      1.571555e-01      3.614576e+00    
+620.0<Trec<635.0       |  2.742724e-01      0.000000e+00      0.000000e+00      3.454780e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      2.742724e-01      1.571555e-01      0.000000e+00      1.571555e-01      3.454780e-01      0.000000e+00      1.571555e-01      1.414399e+00      6.286219e-01      2.043021e+00      1.257244e+00      1.414399e+00      1.414399e+00      1.100088e+00      6.286219e-01      3.143109e-01      1.100088e+00      7.857774e-01      3.143109e-01      4.714664e-01      4.714664e-01      2.357332e+00    
+635.0<Trec<650.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.454780e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      3.454780e-01      0.000000e+00      1.881355e-01      3.766451e-01      1.571555e-01      1.414399e+00      5.026335e-01      1.100088e+00      1.131068e+00      6.286219e-01      9.429328e-01      6.286219e-01      4.714664e-01      1.571555e-01      7.857774e-01      4.714664e-01      4.714664e-01      1.571555e-01      1.885866e+00    
+650.0<Trec<665.0       |  3.454780e-01      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      1.571555e-01      0.000000e+00      2.742724e-01      0.000000e+00      1.883225e-01      1.571555e-01      1.571555e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.196087e-01      4.714664e-01      1.288411e+00      9.429328e-01      7.857774e-01      1.445566e+00      1.564361e+00      3.143109e-01      1.100088e+00      4.714664e-01      6.286219e-01      1.571555e-01      1.571555e-01      1.571555e-01      2.978760e+00    
+665.0<Trec<680.0       |  1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      2.742724e-01      0.000000e+00      0.000000e+00      1.883225e-01      1.883225e-01      0.000000e+00      1.883225e-01      0.000000e+00      3.454780e-01      1.571555e-01      0.000000e+00      1.571555e-01      7.857774e-01      7.857774e-01      9.429328e-01      3.143109e-01      7.857774e-01      3.143109e-01      5.024465e-01      4.714664e-01      3.143109e-01      9.429328e-01      1.571555e-01      1.571555e-01      3.645556e+00    
+680.0<Trec<695.0       |  2.742724e-01      3.454780e-01      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      4.625950e-01      0.000000e+00      1.883225e-01      4.625950e-01      1.571555e-01      0.000000e+00      0.000000e+00      3.454780e-01      3.143109e-01      5.026335e-01      0.000000e+00      1.571555e-01      4.714664e-01      6.286219e-01      4.714664e-01      6.286219e-01      7.857774e-01      4.714664e-01      1.571555e-01      1.571555e-01      1.885866e+00    
+695.0<Trec<710.0       |  1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.454780e-01      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      1.571555e-01      1.737872e-01      0.000000e+00      3.143109e-01      3.143109e-01      4.714664e-01      3.143109e-01      3.143109e-01      4.714664e-01      4.714664e-01      9.740999e-01      3.143109e-01      3.143109e-01      0.000000e+00      2.357332e+00    
+710.0<Trec<725.0       |  3.454780e-01      0.000000e+00      7.532902e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.766451e-01      0.000000e+00      1.571555e-01      1.883225e-01      0.000000e+00      1.571555e-01      0.000000e+00      4.625950e-01      0.000000e+00      1.883225e-01      1.883225e-01      0.000000e+00      6.597890e-01      8.479245e-01      6.286219e-01      6.452537e-01      6.286219e-01      6.286219e-01      3.454780e-01      1.571555e-01      7.857774e-01      6.597890e-01      3.143109e-01      3.417382e+00    
+725.0<Trec<740.0       |  3.766451e-01      8.392401e-01      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      2.742724e-01      4.625950e-01      0.000000e+00      3.764581e-01      0.000000e+00      0.000000e+00      3.766451e-01      0.000000e+00      0.000000e+00      4.625950e-01      0.000000e+00      1.571555e-01      1.883225e-01      3.309427e-01      0.000000e+00      3.143109e-01      3.143109e-01      0.000000e+00      3.143109e-01      3.143109e-01      0.000000e+00      1.571555e-01      7.857774e-01      2.514488e+00    
+740.0<Trec<755.0       |  0.000000e+00      1.883225e-01      0.000000e+00      1.883225e-01      1.883225e-01      0.000000e+00      1.883225e-01      1.883225e-01      4.625950e-01      4.625950e-01      0.000000e+00      1.883225e-01      0.000000e+00      4.625950e-01      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      4.714664e-01      3.143109e-01      6.286219e-01      1.571555e-01      7.857774e-01      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      2.388499e+00    
+755.0<Trec<770.0       |  1.113325e+00      0.000000e+00      1.883225e-01      1.883225e-01      5.485449e-01      5.338005e-01      2.742724e-01      4.625950e-01      4.625950e-01      8.392401e-01      0.000000e+00      1.883225e-01      3.764581e-01      1.883225e-01      3.766451e-01      8.080730e-01      1.883225e-01      0.000000e+00      1.624532e-01      4.714664e-01      1.499620e-01      1.571555e-01      1.571555e-01      1.883225e-01      6.286219e-01      1.571555e-01      5.026335e-01      0.000000e+00      3.143109e-01      1.728710e+00    
+770.0<Trec<785.0       |  3.764581e-01      0.000000e+00      0.000000e+00      0.000000e+00      9.250030e-01      1.571555e-01      2.742724e-01      1.881355e-01      3.764581e-01      4.625950e-01      3.454780e-01      1.883225e-01      3.766451e-01      2.742724e-01      0.000000e+00      3.621098e-01      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.454780e-01      5.024465e-01      3.454780e-01      3.143109e-01      1.571555e-01      3.143109e-01      1.571555e-01      3.143109e-01      4.529395e-01      1.571555e+00    
+785.0<Trec<800.0       |  1.113325e+00      0.000000e+00      0.000000e+00      2.742724e-01      1.883225e-01      7.368674e-01      4.625950e-01      1.881355e-01      0.000000e+00      3.454780e-01      6.509175e-01      6.509175e-01      1.883225e-01      0.000000e+00      6.509175e-01      5.649677e-01      3.507757e-01      5.647807e-01      1.883225e-01      0.000000e+00      0.000000e+00      1.883225e-01      4.714664e-01      1.571555e-01      4.714664e-01      4.714664e-01      3.143109e-01      0.000000e+00      3.143109e-01      2.631604e+00    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
+Table 7. Migration matrix (Ttrue vs Trec) for irreducible background events.
+The 2-dimensional histogram (true vs reconstructed energy) with 30 x 30 bins for the events that pass the cuts.
+True energy is from 300.0 MeV to 900.0 MeV with the first underflow bin and the last overflow bin; reconstructed energy from 350.0 MeV to 800.0 MeV.
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+      energy range(MeV)|  Ttrue<300.0      300.0<Ttrue<321.4 321.4<Ttrue<342.9 342.9<Ttrue<364.3 364.3<Ttrue<385.7 385.7<Ttrue<407.1 407.1<Ttrue<428.6 428.6<Ttrue<450.0 450.0<Ttrue<471.4 471.4<Ttrue<492.9 492.9<Ttrue<514.3 514.3<Ttrue<535.7 535.7<Ttrue<557.1 557.1<Ttrue<578.6 578.6<Ttrue<600.0 600.0<Ttrue<621.4 621.4<Ttrue<642.9 642.9<Ttrue<664.3 664.3<Ttrue<685.7 685.7<Ttrue<707.1 707.1<Ttrue<728.6 728.6<Ttrue<750.0 750.0<Ttrue<771.4 771.4<Ttrue<792.9 792.9<Ttrue<814.3 814.3<Ttrue<835.7 835.7<Ttrue<857.1 857.1<Ttrue<878.6 878.6<Ttrue<900.0    Ttrue>900.0
+energy range(MeV)      |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+350.0<Trec<365.0       |  1.488262e-01      1.571555e-01      1.058442e+00      1.075101e+00      3.026501e+00      4.415912e+00      9.567624e+00      9.716448e+00      1.004742e+01      9.146132e+00      7.947194e+00      5.987466e+00      5.185031e+00      4.283745e+00      2.728848e+00      2.605010e+00      2.001375e+00      1.844220e+00      8.929574e-01      1.066771e+00      1.521580e+00      9.262744e-01      1.066771e+00      6.231446e-01      1.215598e+00      6.036342e-01      4.631372e-01      3.143109e-01      3.059817e-01      1.687064e+00    
+365.0<Trec<380.0       |  0.000000e+00      2.976525e-01      1.571555e-01      7.691189e-01      7.607896e-01      2.869345e+00      6.086318e+00      8.666336e+00      1.092372e+01      9.294958e+00      7.467398e+00      7.326901e+00      5.482684e+00      5.168374e+00      3.977763e+00      3.324153e+00      3.208644e+00      3.787291e+00      1.075101e+00      1.529909e+00      1.364424e+00      7.691189e-01      6.036342e-01      1.571555e-01      1.488262e-01      5.953050e-01      4.631372e-01      2.976525e-01      4.631372e-01      1.403920e+00    
+380.0<Trec<395.0       |  1.571555e-01      0.000000e+00      0.000000e+00      3.059817e-01      1.223927e+00      2.431195e+00      4.986230e+00      5.656497e+00      5.937492e+00      9.460443e+00      6.077988e+00      5.325528e+00      5.193361e+00      4.837404e+00      5.755348e+00      3.506296e+00      1.984717e+00      3.175327e+00      2.447854e+00      2.588351e+00      1.058442e+00      1.050113e+00      1.571555e-01      6.036342e-01      4.464787e-01      4.631372e-01      3.059817e-01      7.607896e-01      0.000000e+00      1.687064e+00    
+395.0<Trec<410.0       |  0.000000e+00      0.000000e+00      0.000000e+00      4.464787e-01      3.059817e-01      7.524604e-01      1.993046e+00      2.580022e+00      6.822119e+00      7.136429e+00      7.285255e+00      6.962615e+00      5.126727e+00      4.109931e+00      5.036205e+00      4.556410e+00      2.571692e+00      2.141872e+00      2.588351e+00      1.207268e+00      9.179451e-01      9.262744e-01      3.059817e-01      1.223927e+00      9.096159e-01      6.202927e-01      6.119634e-01      4.631372e-01      4.464787e-01      1.240585e+00    
+410.0<Trec<425.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      2.976525e-01      1.571555e-01      4.464787e-01      1.513250e+00      3.969434e+00      5.614851e+00      5.491013e+00      6.053000e+00      6.788802e+00      5.160044e+00      4.159906e+00      3.531284e+00      2.439525e+00      3.026501e+00      2.422866e+00      1.372753e+00      9.262744e-01      1.207268e+00      1.976388e+00      0.000000e+00      4.548079e-01      7.691189e-01      1.571555e-01      1.488262e-01      6.119634e-01      1.255094e+00    
+425.0<Trec<440.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      0.000000e+00      4.464787e-01      3.489638e+00      4.217111e+00      5.830311e+00      6.036342e+00      6.069659e+00      6.499479e+00      5.308870e+00      3.183656e+00      4.076614e+00      2.456183e+00      1.984717e+00      2.745506e+00      2.125214e+00      1.513250e+00      1.207268e+00      1.223927e+00      2.976525e-01      7.524604e-01      1.571555e-01      6.036342e-01      1.571555e-01      1.372753e+00    
+440.0<Trec<455.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.119634e-01      1.381082e+00      4.548080e+00      5.011218e+00      6.979274e+00      8.616362e+00      6.987603e+00      4.829075e+00      6.201826e+00      3.175327e+00      4.225440e+00      3.646793e+00      1.802573e+00      1.984717e+00      1.827561e+00      1.521580e+00      6.119634e-01      1.083430e+00      1.347765e+00      1.223927e+00      3.059817e-01      1.488262e-01      2.133543e+00    
+455.0<Trec<470.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      7.691189e-01      1.571555e-01      1.951400e+00      5.210020e+00      5.614851e+00      6.681622e+00      7.020920e+00      5.185031e+00      5.763678e+00      4.564739e+00      3.688439e+00      2.745507e+00      4.399254e+00      2.125214e+00      1.968058e+00      2.141872e+00      7.691189e-01      7.607896e-01      1.397741e+00      2.976525e-01      3.059817e-01      3.059817e-01      2.581539e+00    
+470.0<Trec<485.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      5.953050e-01      2.869345e+00      5.945820e+00      7.285256e+00      6.566113e+00      6.111306e+00      6.400628e+00      5.143385e+00      6.069659e+00      3.026501e+00      4.581398e+00      3.820607e+00      3.952775e+00      1.968058e+00      1.662076e+00      1.372753e+00      2.009704e+00      9.012867e-01      4.464787e-01      1.066771e+00      3.378479e+00    
+485.0<Trec<500.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.464787e-01      9.096159e-01      1.372753e+00      3.332482e+00      7.260268e+00      7.855572e+00      6.044672e+00      6.218485e+00      6.532796e+00      4.713565e+00      4.424242e+00      5.135057e+00      5.308870e+00      3.200315e+00      2.001375e+00      1.827561e+00      7.691189e-01      1.381082e+00      1.207268e+00      7.774481e-01      2.613339e+00    
+500.0<Trec<515.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      4.548079e-01      1.198939e+00      1.678735e+00      4.051627e+00      4.713565e+00      7.161417e+00      4.399254e+00      3.481309e+00      6.664962e+00      5.176702e+00      3.828937e+00      4.994560e+00      3.497967e+00      3.200314e+00      1.810903e+00      1.083430e+00      1.232256e+00      1.827561e+00      1.381082e+00      2.470692e+00    
+515.0<Trec<530.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.036342e-01      7.524604e-01      2.596680e+00      3.183656e+00      3.043159e+00      5.283883e+00      5.168374e+00      5.226677e+00      4.134918e+00      4.705236e+00      4.275415e+00      4.548080e+00      5.168374e+00      3.977763e+00      3.093472e+00      3.059818e+00      1.372753e+00      7.607896e-01      4.556409e+00    
+530.0<Trec<545.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      1.488262e-01      1.190610e+00      1.381082e+00      2.910991e+00      4.895708e+00      4.250428e+00      3.919458e+00      4.109931e+00      4.721894e+00      3.812278e+00      3.514626e+00      3.208644e+00      3.059818e+00      3.547942e+00      3.200315e+00      2.605010e+00      1.802573e+00      7.151219e+00    
+545.0<Trec<560.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.059817e-01      7.441312e-01      1.951400e+00      1.670406e+00      3.200315e+00      3.630135e+00      2.166860e+00      2.877674e+00      2.737177e+00      3.481309e+00      2.605010e+00      3.200315e+00      3.299166e+00      2.125214e+00      2.927649e+00      2.307357e+00      1.521580e+00      5.796995e+00    
+560.0<Trec<575.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.687064e+00      2.274040e+00      2.737177e+00      2.580022e+00      2.745506e+00      2.720519e+00      3.191985e+00      3.977763e+00      2.728848e+00      1.827561e+00      2.406208e+00      2.116884e+00      2.439525e+00      1.678735e+00      1.810903e+00      6.847106e+00    
+575.0<Trec<590.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.036342e-01      1.364424e+00      2.439525e+00      2.125214e+00      2.927649e+00      2.894333e+00      2.257382e+00      1.381082e+00      2.596680e+00      3.340811e+00      2.108555e+00      1.381082e+00      1.653747e+00      1.670406e+00      1.968058e+00      6.885440e+00    
+590.0<Trec<605.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      7.524604e-01      1.819232e+00      1.943071e+00      2.886003e+00      3.349141e+00      2.588351e+00      3.977763e+00      2.299028e+00      2.869345e+00      3.952775e+00      3.472980e+00      3.349141e+00      1.513250e+00      1.976388e+00      1.008673e+01    
+605.0<Trec<620.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.119634e-01      5.953050e-01      1.968058e+00      2.125214e+00      2.133543e+00      1.810903e+00      1.819232e+00      1.513250e+00      2.282369e+00      2.621668e+00      2.596680e+00      2.894333e+00      2.720519e+00      1.678735e+00      1.042836e+01    
+620.0<Trec<635.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      4.631372e-01      7.607896e-01      2.265711e+00      1.827561e+00      1.066771e+00      1.521580e+00      1.959729e+00      2.225672e+00      1.827561e+00      2.150201e+00      1.959729e+00      2.125214e+00      1.852549e+00      1.097154e+01    
+635.0<Trec<650.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      3.059817e-01      6.119634e-01      1.232256e+00      2.447854e+00      1.968058e+00      1.819232e+00      2.150201e+00      1.844220e+00      1.827561e+00      1.232256e+00      2.116884e+00      1.827561e+00      2.150201e+00      1.371919e+01    
+650.0<Trec<665.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.059817e-01      2.976525e-01      1.488262e-01      1.695393e+00      1.075101e+00      7.607896e-01      2.141872e+00      9.179451e-01      7.607896e-01      1.215598e+00      1.827561e+00      2.439525e+00      1.236763e+01    
+665.0<Trec<680.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.371488e-01      4.631372e-01      1.058442e+00      1.207268e+00      1.066771e+00      1.695393e+00      1.959729e+00      1.372753e+00      1.538238e+00      1.827561e+00      1.504921e+00      2.141872e+00      1.394898e+01    
+680.0<Trec<695.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      6.119634e-01      5.953050e-01      7.524604e-01      6.119634e-01      1.058442e+00      1.372753e+00      1.091759e+00      1.066771e+00      1.043391e+00      1.381082e+00      1.280958e+01    
+695.0<Trec<710.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.566829e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.571555e-01      3.143109e-01      7.691189e-01      1.488262e-01      6.119634e-01      9.262744e-01      7.774481e-01      1.207268e+00      9.096159e-01      1.504921e+00      1.309849e+00      1.180112e+01    
+710.0<Trec<725.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      2.742724e-01      1.488262e-01      4.631372e-01      6.119634e-01      1.223927e+00      1.240585e+00      1.670406e+00      2.001375e+00      1.403920e+00      1.215598e+00      1.083430e+00      1.091079e+01    
+725.0<Trec<740.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.783415e-01      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      3.766451e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      1.883225e-01      0.000000e+00      7.691189e-01      7.691189e-01      9.179451e-01      7.524604e-01      1.223927e+00      9.096159e-01      3.059817e-01      9.012867e-01      1.212525e+01    
+740.0<Trec<755.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.783415e-01      0.000000e+00      0.000000e+00      3.354969e-01      4.464787e-01      2.976525e-01      4.759939e-01      6.119634e-01      1.356094e+00      6.036342e-01      1.678735e+00      1.455947e+01    
+755.0<Trec<770.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.783415e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.883225e-01      1.883225e-01      4.230987e-01      1.488262e-01      1.488262e-01      1.571555e-01      6.119634e-01      7.607896e-01      1.198939e+00      6.119634e-01      1.187443e+01    
+770.0<Trec<785.0       |  0.000000e+00      0.000000e+00      0.000000e+00      2.597360e-01      0.000000e+00      0.000000e+00      0.000000e+00      1.783415e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      3.666640e-01      0.000000e+00      1.783415e-01      3.666640e-01      0.000000e+00      1.783415e-01      0.000000e+00      2.742724e-01      1.488262e-01      0.000000e+00      4.759939e-01      1.571555e-01      1.571555e-01      3.143109e-01      6.036342e-01      1.058442e+00      6.119634e-01      9.481453e+00    
+785.0<Trec<800.0       |  0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.783415e-01      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      0.000000e+00      1.488262e-01      6.248202e-01      7.524604e-01      4.631372e-01      9.096159e-01      1.066771e+00      1.474370e+01    
+=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
+
+
diff --git a/data/MiniBooNE/ncqe/flux.txt b/data/MiniBooNE/ncqe/flux.txt
new file mode 100644
index 0000000..836cec3
--- /dev/null
+++ b/data/MiniBooNE/ncqe/flux.txt
@@ -0,0 +1,200 @@
+0.0 	2.272e-12 	0
+0.05 	8.566e-12 	0
+0.1 	1.112e-11 	0
+0.15 	1.335e-11 	0
+0.2 	1.658e-11 	0
+0.25 	1.82e-11 	0
+0.3 	1.946e-11 	0
+0.35 	2.045e-11 	0
+0.4 	2.161e-11 	0
+0.45 	2.241e-11 	0
+0.5 	2.279e-11 	0
+0.55 	2.292e-11 	0
+0.6 	2.275e-11 	0
+0.65 	2.253e-11 	0
+0.7 	2.214e-11 	0
+0.75 	2.156e-11 	0
+0.8 	2.078e-11 	0
+0.85 	1.992e-11 	0
+0.9 	1.894e-11 	0
+0.95 	1.789e-11 	0
+1.0 	1.677e-11 	0
+1.05 	1.558e-11 	0
+1.1 	1.439e-11 	0
+1.15 	1.318e-11 	0
+1.2 	1.193e-11 	0
+1.25 	1.069e-11 	0
+1.3 	9.503e-12 	0
+1.35 	8.356e-12 	0
+1.4 	7.278e-12 	0
+1.45 	6.292e-12 	0
+1.5 	5.396e-12 	0
+1.55 	4.601e-12 	0
+1.6 	3.902e-12 	0
+1.65 	3.285e-12 	0
+1.7 	2.76e-12 	0
+1.75 	2.312e-12 	0
+1.8 	1.932e-12 	0
+1.85 	1.616e-12 	0
+1.9 	1.355e-12 	0
+1.95 	1.138e-12 	0
+2.0 	9.589e-13 	0
+2.05 	8.15e-13 	0
+2.1 	6.928e-13 	0
+2.15 	5.937e-13 	0
+2.2 	5.147e-13 	0
+2.25 	4.478e-13 	0
+2.3 	3.935e-13 	0
+2.35 	3.5e-13 	0
+2.4 	3.15e-13 	0
+2.45 	2.867e-13 	0
+2.5 	2.615e-13 	0
+2.55 	2.409e-13 	0
+2.6 	2.273e-13 	0
+2.65 	2.11e-13 	0
+2.7 	1.995e-13 	0
+2.75 	1.92e-13 	0
+2.8 	1.815e-13 	0
+2.85 	1.726e-13 	0
+2.9 	1.665e-13 	0
+2.95 	1.601e-13 	0
+3.0 	1.554e-13 	0
+3.05 	1.493e-13 	0
+3.1 	1.442e-13 	0
+3.15 	1.412e-13 	0
+3.2 	1.363e-13 	0
+3.25 	1.323e-13 	0
+3.3 	1.265e-13 	0
+3.35 	1.217e-13 	0
+3.4 	1.183e-13 	0
+3.45 	1.14e-13 	0
+3.5 	1.102e-13 	0
+3.55 	1.06e-13 	0
+3.6 	1.014e-13 	0
+3.65 	9.7e-14 	0
+3.7 	9.34e-14 	0
+3.75 	9.001e-14 	0
+3.8 	8.641e-14 	0
+3.85 	8.19e-14 	0
+3.9 	7.867e-14 	0
+3.95 	7.464e-14 	0
+4.0 	7.146e-14 	0
+4.05 	6.812e-14 	0
+4.1 	6.499e-14 	0
+4.15 	6.185e-14 	0
+4.2 	5.858e-14 	0
+4.25 	5.614e-14 	0
+4.3 	5.32e-14 	0
+4.35 	5.016e-14 	0
+4.4 	4.765e-14 	0
+4.45 	4.561e-14 	0
+4.5 	4.281e-14 	0
+4.55 	4.087e-14 	0
+4.6 	3.841e-14 	0
+4.65 	3.632e-14 	0
+4.7 	3.432e-14 	0
+4.75 	3.263e-14 	0
+4.8 	3.016e-14 	0
+4.85 	2.857e-14 	0
+4.9 	2.689e-14 	0
+4.95 	2.529e-14 	0
+5.0 	2.372e-14 	0
+5.05 	2.227e-14 	0
+5.1 	2.103e-14 	0
+5.15 	1.957e-14 	0
+5.2 	1.834e-14 	0
+5.25 	1.73e-14 	0
+5.3 	1.615e-14 	0
+5.35 	1.513e-14 	0
+5.4 	1.406e-14 	0
+5.45 	1.303e-14 	0
+5.5 	1.214e-14 	0
+5.55 	1.129e-14 	0
+5.6 	1.047e-14 	0
+5.65 	9.569e-15 	0
+5.7 	8.87e-15 	0
+5.75 	8.148e-15 	0
+5.8 	7.429e-15 	0
+5.85 	6.765e-15 	0
+5.9 	6.097e-15 	0
+5.95 	5.492e-15 	0
+6.0 	4.977e-15 	0
+6.05 	4.445e-15 	0
+6.1 	3.967e-15 	0
+6.15 	3.492e-15 	0
+6.2 	3.037e-15 	0
+6.25 	2.595e-15 	0
+6.3 	2.225e-15 	0
+6.35 	1.854e-15 	0
+6.4 	1.537e-15 	0
+6.45 	1.22e-15 	0
+6.5 	9.78e-16 	0
+6.55 	7.842e-16 	0
+6.6 	6.198e-16 	0
+6.65 	4.786e-16 	0
+6.7 	3.334e-16 	0
+6.75 	1.971e-16 	0
+6.8 	9.391e-17 	0
+6.85 	2.738e-17 	0
+6.9 	6.065e-18 	0
+6.95 	4.135e-18 	0
+7.0 	1.933e-18 	0
+7.05 	9.888e-19 	0
+7.1 	4.494e-20 	0
+7.15 	0.0 	0
+7.2 	0.0 	0
+7.25 	0.0 	0
+7.3 	0.0 	0
+7.35 	0.0 	0
+7.4 	0.0 	0
+7.45 	0.0 	0
+7.5 	0.0 	0
+7.55 	0.0 	0
+7.6 	0.0 	0
+7.65 	0.0 	0
+7.7 	0.0 	0
+7.75 	0.0 	0
+7.8 	0.0 	0
+7.85 	0.0 	0
+7.9 	0.0 	0
+7.95 	0.0 	0
+8.0 	0.0 	0
+8.05 	0.0 	0
+8.1 	0.0 	0
+8.15 	0.0 	0
+8.2 	0.0 	0
+8.25 	0.0 	0
+8.3 	0.0 	0
+8.35 	0.0 	0
+8.4 	0.0 	0
+8.45 	0.0 	0
+8.5 	0.0 	0
+8.55 	0.0 	0
+8.6 	0.0 	0
+8.65 	0.0 	0
+8.7 	0.0 	0
+8.75 	0.0 	0
+8.8 	0.0 	0
+8.85 	0.0 	0
+8.9 	0.0 	0
+8.95 	0.0 	0
+9.0 	0.0 	0
+9.05 	0.0 	0
+9.1 	0.0 	0
+9.15 	0.0 	0
+9.2 	0.0 	0
+9.25 	0.0 	0
+9.3 	0.0 	0
+9.35 	0.0 	0
+9.4 	0.0 	0
+9.45 	0.0 	0
+9.5 	0.0 	0
+9.55 	0.0 	0
+9.6 	0.0 	0
+9.65 	0.0 	0
+9.7 	0.0 	0
+9.75 	0.0 	0
+9.8 	0.0 	0
+9.85 	0.0 	0
+9.9 	0.0 	0
+9.95 	0.0 	0
diff --git a/data/MiniBooNE/ncqe/pospolarity_fluxes.dat b/data/MiniBooNE/ncqe/pospolarity_fluxes.dat
new file mode 100644
index 0000000..95091a4
--- /dev/null
+++ b/data/MiniBooNE/ncqe/pospolarity_fluxes.dat
@@ -0,0 +1,201 @@
+#  Elo   Ehi       numu      numub        nue       nueb
+ 0.00  0.05  2.272e-12  2.560e-12  1.530e-14  5.047e-15
+ 0.05  0.10  8.566e-12  5.671e-12  5.722e-14  1.156e-14
+ 0.10  0.15  1.112e-11  3.300e-12  1.273e-13  1.705e-14
+ 0.15  0.20  1.335e-11  2.028e-12  1.231e-13  1.529e-14
+ 0.20  0.25  1.658e-11  1.623e-12  1.042e-13  1.002e-14
+ 0.25  0.30  1.820e-11  1.395e-12  1.078e-13  1.039e-14
+ 0.30  0.35  1.946e-11  1.301e-12  1.093e-13  9.661e-15
+ 0.35  0.40  2.045e-11  1.249e-12  1.086e-13  9.990e-15
+ 0.40  0.45  2.161e-11  1.171e-12  1.061e-13  9.711e-15
+ 0.45  0.50  2.241e-11  1.054e-12  1.034e-13  9.380e-15
+ 0.50  0.55  2.279e-11  9.580e-13  1.001e-13  9.049e-15
+ 0.55  0.60  2.292e-11  8.695e-13  9.654e-14  9.298e-15
+ 0.60  0.65  2.275e-11  8.098e-13  9.198e-14  8.340e-15
+ 0.65  0.70  2.253e-11  7.434e-13  8.800e-14  8.007e-15
+ 0.70  0.75  2.214e-11  6.910e-13  8.467e-14  7.769e-15
+ 0.75  0.80  2.156e-11  6.314e-13  8.008e-14  7.364e-15
+ 0.80  0.85  2.078e-11  5.905e-13  7.740e-14  6.980e-15
+ 0.85  0.90  1.992e-11  5.504e-13  7.390e-14  6.944e-15
+ 0.90  0.95  1.894e-11  5.079e-13  6.924e-14  6.564e-15
+ 0.95  1.00  1.789e-11  4.708e-13  6.618e-14  5.783e-15
+ 1.00  1.05  1.677e-11  4.347e-13  6.239e-14  6.041e-15
+ 1.05  1.10  1.558e-11  4.021e-13  6.037e-14  5.471e-15
+ 1.10  1.15  1.439e-11  3.703e-13  5.633e-14  5.113e-15
+ 1.15  1.20  1.318e-11  3.443e-13  5.446e-14  5.054e-15
+ 1.20  1.25  1.193e-11  3.173e-13  5.014e-14  4.918e-15
+ 1.25  1.30  1.069e-11  2.872e-13  4.838e-14  4.902e-15
+ 1.30  1.35  9.503e-12  2.597e-13  4.520e-14  4.552e-15
+ 1.35  1.40  8.356e-12  2.337e-13  4.350e-14  4.400e-15
+ 1.40  1.45  7.278e-12  2.101e-13  4.028e-14  4.388e-15
+ 1.45  1.50  6.292e-12  1.903e-13  3.933e-14  3.939e-15
+ 1.50  1.55  5.396e-12  1.718e-13  3.696e-14  3.598e-15
+ 1.55  1.60  4.601e-12  1.507e-13  3.455e-14  3.530e-15
+ 1.60  1.65  3.902e-12  1.341e-13  3.285e-14  3.588e-15
+ 1.65  1.70  3.285e-12  1.173e-13  3.059e-14  3.289e-15
+ 1.70  1.75  2.760e-12  1.053e-13  2.885e-14  3.112e-15
+ 1.75  1.80  2.312e-12  9.241e-14  2.803e-14  2.919e-15
+ 1.80  1.85  1.932e-12  8.188e-14  2.574e-14  2.733e-15
+ 1.85  1.90  1.616e-12  7.115e-14  2.431e-14  2.850e-15
+ 1.90  1.95  1.355e-12  6.349e-14  2.298e-14  2.564e-15
+ 1.95  2.00  1.138e-12  5.547e-14  2.165e-14  2.514e-15
+ 2.00  2.05  9.589e-13  4.799e-14  2.042e-14  2.387e-15
+ 2.05  2.10  8.150e-13  4.071e-14  1.867e-14  2.242e-15
+ 2.10  2.15  6.928e-13  3.592e-14  1.763e-14  2.093e-15
+ 2.15  2.20  5.937e-13  3.082e-14  1.656e-14  2.027e-15
+ 2.20  2.25  5.147e-13  2.638e-14  1.545e-14  1.812e-15
+ 2.25  2.30  4.478e-13  2.248e-14  1.485e-14  1.724e-15
+ 2.30  2.35  3.935e-13  1.878e-14  1.361e-14  1.665e-15
+ 2.35  2.40  3.500e-13  1.623e-14  1.281e-14  1.532e-15
+ 2.40  2.45  3.150e-13  1.391e-14  1.190e-14  1.470e-15
+ 2.45  2.50  2.867e-13  1.162e-14  1.130e-14  1.394e-15
+ 2.50  2.55  2.615e-13  1.010e-14  1.043e-14  1.305e-15
+ 2.55  2.60  2.409e-13  8.691e-15  9.800e-15  1.279e-15
+ 2.60  2.65  2.273e-13  7.382e-15  8.832e-15  1.140e-15
+ 2.65  2.70  2.110e-13  5.999e-15  8.607e-15  1.042e-15
+ 2.70  2.75  1.995e-13  5.004e-15  7.727e-15  9.795e-16
+ 2.75  2.80  1.920e-13  4.204e-15  7.285e-15  9.706e-16
+ 2.80  2.85  1.815e-13  3.571e-15  6.793e-15  8.481e-16
+ 2.85  2.90  1.726e-13  3.047e-15  6.371e-15  8.082e-16
+ 2.90  2.95  1.665e-13  2.597e-15  5.772e-15  7.190e-16
+ 2.95  3.00  1.601e-13  2.138e-15  5.490e-15  6.964e-16
+ 3.00  3.05  1.554e-13  1.956e-15  4.989e-15  6.877e-16
+ 3.05  3.10  1.493e-13  1.584e-15  4.656e-15  6.044e-16
+ 3.10  3.15  1.442e-13  1.227e-15  4.211e-15  5.312e-16
+ 3.15  3.20  1.412e-13  1.021e-15  4.071e-15  5.064e-16
+ 3.20  3.25  1.363e-13  8.356e-16  3.819e-15  4.558e-16
+ 3.25  3.30  1.323e-13  7.777e-16  3.496e-15  4.458e-16
+ 3.30  3.35  1.265e-13  6.812e-16  3.165e-15  3.910e-16
+ 3.35  3.40  1.217e-13  7.386e-16  2.922e-15  3.674e-16
+ 3.40  3.45  1.183e-13  6.128e-16  2.624e-15  3.457e-16
+ 3.45  3.50  1.140e-13  6.251e-16  2.489e-15  3.385e-16
+ 3.50  3.55  1.102e-13  5.519e-16  2.276e-15  2.937e-16
+ 3.55  3.60  1.060e-13  3.936e-16  2.078e-15  2.900e-16
+ 3.60  3.65  1.014e-13  4.141e-16  1.887e-15  2.523e-16
+ 3.65  3.70  9.700e-14  3.395e-16  1.716e-15  2.363e-16
+ 3.70  3.75  9.340e-14  3.002e-16  1.603e-15  2.107e-16
+ 3.75  3.80  9.001e-14  2.502e-16  1.448e-15  1.936e-16
+ 3.80  3.85  8.641e-14  2.273e-16  1.338e-15  1.801e-16
+ 3.85  3.90  8.190e-14  2.299e-16  1.215e-15  1.561e-16
+ 3.90  3.95  7.867e-14  1.429e-16  1.171e-15  1.465e-16
+ 3.95  4.00  7.464e-14  1.574e-16  9.923e-16  1.371e-16
+ 4.00  4.05  7.146e-14  1.218e-16  9.308e-16  1.249e-16
+ 4.05  4.10  6.812e-14  1.280e-16  8.357e-16  1.148e-16
+ 4.10  4.15  6.499e-14  1.612e-16  7.638e-16  1.079e-16
+ 4.15  4.20  6.185e-14  8.604e-17  6.755e-16  9.442e-17
+ 4.20  4.25  5.858e-14  9.270e-17  6.545e-16  8.323e-17
+ 4.25  4.30  5.614e-14  5.371e-17  5.973e-16  7.855e-17
+ 4.30  4.35  5.320e-14  5.495e-17  5.257e-16  6.963e-17
+ 4.35  4.40  5.016e-14  4.276e-17  4.645e-16  6.551e-17
+ 4.40  4.45  4.765e-14  3.693e-17  4.304e-16  5.711e-17
+ 4.45  4.50  4.561e-14  6.592e-17  3.828e-16  4.896e-17
+ 4.50  4.55  4.281e-14  6.261e-17  3.410e-16  4.631e-17
+ 4.55  4.60  4.087e-14  2.266e-17  3.141e-16  4.348e-17
+ 4.60  4.65  3.841e-14  3.924e-17  2.881e-16  3.697e-17
+ 4.65  4.70  3.632e-14  5.036e-17  2.498e-16  3.522e-17
+ 4.70  4.75  3.432e-14  3.051e-17  2.223e-16  3.216e-17
+ 4.75  4.80  3.263e-14  7.985e-17  2.055e-16  2.985e-17
+ 4.80  4.85  3.016e-14  1.630e-16  1.819e-16  2.577e-17
+ 4.85  4.90  2.857e-14  1.787e-16  1.592e-16  2.299e-17
+ 4.90  4.95  2.689e-14  5.729e-17  1.407e-16  2.077e-17
+ 4.95  5.00  2.529e-14  6.383e-18  1.242e-16  1.950e-17
+ 5.00  5.05  2.372e-14  5.257e-18  1.142e-16  1.843e-17
+ 5.05  5.10  2.227e-14  5.222e-18  1.028e-16  1.332e-17
+ 5.10  5.15  2.103e-14  4.369e-18  8.425e-17  1.044e-17
+ 5.15  5.20  1.957e-14  3.186e-18  7.409e-17  9.753e-18
+ 5.20  5.25  1.834e-14  3.915e-18  6.574e-17  8.689e-18
+ 5.25  5.30  1.730e-14  2.197e-18  5.592e-17  8.865e-18
+ 5.30  5.35  1.615e-14  1.690e-18  4.790e-17  7.198e-18
+ 5.35  5.40  1.513e-14  1.177e-18  4.200e-17  6.320e-18
+ 5.40  5.45  1.406e-14  9.963e-19  3.153e-17  5.182e-18
+ 5.45  5.50  1.303e-14  9.197e-19  2.980e-17  3.874e-18
+ 5.50  5.55  1.214e-14  6.790e-19  2.362e-17  3.370e-18
+ 5.55  5.60  1.129e-14  5.695e-19  2.218e-17  3.068e-18
+ 5.60  5.65  1.047e-14  5.234e-19  1.834e-17  2.157e-18
+ 5.65  5.70  9.569e-15  3.209e-19  1.757e-17  2.255e-18
+ 5.70  5.75  8.870e-15  2.809e-19  1.367e-17  1.785e-18
+ 5.75  5.80  8.148e-15  2.700e-19  1.136e-17  1.269e-18
+ 5.80  5.85  7.429e-15  1.624e-19  9.188e-18  1.316e-18
+ 5.85  5.90  6.765e-15  1.383e-19  7.469e-18  8.751e-19
+ 5.90  5.95  6.097e-15  1.192e-19  6.502e-18  8.883e-19
+ 5.95  6.00  5.492e-15  9.024e-20  5.513e-18  6.479e-19
+ 6.00  6.05  4.977e-15  9.442e-20  4.571e-18  5.714e-19
+ 6.05  6.10  4.445e-15  5.076e-20  4.365e-18  6.861e-19
+ 6.10  6.15  3.967e-15  6.390e-20  2.147e-18  4.251e-19
+ 6.15  6.20  3.492e-15  4.695e-20  2.322e-18  4.221e-19
+ 6.20  6.25  3.037e-15  2.734e-20  1.548e-18  3.999e-19
+ 6.25  6.30  2.595e-15  3.940e-20  1.282e-18  3.749e-19
+ 6.30  6.35  2.225e-15  2.067e-20  1.049e-18  1.223e-19
+ 6.35  6.40  1.854e-15  2.327e-20  8.226e-19  2.968e-19
+ 6.40  6.45  1.537e-15  2.294e-20  8.297e-19  7.318e-20
+ 6.45  6.50  1.220e-15  1.385e-20  6.143e-19  1.551e-20
+ 6.50  6.55  9.780e-16  1.932e-21  8.553e-19  3.392e-19
+ 6.55  6.60  7.842e-16  8.299e-21  4.705e-19  2.261e-19
+ 6.60  6.65  6.198e-16  5.854e-21  4.387e-19  1.258e-19
+ 6.65  6.70  4.786e-16  1.843e-21  5.170e-19  9.574e-20
+ 6.70  6.75  3.334e-16  0.000e+00  3.049e-19  8.005e-20
+ 6.75  6.80  1.971e-16  1.783e-21  1.612e-19  4.006e-20
+ 6.80  6.85  9.391e-17  4.490e-21  1.606e-19  1.595e-19
+ 6.85  6.90  2.738e-17  4.205e-21  1.181e-19  0.000e+00
+ 6.90  6.95  6.065e-18  0.000e+00  1.960e-19  3.208e-19
+ 6.95  7.00  4.135e-18  0.000e+00  7.793e-20  1.196e-19
+ 7.00  7.05  1.933e-18  0.000e+00  1.571e-19  1.993e-19
+ 7.05  7.10  9.888e-19  0.000e+00  1.169e-19  1.595e-19
+ 7.10  7.15  4.494e-20  0.000e+00  0.000e+00  3.987e-20
+ 7.15  7.20  0.000e+00  1.211e-21  0.000e+00  0.000e+00
+ 7.20  7.25  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.25  7.30  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.30  7.35  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.35  7.40  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.40  7.45  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.45  7.50  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.50  7.55  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.55  7.60  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.60  7.65  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.65  7.70  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.70  7.75  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.75  7.80  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.80  7.85  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.85  7.90  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.90  7.95  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 7.95  8.00  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.00  8.05  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.05  8.10  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.10  8.15  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.15  8.20  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.20  8.25  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.25  8.30  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.30  8.35  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.35  8.40  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.40  8.45  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.45  8.50  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.50  8.55  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.55  8.60  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.60  8.65  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.65  8.70  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.70  8.75  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.75  8.80  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.80  8.85  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.85  8.90  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.90  8.95  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 8.95  9.00  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.00  9.05  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.05  9.10  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.10  9.15  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.15  9.20  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.20  9.25  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.25  9.30  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.30  9.35  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.35  9.40  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.40  9.45  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.45  9.50  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.50  9.55  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.55  9.60  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.60  9.65  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.65  9.70  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.70  9.75  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.75  9.80  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.80  9.85  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.85  9.90  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.90  9.95  0.000e+00  0.000e+00  0.000e+00  0.000e+00
+ 9.95 10.00  0.000e+00  0.000e+00  0.000e+00  0.000e+00
diff --git a/data/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root b/data/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root
index 5449bcb..e6d858f 100644
Binary files a/data/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root and b/data/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root differ
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin0.txt b/data/T2K/CC0pi/cross-section_analysisI_bin0.txt
new file mode 100644
index 0000000..1540a39
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin0.txt
@@ -0,0 +1,77 @@
+0
+3
+8
+15
+22
+30
+39
+47
+58
+
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin1.txt b/data/T2K/CC0pi/cross-section_analysisI_bin1.txt
new file mode 100644
index 0000000..ba12726
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin1.txt
@@ -0,0 +1,70 @@
+Units: momentum (GeV), cross-section (10^-38 cm2/(nucleon x GeV))
+
+bin number | cosTheta min - cosTheta max | momentum min - momentum max | measured xsec 
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin2.txt b/data/T2K/CC0pi/cross-section_analysisI_bin2.txt
new file mode 100644
index 0000000..ba12726
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin2.txt
@@ -0,0 +1,70 @@
+Units: momentum (GeV), cross-section (10^-38 cm2/(nucleon x GeV))
+
+bin number | cosTheta min - cosTheta max | momentum min - momentum max | measured xsec 
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin3.txt b/data/T2K/CC0pi/cross-section_analysisI_bin3.txt
new file mode 100644
index 0000000..ba12726
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin3.txt
@@ -0,0 +1,70 @@
+Units: momentum (GeV), cross-section (10^-38 cm2/(nucleon x GeV))
+
+bin number | cosTheta min - cosTheta max | momentum min - momentum max | measured xsec 
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin4.txt b/data/T2K/CC0pi/cross-section_analysisI_bin4.txt
new file mode 100644
index 0000000..ba12726
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin4.txt
@@ -0,0 +1,70 @@
+Units: momentum (GeV), cross-section (10^-38 cm2/(nucleon x GeV))
+
+bin number | cosTheta min - cosTheta max | momentum min - momentum max | measured xsec 
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/cross-section_analysisI_bin5.txt b/data/T2K/CC0pi/cross-section_analysisI_bin5.txt
new file mode 100644
index 0000000..ba12726
--- /dev/null
+++ b/data/T2K/CC0pi/cross-section_analysisI_bin5.txt
@@ -0,0 +1,70 @@
+Units: momentum (GeV), cross-section (10^-38 cm2/(nucleon x GeV))
+
+bin number | cosTheta min - cosTheta max | momentum min - momentum max | measured xsec 
+0 | -1 - 0 | 0 - 0.3 | 0.255394
+1 | -1 - 0 | 0.3 - 0.4 | 0.207948
+2 | -1 - 0 | 0.4 - 30 | 0.000271813
+3 | 0 - 0.6 | 0 - 0.3 | 0.208457
+4 | 0 - 0.6 | 0.3 - 0.4 | 0.724434
+5 | 0 - 0.6 | 0.4 - 0.5 | 0.551849
+6 | 0 - 0.6 | 0.5 - 0.6 | 0.234113
+7 | 0 - 0.6 | 0.6 - 30 | 0.000368685
+8 | 0.6 - 0.7 | 0 - 0.3 | 0.178667
+9 | 0.6 - 0.7 | 0.3 - 0.4 | 0.63844
+10 | 0.6 - 0.7 | 0.4 - 0.5 | 0.714696
+11 | 0.6 - 0.7 | 0.5 - 0.6 | 0.935747
+12 | 0.6 - 0.7 | 0.6 - 0.7 | 0.646835
+13 | 0.6 - 0.7 | 0.7 - 0.8 | 0.0715046
+14 | 0.6 - 0.7 | 0.8 - 30 | 0.000476125
+15 | 0.7 - 0.8 | 0 - 0.3 | 0.104217
+16 | 0.7 - 0.8 | 0.3 - 0.4 | 0.490643
+17 | 0.7 - 0.8 | 0.4 - 0.5 | 0.824596
+18 | 0.7 - 0.8 | 0.5 - 0.6 | 0.915528
+19 | 0.7 - 0.8 | 0.6 - 0.7 | 0.775158
+20 | 0.7 - 0.8 | 0.7 - 0.8 | 0.255488
+21 | 0.7 - 0.8 | 0.8 - 30 | 0.00219411
+22 | 0.8 - 0.85 | 0 - 0.3 | 0.130715
+23 | 0.8 - 0.85 | 0.3 - 0.4 | 0.494917
+24 | 0.8 - 0.85 | 0.4 - 0.5 | 0.76077
+25 | 0.8 - 0.85 | 0.5 - 0.6 | 0.92914
+26 | 0.8 - 0.85 | 0.6 - 0.7 | 0.605259
+27 | 0.8 - 0.85 | 0.7 - 0.8 | 0.478013
+28 | 0.8 - 0.85 | 0.8 - 1 | 0.330544
+29 | 0.8 - 0.85 | 1 - 30 | 0.001706
+30 | 0.85 - 0.9 | 0 - 0.3 | 0.0519623
+31 | 0.85 - 0.9 | 0.3 - 0.4 | 0.383728
+32 | 0.85 - 0.9 | 0.4 - 0.5 | 0.743677
+33 | 0.85 - 0.9 | 0.5 - 0.6 | 0.863931
+34 | 0.85 - 0.9 | 0.6 - 0.7 | 1.02885
+35 | 0.85 - 0.9 | 0.7 - 0.8 | 0.465526
+36 | 0.85 - 0.9 | 0.8 - 1 | 0.288899
+37 | 0.85 - 0.9 | 1 - 1.5 | 0.17484
+38 | 0.85 - 0.9 | 1.5 - 30 | 0.000506115
+39 | 0.9 - 0.94 | 0 - 0.4 | 0.11857
+40 | 0.9 - 0.94 | 0.4 - 0.5 | 0.652239
+41 | 0.9 - 0.94 | 0.5 - 0.6 | 0.821718
+42 | 0.9 - 0.94 | 0.6 - 0.7 | 0.474617
+43 | 0.9 - 0.94 | 0.7 - 0.8 | 0.584867
+44 | 0.9 - 0.94 | 0.8 - 1.25 | 0.351801
+45 | 0.9 - 0.94 | 1.25 - 2 | 0.113308
+46 | 0.9 - 0.94 | 2 - 30 | 0.00152386
+47 | 0.94 - 0.98 | 0 - 0.4 | 0.0971869
+48 | 0.94 - 0.98 | 0.4 - 0.5 | 0.361972
+49 | 0.94 - 0.98 | 0.5 - 0.6 | 0.618293
+50 | 0.94 - 0.98 | 0.6 - 0.7 | 0.814948
+51 | 0.94 - 0.98 | 0.7 - 0.8 | 0.51946
+52 | 0.94 - 0.98 | 0.8 - 1 | 0.554242
+53 | 0.94 - 0.98 | 1 - 1.25 | 0.390123
+54 | 0.94 - 0.98 | 1.25 - 1.5 | 0.258903
+55 | 0.94 - 0.98 | 1.5 - 2 | 0.310958
+56 | 0.94 - 0.98 | 2 - 3 | 0.115618
+57 | 0.94 - 0.98 | 3 - 30 | 0.00393359
+58 | 0.98 - 1 | 0 - 0.5 | 0.130586
+59 | 0.98 - 1 | 0.5 - 0.6 | 0.225854
+60 | 0.98 - 1 | 0.6 - 0.7 | 0.338863
+61 | 0.98 - 1 | 0.7 - 0.8 | 0.301963
+62 | 0.98 - 1 | 0.8 - 1.25 | 0.117946
+63 | 0.98 - 1 | 1.25 - 2 | 0.239808
+64 | 0.98 - 1 | 2 - 3 | 0.283177
+65 | 0.98 - 1 | 3 - 5 | 0.281044
+66 | 0.98 - 1 | 5 - 30 | 0.0128204
diff --git a/data/T2K/CC0pi/makedatafile_t2kcc0pi.py b/data/T2K/CC0pi/makedatafile_t2kcc0pi.py
index a8710b7..acc5297 100644
--- a/data/T2K/CC0pi/makedatafile_t2kcc0pi.py
+++ b/data/T2K/CC0pi/makedatafile_t2kcc0pi.py
@@ -1,186 +1,294 @@
 from ROOT import *
 from array import *
 
 def GetMiddle(mystr):
 
     lims = mystr.strip().split(" - ")
     val = (float(lims[0]) + float(lims[1]))/2.0
 
     return val
 
 def GetLowEdge(mystr):
 
     lims = mystr.strip().split(" - ")
     val = (float(lims[0]) + 0.00001)
     
     return val
 
 def GetHighEdge(mystr):
     
     lims = mystr.strip().split(" - ")
     val = (float(lims[1]) - 0.00001)
            
     return val
            
 def GetIndex(mystr):
 
     lims = mystr.split("-")
 
     return int(lims[0]), int(lims[1])
 
 outfile = TFile("T2K_CC0PI_2DPmuCosmu_Data.root","RECREATE")
 
 # ANALYSIS I
 #______________________________
 xedge   =  [0.0, 0.3, 0.4, 0.5, 0.65, 0.8, 0.95, 1.1, 1.25, 1.5, 2.0, 3.0, 5.0, 30.0]
 yedge   =  [-1.0, 0.0, 0.6, 0.7, 0.8, 0.85, 0.9, 0.94, 0.98, 1.0]
 
 datahist = TH2D("analysis1_data","analysis1_data",
                 len(xedge)-1, array('f',xedge),
                 len(yedge)-1, array('f',yedge))
            
 maphist = datahist.Clone("analysis1_map")
 maphist.SetTitle("analysis1_map")
            
 counthist = datahist.Clone("analysis1_entrycount")
-           
+
+datapoly = TH2Poly("datapoly","datapoly", 0.0,30.0, -1.0, 1.0)
+hist = None
+
+binedges = []
+histedgeslist = []
+xsecvals = []
+histxseclist = []
+
+binlimits = [3,8,15,22,30,39,47,58,67]
 with open("cross-section_analysisI.txt") as f:
     count = 0
     for line in f:
         count += 1
         
         if (count < 4): continue
         data = line.strip().split("|")
         if (len(data) < 1): continue
 
         ibin = int(   data[0]  ) + 1
         
-        xval = GetLowEdge( data[2] )
-        yval = GetLowEdge( data[1] )
-        xhig = GetHighEdge( data[2] )
-        yhig = GetHighEdge( data[1] )
+        xval = round(float(GetLowEdge( data[2] )),4)
+        yval = round(float(GetLowEdge( data[1] )),4)
+        xhig = round(float(GetHighEdge( data[2] )),4)
+        yhig = round(float(GetHighEdge( data[1] )),4)
         
         xsec = float( data[3]  ) * 1E-38
 
+        datapoly.AddBin( xval, yval, xhig, yhig )
+        datapoly.SetBinContent( datapoly.GetNumberOfBins(), xsec)
+
+        binedges.append( xval )
+        xsecvals.append( xsec )
+        if ibin in binlimits: 
+            binedges.append( xhig )
+            histedgeslist.append(binedges)
+            histxseclist.append(xsecvals)
+            binedges = []
+            xsecvals = []
+
+
         datahist.Fill(xval, yval, xsec)
         counthist.Fill(xval, yval, 1.0)
 
         for i in range(maphist.GetNbinsX()):
             for j in range(maphist.GetNbinsY()):
                 xcent = maphist.GetXaxis().GetBinCenter(i+1)
                 ycent = maphist.GetYaxis().GetBinCenter(j+1)
 
                 if (xcent > xval and xcent < xhig and
                     ycent > yval and ycent < yhig):
                     maphist.SetBinContent(i+1,j+1, ibin)
 
+data1D = TH1D("datahist","datahist", datapoly.GetNumberOfBins(), 0.0, float(datapoly.GetNumberOfBins()));
+for i in range(datapoly.GetNumberOfBins()):
+    data1D.SetBinContent(i+1, datapoly.GetBinContent(i+1));
+
 outfile.cd()
 datahist.Write()
 counthist.Write()
 maphist.Write()
+datapoly.Write()
+data1D.Write()
+
+for i, obj in enumerate(histedgeslist):
+    print obj
+
+    hist = TH1D("dataslice_" + str(i), "dataslice_" + str(i), len(obj)-1, array('f',obj))
+    for j in range(hist.GetNbinsX()):
+        hist.SetBinContent(j+1, histxseclist[i][j])
+
+    hist.GetXaxis().SetRangeUser(obj[0], obj[len(obj)-2])
+    hist.Draw("HIST")
+    gPad.Update()
+
+    hist.SetNameTitle("dataslice_" + str(i),"dataslice_" + str(i))
+    hist.Write()
+
+# Get N Bins                                                                                                                                                                                                                               
+nbins = 67
+print "NBins I = ", nbins
+
+# Get Covariances (keep in 1E-38 cm^2)                                                                                                                                                                                                      
+statcov = TH2D("analysis1_statcov","analysis1_statcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
+systcov = TH2D("analysis1_systcov","analysis1_systcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
+normcov = TH2D("analysis1_normcov","analysis1_normcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
+totcov = TH2D("analysis1_totcov","analysis1_totcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
+
+with open("covariance_statisticUncertainty_analysisI.txt") as f:
+    count = 0
+    for line in f:
+        count += 1
+
+        if (count < 4): continue
+        data = line.strip().split("|")
+        if (len(data) < 1): continue
+
+        xi, yi = GetIndex(data[0])
+        cov    = float(data[1])
+
+        statcov.SetBinContent(xi, yi, cov)
+
+with open("covariance_shapeSystematics_analysisI.txt") as f:
+    count = 0
+    for line in f:
+        count += 1
+
+        if (count < 4): continue
+        data = line.strip().split("|")
+        if (len(data) < 1): continue
+
+        xi, yi = GetIndex(data[0])
+        cov    = float(data[1])
+
+        systcov.SetBinContent(xi + 1, yi + 1, cov)
+
+with open("covariance_fluxNormalizationSystematics_analysisI.txt") as f:
+    count = 0
+    for line in f:
+        count += 1
+
+        if (count < 4): continue
+        data = line.strip().split("|")
+        if (len(data) < 1): continue
+
+        xi, yi = GetIndex(data[0])
+        cov    = float(data[1])
+
+        normcov.SetBinContent(xi + 1, yi + 1, cov)
+
+totcov.Add(systcov)
+totcov.Add(statcov)
+totcov.Add(normcov)
+
+outfile.cd()
+statcov.Write()
+systcov.Write()
+totcov.Write()
+normcov.Write()
+
+
 
 
 # ANALYSIS II
 #______________________________
 xedge   =  [0.2, 0.35, 0.5, 0.65, 0.8, 0.95, 1.1, 1.25, 1.5, 2.0, 3.0, 5.0, 30.0]
 yedge   =  [0.6, 0.7, 0.8, 0.85, 0.9, 0.925, 0.95, 0.975, 1.0]
 
 datahist = TH2D("analysis2_data","analysis2_data",
                 len(xedge)-1, array('f',xedge),
                 len(yedge)-1, array('f',yedge))
 
 maphist = datahist.Clone("analysis2_map")
 maphist.SetTitle("analysis2_map")
 
 counthist = datahist.Clone("analysis2_entrycount")
 
 # Get Data Entries
 entries = []
 count = 0
 with open("rps_crossSection_analysis2.txt") as f:
     for line in f:
         count += 1
 
         if (count < 4): continue
         data = line.strip().split("|")
         if (len(data) < 1): continue
 
         ibin = int(   data[0]  ) + 1
         xval = GetMiddle( data[2] )
         yval = GetMiddle( data[1] )
         xsec = float( data[3]  ) * 1E-38
 
         datahist.Fill(xval, yval, xsec)
         maphist.Fill(xval, yval, ibin)
            
         counthist.Fill(xval, yval, 1.0)
 
-        print ibin, "Map Value"
+     #   print ibin, "Map Value"
         
 # Get N Bins
 nbins = int(maphist.GetMaximum())
 print "NBins I = ", nbins
 
 # Get Covariances (keep in 1E-38 cm^2)
 statcov = TH2D("analysis2_statcov","analysis2_statcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
 systcov = TH2D("analysis2_systcov","analysis2_systcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
 normcov = TH2D("analysis2_normcov","analysis2_normcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
 totcov = TH2D("analysis2_totcov","analysis2_totcov", nbins, 0.0, float(nbins), nbins, 0.0, float(nbins));
 
 with open("rps_statsCov_analysis2.txt") as f:
     count = 0
     for line in f:
         count += 1
         
         if (count < 4): continue
         data = line.strip().split("|")
         if (len(data) < 1): continue
 
         xi, yi = GetIndex(data[0])
         cov    = float(data[1])
 
         statcov.SetBinContent(xi, yi, cov)
 
 with open("rps_systCov_analysis2.txt") as f:
     count = 0
     for line in f:
         count += 1
         
         if (count < 4): continue
         data = line.strip().split("|")
         if (len(data) < 1): continue
         
         xi, yi = GetIndex(data[0])
         cov    = float(data[1])
         
         systcov.SetBinContent(xi + 1, yi + 1, cov)
 
 with open("rps_fluxNormCov_analysis2.txt") as f:
     count = 0
     for line in f:
         count += 1
         
         if (count < 4): continue
         data = line.strip().split("|")
         if (len(data) < 1): continue
         
         xi, yi = GetIndex(data[0])
         cov    = float(data[1])
         
         normcov.SetBinContent(xi + 1, yi + 1, cov)
         
 totcov.Add(systcov)
 totcov.Add(statcov)
 totcov.Add(normcov)
 
 outfile.cd()
 datahist.Write()
 maphist.Write()
 counthist.Write()
 statcov.Write()
 systcov.Write()
 totcov.Write()    
 normcov.Write()    
 
 
 
+
+#  LocalWords:  xval
diff --git a/data/flux/minerva_flux.root b/data/flux/minerva_flux.root
new file mode 100644
index 0000000..ea16674
Binary files /dev/null and b/data/flux/minerva_flux.root differ
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 8454238..005d4ef 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -1,1519 +1,1519 @@
 # Doxyfile 1.6.1
 
 # This file describes the settings to be used by the documentation system
 # doxygen (www.doxygen.org) for a project
 #
 # All text after a hash (#) is considered a comment and will be ignored
 # The format is:
 #       TAG = value [value, ...]
 # For lists items can also be appended using:
 #       TAG += value [value, ...]
 # Values that contain spaces should be placed between quotes (" ")
 
 #---------------------------------------------------------------------------
 # Project related configuration options
 #---------------------------------------------------------------------------
 
 # This tag specifies the encoding used for all characters in the config file
 # that follow. The default is UTF-8 which is also the encoding used for all
 # text before the first occurrence of this tag. Doxygen uses libiconv (or the
 # iconv built into libc) for the transcoding. See
 # http://www.gnu.org/software/libiconv for the list of possible encodings.
 
 DOXYFILE_ENCODING      = UTF-8
 
 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded
 # by quotes) that should identify the project.
 
 PROJECT_NAME           = "NUISANCE"
 
 # The PROJECT_NUMBER tag can be used to enter a project or revision number.
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
 PROJECT_NUMBER         = "@ExtFit_VERSION_STRING@"
 
 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
 # base path where the generated documentation will be put.
 # If a relative path is entered, it will be relative to the location
 # where doxygen was started. If left blank the current directory will be used.
 
 OUTPUT_DIRECTORY       =
 
 # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
 # 4096 sub-directories (in 2 levels) under the output directory of each output
 # format and will distribute the generated files over these directories.
 # Enabling this option can be useful when feeding doxygen a huge amount of
 # source files, where putting all generated files in the same directory would
 # otherwise cause performance problems for the file system.
 
 CREATE_SUBDIRS         = NO
 
 # The OUTPUT_LANGUAGE tag is used to specify the language in which all
 # documentation generated by doxygen is written. Doxygen will use this
 # information to generate all constant output in the proper language.
 # The default language is English, other supported languages are:
 # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
 # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
 # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
 # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
 # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
 # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
 
 OUTPUT_LANGUAGE        = English
 
 # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
 # include brief member descriptions after the members that are listed in
 # the file and class documentation (similar to JavaDoc).
 # Set to NO to disable this.
 
 BRIEF_MEMBER_DESC      = YES
 
 # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
 # the brief description of a member or function before the detailed description.
 # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
 # brief descriptions will be completely suppressed.
 
 REPEAT_BRIEF           = YES
 
 # This tag implements a quasi-intelligent brief description abbreviator
 # that is used to form the text in various listings. Each string
 # in this list, if found as the leading text of the brief description, will be
 # stripped from the text and the result after processing the whole list, is
 # used as the annotated text. Otherwise, the brief description is used as-is.
 # If left blank, the following values are used ("$name" is automatically
 # replaced with the name of the entity): "The $name class" "The $name widget"
 # "The $name file" "is" "provides" "specifies" "contains"
 # "represents" "a" "an" "the"
 
 ABBREVIATE_BRIEF       =
 
 # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
 # Doxygen will generate a detailed section even if there is only a brief
 # description.
 
 ALWAYS_DETAILED_SEC    = NO
 
 # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
 # inherited members of a class in the documentation of that class as if those
 # members were ordinary class members. Constructors, destructors and assignment
 # operators of the base classes will not be shown.
 
 INLINE_INHERITED_MEMB  = NO
 
 # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
 # path before files name in the file list and in the header files. If set
 # to NO the shortest path that makes the file name unique will be used.
 
 FULL_PATH_NAMES        = YES
 
 # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
 # can be used to strip a user-defined part of the path. Stripping is
 # only done if one of the specified strings matches the left-hand part of
 # the path. The tag can be used to show relative paths in the file list.
 # If left blank the directory from which doxygen is run is used as the
 # path to strip.
 
 STRIP_FROM_PATH        =
 
 # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
 # the path mentioned in the documentation of a class, which tells
 # the reader which header file to include in order to use a class.
 # If left blank only the name of the header file containing the class
 # definition is used. Otherwise one should specify the include paths that
 # are normally passed to the compiler using the -I flag.
 
 STRIP_FROM_INC_PATH    =
 
 # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
 # (but less readable) file names. This can be useful is your file systems
 # doesn't support long names like on DOS, Mac, or CD-ROM.
 
 SHORT_NAMES            = NO
 
 # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
 # will interpret the first line (until the first dot) of a JavaDoc-style
 # comment as the brief description. If set to NO, the JavaDoc
 # comments will behave just like regular Qt-style comments
 # (thus requiring an explicit @brief command for a brief description.)
 
 JAVADOC_AUTOBRIEF      = NO
 
 # If the QT_AUTOBRIEF tag is set to YES then Doxygen will
 # interpret the first line (until the first dot) of a Qt-style
 # comment as the brief description. If set to NO, the comments
 # will behave just like regular Qt-style comments (thus requiring
 # an explicit \brief command for a brief description.)
 
 QT_AUTOBRIEF           = NO
 
 # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
 # treat a multi-line C++ special comment block (i.e. a block of //! or ///
 # comments) as a brief description. This used to be the default behaviour.
 # The new default is to treat a multi-line C++ comment block as a detailed
 # description. Set this tag to YES if you prefer the old behaviour instead.
 
 MULTILINE_CPP_IS_BRIEF = NO
 
 # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
 # member inherits the documentation from any documented member that it
 # re-implements.
 
 INHERIT_DOCS           = YES
 
 # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
 # a new page for each member. If set to NO, the documentation of a member will
 # be part of the file/class/namespace that contains it.
 
 SEPARATE_MEMBER_PAGES  = NO
 
 # The TAB_SIZE tag can be used to set the number of spaces in a tab.
 # Doxygen uses this value to replace tabs by spaces in code fragments.
 
 TAB_SIZE               = 8
 
 # This tag can be used to specify a number of aliases that acts
 # as commands in the documentation. An alias has the form "name=value".
 # For example adding "sideeffect=\par Side Effects:\n" will allow you to
 # put the command \sideeffect (or @sideeffect) in the documentation, which
 # will result in a user-defined paragraph with heading "Side Effects:".
 # You can put \n's in the value part of an alias to insert newlines.
 
 ALIASES                =
 
 # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
 # sources only. Doxygen will then generate output that is more tailored for C.
 # For instance, some of the names that are used will be different. The list
 # of all members will be omitted, etc.
 
 OPTIMIZE_OUTPUT_FOR_C  = YES
 
 # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
 # sources only. Doxygen will then generate output that is more tailored for
 # Java. For instance, namespaces will be presented as packages, qualified
 # scopes will look different, etc.
 
 OPTIMIZE_OUTPUT_JAVA   = NO
 
 # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
 # sources only. Doxygen will then generate output that is more tailored for
 # Fortran.
 
 OPTIMIZE_FOR_FORTRAN   = NO
 
 # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
 # sources. Doxygen will then generate output that is tailored for
 # VHDL.
 
 OPTIMIZE_OUTPUT_VHDL   = NO
 
 # Doxygen selects the parser to use depending on the extension of the files it parses.
 # With this tag you can assign which parser to use for a given extension.
 # Doxygen has a built-in mapping, but you can override or extend it using this tag.
 # The format is ext=language, where ext is a file extension, and language is one of
 # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
 # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
 # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
 # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
 
 EXTENSION_MAPPING      =
 
 # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
 # to include (a tag file for) the STL sources as input, then you should
 # set this tag to YES in order to let doxygen match functions declarations and
 # definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
 # func(std::string) {}). This also make the inheritance and collaboration
 # diagrams that involve STL classes more complete and accurate.
 
 BUILTIN_STL_SUPPORT    = YES
 
 # If you use Microsoft's C++/CLI language, you should set this option to YES to
 # enable parsing support.
 
 CPP_CLI_SUPPORT        = NO
 
 # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
 # Doxygen will parse them like normal C++ but will assume all classes use public
 # instead of private inheritance when no explicit protection keyword is present.
 
 SIP_SUPPORT            = NO
 
 # For Microsoft's IDL there are propget and propput attributes to indicate getter
 # and setter methods for a property. Setting this option to YES (the default)
 # will make doxygen to replace the get and set methods by a property in the
 # documentation. This will only work if the methods are indeed getting or
 # setting a simple type. If this is not the case, or you want to show the
 # methods anyway, you should set this option to NO.
 
 IDL_PROPERTY_SUPPORT   = YES
 
 # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
 # tag is set to YES, then doxygen will reuse the documentation of the first
 # member in the group (if any) for the other members of the group. By default
 # all members of a group must be documented explicitly.
 
 DISTRIBUTE_GROUP_DOC   = NO
 
 # Set the SUBGROUPING tag to YES (the default) to allow class member groups of
 # the same type (for instance a group of public functions) to be put as a
 # subgroup of that type (e.g. under the Public Functions section). Set it to
 # NO to prevent subgrouping. Alternatively, this can be done per class using
 # the \nosubgrouping command.
 
 SUBGROUPING            = YES
 
 # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
 # is documented as struct, union, or enum with the name of the typedef. So
 # typedef struct TypeS {} TypeT, will appear in the documentation as a struct
 # with name TypeT. When disabled the typedef will appear as a member of a file,
 # namespace, or class. And the struct will be named TypeS. This can typically
 # be useful for C code in case the coding convention dictates that all compound
 # types are typedef'ed and only the typedef is referenced, never the tag name.
 
 TYPEDEF_HIDES_STRUCT   = NO
 
 # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
 # determine which symbols to keep in memory and which to flush to disk.
 # When the cache is full, less often used symbols will be written to disk.
 # For small to medium size projects (<1000 input files) the default value is
 # probably good enough. For larger projects a too small cache size can cause
 # doxygen to be busy swapping symbols to and from disk most of the time
 # causing a significant performance penality.
 # If the system has enough physical memory increasing the cache will improve the
 # performance by keeping more symbols in memory. Note that the value works on
 # a logarithmic scale so increasing the size by one will rougly double the
 # memory usage. The cache size is given by this formula:
 # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
 # corresponding to a cache size of 2^16 = 65536 symbols
 
 SYMBOL_CACHE_SIZE      = 0
 
 #---------------------------------------------------------------------------
 # Build related configuration options
 #---------------------------------------------------------------------------
 
 # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
 # documentation are documented, even if no documentation was available.
 # Private class members and static file members will be hidden unless
 # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
 
 EXTRACT_ALL            = YES
 
 # If the EXTRACT_PRIVATE tag is set to YES all private members of a class
 # will be included in the documentation.
 
 EXTRACT_PRIVATE        = YES
 
 # If the EXTRACT_STATIC tag is set to YES all static members of a file
 # will be included in the documentation.
 
 EXTRACT_STATIC         = NO
 
 # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
 # defined locally in source files will be included in the documentation.
 # If set to NO only classes defined in header files are included.
 
 EXTRACT_LOCAL_CLASSES  = YES
 
 # This flag is only useful for Objective-C code. When set to YES local
 # methods, which are defined in the implementation section but not in
 # the interface are included in the documentation.
 # If set to NO (the default) only methods in the interface are included.
 
 EXTRACT_LOCAL_METHODS  = YES
 
 # If this flag is set to YES, the members of anonymous namespaces will be
 # extracted and appear in the documentation as a namespace called
 # 'anonymous_namespace{file}', where file will be replaced with the base
 # name of the file that contains the anonymous namespace. By default
 # anonymous namespace are hidden.
 
 EXTRACT_ANON_NSPACES   = YES
 
 # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
 # undocumented members of documented classes, files or namespaces.
 # If set to NO (the default) these members will be included in the
 # various overviews, but no documentation section is generated.
 # This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_MEMBERS     = NO
 
 # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
 # undocumented classes that are normally visible in the class hierarchy.
 # If set to NO (the default) these classes will be included in the various
 # overviews. This option has no effect if EXTRACT_ALL is enabled.
 
 HIDE_UNDOC_CLASSES     = NO
 
 # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
 # friend (class|struct|union) declarations.
 # If set to NO (the default) these declarations will be included in the
 # documentation.
 
 HIDE_FRIEND_COMPOUNDS  = NO
 
 # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
 # documentation blocks found inside the body of a function.
 # If set to NO (the default) these blocks will be appended to the
 # function's detailed documentation block.
 
 HIDE_IN_BODY_DOCS      = NO
 
 # The INTERNAL_DOCS tag determines if documentation
 # that is typed after a \internal command is included. If the tag is set
 # to NO (the default) then the documentation will be excluded.
 # Set it to YES to include the internal documentation.
 
 INTERNAL_DOCS          = NO
 
 # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
 # file names in lower-case letters. If set to YES upper-case letters are also
 # allowed. This is useful if you have classes or files whose names only differ
 # in case and if your file system supports case sensitive file names. Windows
 # and Mac users are advised to set this option to NO.
 
 CASE_SENSE_NAMES       = YES
 
 # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
 # will show members with their full class and namespace scopes in the
 # documentation. If set to YES the scope will be hidden.
 
 HIDE_SCOPE_NAMES       = NO
 
 # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
 # will put a list of the files that are included by a file in the documentation
 # of that file.
 
 SHOW_INCLUDE_FILES     = YES
 
 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
 # is inserted in the documentation for inline members.
 
 INLINE_INFO            = YES
 
 # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
 # will sort the (detailed) documentation of file and class members
 # alphabetically by member name. If set to NO the members will appear in
 # declaration order.
 
 SORT_MEMBER_DOCS       = YES
 
 # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
 # brief documentation of file, namespace and class members alphabetically
 # by member name. If set to NO (the default) the members will appear in
 # declaration order.
 
 SORT_BRIEF_DOCS        = NO
 
 # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
 
 SORT_MEMBERS_CTORS_1ST = NO
 
 # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
 # hierarchy of group names into alphabetical order. If set to NO (the default)
 # the group names will appear in their defined order.
 
 SORT_GROUP_NAMES       = NO
 
 # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
 # sorted by fully-qualified names, including namespaces. If set to
 # NO (the default), the class list will be sorted only by class name,
 # not including the namespace part.
 # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
 # Note: This option applies only to the class list, not to the
 # alphabetical list.
 
 SORT_BY_SCOPE_NAME     = NO
 
 # The GENERATE_TODOLIST tag can be used to enable (YES) or
 # disable (NO) the todo list. This list is created by putting \todo
 # commands in the documentation.
 
 GENERATE_TODOLIST      = YES
 
 # The GENERATE_TESTLIST tag can be used to enable (YES) or
 # disable (NO) the test list. This list is created by putting \test
 # commands in the documentation.
 
 GENERATE_TESTLIST      = YES
 
 # The GENERATE_BUGLIST tag can be used to enable (YES) or
 # disable (NO) the bug list. This list is created by putting \bug
 # commands in the documentation.
 
 GENERATE_BUGLIST       = YES
 
 # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
 # disable (NO) the deprecated list. This list is created by putting
 # \deprecated commands in the documentation.
 
 GENERATE_DEPRECATEDLIST= YES
 
 # The ENABLED_SECTIONS tag can be used to enable conditional
 # documentation sections, marked by \if sectionname ... \endif.
 
 ENABLED_SECTIONS       =
 
 # The MAX_INITIALIZER_LINES tag determines the maximum number of lines
 # the initial value of a variable or define consists of for it to appear in
 # the documentation. If the initializer consists of more lines than specified
 # here it will be hidden. Use a value of 0 to hide initializers completely.
 # The appearance of the initializer of individual variables and defines in the
 # documentation can be controlled using \showinitializer or \hideinitializer
 # command in the documentation regardless of this setting.
 
 MAX_INITIALIZER_LINES  = 30
 
 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated
 # at the bottom of the documentation of classes and structs. If set to YES the
 # list will mention the files that were used to generate the documentation.
 
 SHOW_USED_FILES        = YES
 
 # If the sources in your project are distributed over multiple directories
 # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
 # in the documentation. The default is NO.
 
 SHOW_DIRECTORIES       = NO
 
 # Set the SHOW_FILES tag to NO to disable the generation of the Files page.
 # This will remove the Files entry from the Quick Index and from the
 # Folder Tree View (if specified). The default is YES.
 
 SHOW_FILES             = YES
 
 # Set the SHOW_NAMESPACES tag to NO to disable the generation of the
 # Namespaces page.
 # This will remove the Namespaces entry from the Quick Index
 # and from the Folder Tree View (if specified). The default is YES.
 
 SHOW_NAMESPACES        = YES
 
 # The FILE_VERSION_FILTER tag can be used to specify a program or script that
 # doxygen should invoke to get the current version for each file (typically from
 # the version control system). Doxygen will invoke the program by executing (via
 # popen()) the command <command> <input-file>, where <command> is the value of
 # the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
 # provided by doxygen. Whatever the program writes to standard output
 # is used as the file version. See the manual for examples.
 
 FILE_VERSION_FILTER    =
 
 # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
 # doxygen. The layout file controls the global structure of the generated output files
 # in an output format independent way. The create the layout file that represents
 # doxygen's defaults, run doxygen with the -l option. You can optionally specify a
 # file name after the option, if omitted DoxygenLayout.xml will be used as the name
 # of the layout file.
 
 LAYOUT_FILE            =
 
 #---------------------------------------------------------------------------
 # configuration options related to warning and progress messages
 #---------------------------------------------------------------------------
 
 # The QUIET tag can be used to turn on/off the messages that are generated
 # by doxygen. Possible values are YES and NO. If left blank NO is used.
 
 QUIET                  = NO
 
 # The WARNINGS tag can be used to turn on/off the warning messages that are
 # generated by doxygen. Possible values are YES and NO. If left blank
 # NO is used.
 
 WARNINGS               = YES
 
 # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
 # for undocumented members. If EXTRACT_ALL is set to YES then this flag will
 # automatically be disabled.
 
 WARN_IF_UNDOCUMENTED   = YES
 
 # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
 # potential errors in the documentation, such as not documenting some
 # parameters in a documented function, or documenting parameters that
 # don't exist or using markup commands wrongly.
 
 WARN_IF_DOC_ERROR      = YES
 
 # This WARN_NO_PARAMDOC option can be abled to get warnings for
 # functions that are documented, but have no documentation for their parameters
 # or return value. If set to NO (the default) doxygen will only warn about
 # wrong or incomplete parameter documentation, but not about the absence of
 # documentation.
 
 WARN_NO_PARAMDOC       = NO
 
 # The WARN_FORMAT tag determines the format of the warning messages that
 # doxygen can produce. The string should contain the $file, $line, and $text
 # tags, which will be replaced by the file and line number from which the
 # warning originated and the warning text. Optionally the format may contain
 # $version, which will be replaced by the version of the file (if it could
 # be obtained via FILE_VERSION_FILTER)
 
 WARN_FORMAT            = "$file:$line: $text"
 
 # The WARN_LOGFILE tag can be used to specify a file to which warning
 # and error messages should be written. If left blank the output is written
 # to stderr.
 
 WARN_LOGFILE           =
 
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
 
 # The INPUT tag can be used to specify the files and/or directories that contain
 # documented source files. You may enter file names like "myfile.cpp" or
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
 INPUT                  = @CMAKE_SOURCE_DIR@/src/ @CMAKE_SOURCE_DIR@/doc/
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
 # also the default input encoding. Doxygen uses libiconv (or the iconv built
 # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
 # the list of possible encodings.
 
 INPUT_ENCODING         = UTF-8
 
 # If the value of the INPUT tag contains directories, you can use the
 # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
 # and *.h) to filter out the source-files in the directories. If left
 # blank the following patterns are tested:
 # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
 # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
 
 FILE_PATTERNS          = *.dox *.cxx *.h
 
 # The RECURSIVE tag can be used to turn specify whether or not subdirectories
 # should be searched for input files as well. Possible values are YES and NO.
 # If left blank NO is used.
 
 RECURSIVE              = YES
 
 # The EXCLUDE tag can be used to specify files and/or directories that should
 # excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
 EXCLUDE                = ANL BEBC BNL Devel FNAL GGM K2K MCStudies MINERvA MiniBooNE T2K
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
 # directories that are symbolic links (a Unix filesystem feature) are excluded
 # from the input.
 
 EXCLUDE_SYMLINKS       = NO
 
 # If the value of the INPUT tag contains directories, you can use the
 # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
 # certain files from those directories. Note that the wildcards are matched
 # against the file with absolute path, so to exclude all test directories
 # for example use the pattern */test/*
 
 EXCLUDE_PATTERNS       = *ROOT_DICT*
 
 # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
 # (namespaces, classes, functions, etc.) that should be excluded from the
 # output. The symbol name can be a fully qualified name, a word, or if the
 # wildcard * is used, a substring. Examples: ANamespace, AClass,
 # AClass::ANamespace, ANamespace::*Test
 
 EXCLUDE_SYMBOLS        =
 
 # The EXAMPLE_PATH tag can be used to specify one or more files or
 # directories that contain example code fragments that are included (see
 # the \include command).
 
 EXAMPLE_PATH           =
 
 # If the value of the EXAMPLE_PATH tag contains directories, you can use the
 # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
 # and *.h) to filter out the source-files in the directories. If left
 # blank all files are included.
 
 EXAMPLE_PATTERNS       =
 
 # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
 # searched for input files to be used with the \include or \dontinclude
 # commands irrespective of the value of the RECURSIVE tag.
 # Possible values are YES and NO. If left blank NO is used.
 
 EXAMPLE_RECURSIVE      = NO
 
 # The IMAGE_PATH tag can be used to specify one or more files or
 # directories that contain image that are included in the documentation (see
 # the \image command).
 
 IMAGE_PATH             =
 
 # The INPUT_FILTER tag can be used to specify a program that doxygen should
 # invoke to filter for each input file. Doxygen will invoke the filter program
 # by executing (via popen()) the command <filter> <input-file>, where <filter>
 # is the value of the INPUT_FILTER tag, and <input-file> is the name of an
 # input file. Doxygen will then use the output that the filter program writes
 # to standard output.
 # If FILTER_PATTERNS is specified, this tag will be
 # ignored.
 
 INPUT_FILTER           =
 
 # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
 # basis.
 # Doxygen will compare the file name with each pattern and apply the
 # filter if there is a match.
 # The filters are a list of the form:
 # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
 # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
 # is applied to all files.
 
 FILTER_PATTERNS        =
 
 # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
 # INPUT_FILTER) will be used to filter the input files when producing source
 # files to browse (i.e. when SOURCE_BROWSER is set to YES).
 
 FILTER_SOURCE_FILES    = NO
 
 #---------------------------------------------------------------------------
 # configuration options related to source browsing
 #---------------------------------------------------------------------------
 
 # If the SOURCE_BROWSER tag is set to YES then a list of source files will
 # be generated. Documented entities will be cross-referenced with these sources.
 # Note: To get rid of all source code in the generated output, make sure also
 # VERBATIM_HEADERS is set to NO.
 
 SOURCE_BROWSER         = YES
 
 # Setting the INLINE_SOURCES tag to YES will include the body
 # of functions and classes directly in the documentation.
 
 INLINE_SOURCES         = NO
 
 # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
 # doxygen to hide any special comment blocks from generated source code
 # fragments. Normal C and C++ comments will always remain visible.
 
 STRIP_CODE_COMMENTS    = YES
 
 # If the REFERENCED_BY_RELATION tag is set to YES
 # then for each documented function all documented
 # functions referencing it will be listed.
 
 REFERENCED_BY_RELATION = NO
 
 # If the REFERENCES_RELATION tag is set to YES
 # then for each documented function all documented entities
 # called/used by that function will be listed.
 
 REFERENCES_RELATION    = NO
 
 # If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
 # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
 # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
 # link to the source code.
 # Otherwise they will link to the documentation.
 
 REFERENCES_LINK_SOURCE = YES
 
 # If the USE_HTAGS tag is set to YES then the references to source code
 # will point to the HTML generated by the htags(1) tool instead of doxygen
 # built-in source browser. The htags tool is part of GNU's global source
 # tagging system (see http://www.gnu.org/software/global/global.html). You
 # will need version 4.8.6 or higher.
 
 USE_HTAGS              = NO
 
 # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
 # will generate a verbatim copy of the header file for each class for
 # which an include is specified. Set to NO to disable this.
 
 VERBATIM_HEADERS       = YES
 
 #---------------------------------------------------------------------------
 # configuration options related to the alphabetical class index
 #---------------------------------------------------------------------------
 
 # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
 # of all compounds will be generated. Enable this if the project
 # contains a lot of classes, structs, unions or interfaces.
 
 ALPHABETICAL_INDEX     = NO
 
 # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
 # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
 # in which this list will be split (can be a number in the range [1..20])
 
 COLS_IN_ALPHA_INDEX    = 5
 
 # In case all classes in a project start with a common prefix, all
 # classes will be put under the same header in the alphabetical index.
 # The IGNORE_PREFIX tag can be used to specify one or more prefixes that
 # should be ignored while generating the index headers.
 
 IGNORE_PREFIX          =
 
 #---------------------------------------------------------------------------
 # configuration options related to the HTML output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_HTML tag is set to YES (the default) Doxygen will
 # generate HTML output.
 
 GENERATE_HTML          = YES
 
 # The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `html' will be used as the default path.
 
 HTML_OUTPUT            = html
 
 # The HTML_FILE_EXTENSION tag can be used to specify the file extension for
 # each generated HTML page (for example: .htm,.php,.asp). If it is left blank
 # doxygen will generate files with .html extension.
 
 HTML_FILE_EXTENSION    = .html
 
 # The HTML_HEADER tag can be used to specify a personal HTML header for
 # each generated HTML page. If it is left blank doxygen will generate a
 # standard header.
 
 HTML_HEADER            =
 
 # The HTML_FOOTER tag can be used to specify a personal HTML footer for
 # each generated HTML page. If it is left blank doxygen will generate a
 # standard footer.
 
 HTML_FOOTER            =
 
 # If the HTML_TIMESTAMP tag is set to YES then the generated HTML
 # documentation will contain the timesstamp.
 
 HTML_TIMESTAMP         = NO
 
 # The HTML_STYLESHEET tag can be used to specify a user-defined cascading
 # style sheet that is used by each HTML page. It can be used to
 # fine-tune the look of the HTML output. If the tag is left blank doxygen
 # will generate a default style sheet. Note that doxygen will try to copy
 # the style sheet file to the HTML output directory, so don't put your own
 # stylesheet in the HTML output directory as well, or it will be erased!
 
 HTML_STYLESHEET        =
 
 # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
 # files or namespaces will be aligned in HTML using tables. If set to
 # NO a bullet list will be used.
 
 HTML_ALIGN_MEMBERS     = YES
 
 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
 # documentation will contain sections that can be hidden and shown after the
 # page has loaded. For this to work a browser that supports
 # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
 # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
 
 HTML_DYNAMIC_SECTIONS  = NO
 
 # If the GENERATE_DOCSET tag is set to YES, additional index files
 # will be generated that can be used as input for Apple's Xcode 3
 # integrated development environment, introduced with OSX 10.5 (Leopard).
 # To create a documentation set, doxygen will generate a Makefile in the
 # HTML output directory. Running make will produce the docset in that
 # directory and running "make install" will install the docset in
 # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
 # it at startup.
 # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
 
 GENERATE_DOCSET        = NO
 
 # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
 # feed. A documentation feed provides an umbrella under which multiple
 # documentation sets from a single provider (such as a company or product suite)
 # can be grouped.
 
 DOCSET_FEEDNAME        = "Doxygen generated docs"
 
 # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
 # should uniquely identify the documentation set bundle. This should be a
 # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
 # will append .docset to the name.
 
 DOCSET_BUNDLE_ID       = org.doxygen.Project
 
 # If the GENERATE_HTMLHELP tag is set to YES, additional index files
 # will be generated that can be used as input for tools like the
 # Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
 # of the generated HTML documentation.
 
 GENERATE_HTMLHELP      = NO
 
 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
 # be used to specify the file name of the resulting .chm file. You
 # can add a path in front of the file if the result should not be
 # written to the html output directory.
 
 CHM_FILE               =
 
 # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
 # be used to specify the location (absolute path including file name) of
 # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
 # the HTML help compiler on the generated index.hhp.
 
 HHC_LOCATION           =
 
 # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
 # controls if a separate .chi index file is generated (YES) or that
 # it should be included in the master .chm file (NO).
 
 GENERATE_CHI           = NO
 
 # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
 # is used to encode HtmlHelp index (hhk), content (hhc) and project file
 # content.
 
 CHM_INDEX_ENCODING     =
 
 # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
 # controls whether a binary table of contents is generated (YES) or a
 # normal table of contents (NO) in the .chm file.
 
 BINARY_TOC             = NO
 
 # The TOC_EXPAND flag can be set to YES to add extra items for group members
 # to the contents of the HTML help documentation and to the tree view.
 
 TOC_EXPAND             = NO
 
 # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
 # are set, an additional index file will be generated that can be used as input for
 # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
 # HTML documentation.
 
 GENERATE_QHP           = NO
 
 # If the QHG_LOCATION tag is specified, the QCH_FILE tag can
 # be used to specify the file name of the resulting .qch file.
 # The path specified is relative to the HTML output folder.
 
 QCH_FILE               =
 
 # The QHP_NAMESPACE tag specifies the namespace to use when generating
 # Qt Help Project output. For more information please see
 # http://doc.trolltech.com/qthelpproject.html#namespace
 
 QHP_NAMESPACE          =
 
 # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
 # Qt Help Project output. For more information please see
 # http://doc.trolltech.com/qthelpproject.html#virtual-folders
 
 QHP_VIRTUAL_FOLDER     = doc
 
 # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
 # For more information please see
 # http://doc.trolltech.com/qthelpproject.html#custom-filters
 
 QHP_CUST_FILTER_NAME   =
 
 # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
 # <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
 
 QHP_CUST_FILTER_ATTRS  =
 
 # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
 # filter section matches.
 # <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
 
 QHP_SECT_FILTER_ATTRS  =
 
 # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
 # be used to specify the location of Qt's qhelpgenerator.
 # If non-empty doxygen will try to run qhelpgenerator on the generated
 # .qhp file.
 
 QHG_LOCATION           =
 
 # The DISABLE_INDEX tag can be used to turn on/off the condensed index at
 # top of each HTML page. The value NO (the default) enables the index and
 # the value YES disables it.
 
 DISABLE_INDEX          = NO
 
 # This tag can be used to set the number of enum values (range [1..20])
 # that doxygen will group on one line in the generated HTML documentation.
 
 ENUM_VALUES_PER_LINE   = 4
 
 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
 # structure should be generated to display hierarchical information.
 # If the tag value is set to YES, a side panel will be generated
 # containing a tree-like index structure (just like the one that
 # is generated for HTML Help). For this to work a browser that supports
 # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
 # Windows users are probably better off using the HTML help feature.
 
 GENERATE_TREEVIEW      = NO
 
 # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
 # and Class Hierarchy pages using a tree view instead of an ordered list.
 
 USE_INLINE_TREES       = NO
 
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
 # used to set the initial width (in pixels) of the frame in which the tree
 # is shown.
 
 TREEVIEW_WIDTH         = 250
 
 # Use this tag to change the font size of Latex formulas included
 # as images in the HTML documentation. The default is 10. Note that
 # when you change the font size after a successful doxygen run you need
 # to manually remove any form_*.png images from the HTML output directory
 # to force them to be regenerated.
 
 FORMULA_FONTSIZE       = 10
 
 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
 # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP)
 # there is already a search function so this one should typically
 # be disabled.
 
 SEARCHENGINE           = YES
 
 #---------------------------------------------------------------------------
 # configuration options related to the LaTeX output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
 # generate Latex output.
 
 GENERATE_LATEX         = YES
 
 # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `latex' will be used as the default path.
 
 LATEX_OUTPUT           = latex
 
 # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
 # invoked. If left blank `latex' will be used as the default command name.
 
 LATEX_CMD_NAME         = latex
 
 # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
 # generate index for LaTeX. If left blank `makeindex' will be used as the
 # default command name.
 
 MAKEINDEX_CMD_NAME     = makeindex
 
 # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
 # LaTeX documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_LATEX          = NO
 
 # The PAPER_TYPE tag can be used to set the paper type that is used
 # by the printer. Possible values are: a4, a4wide, letter, legal and
 # executive. If left blank a4wide will be used.
 
 PAPER_TYPE             = a4wide
 
 # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
 # packages that should be included in the LaTeX output.
 
 EXTRA_PACKAGES         =
 
 # The LATEX_HEADER tag can be used to specify a personal LaTeX header for
 # the generated latex document. The header should contain everything until
 # the first chapter. If it is left blank doxygen will generate a
 # standard header. Notice: only use this tag if you know what you are doing!
 
 LATEX_HEADER           =
 
 # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
 # is prepared for conversion to pdf (using ps2pdf). The pdf file will
 # contain links (just like the HTML output) instead of page references
 # This makes the output suitable for online browsing using a pdf viewer.
 
 PDF_HYPERLINKS         = YES
 
 # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
 # plain latex in the generated Makefile. Set this option to YES to get a
 # higher quality PDF documentation.
 
 USE_PDFLATEX           = YES
 
 # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
 # command to the generated LaTeX files. This will instruct LaTeX to keep
 # running if errors occur, instead of asking the user for help.
 # This option is also used when generating formulas in HTML.
 
 LATEX_BATCHMODE        = NO
 
 # If LATEX_HIDE_INDICES is set to YES then doxygen will not
 # include the index chapters (such as File Index, Compound Index, etc.)
 # in the output.
 
 LATEX_HIDE_INDICES     = NO
 
 # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
 
-LATEX_SOURCE_CODE      = YES
+LATEX_SOURCE_CODE      = NO
 
 #---------------------------------------------------------------------------
 # configuration options related to the RTF output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
 # The RTF output is optimized for Word 97 and may not look very pretty with
 # other RTF readers or editors.
 
 GENERATE_RTF           = NO
 
 # The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `rtf' will be used as the default path.
 
 RTF_OUTPUT             = rtf
 
 # If the COMPACT_RTF tag is set to YES Doxygen generates more compact
 # RTF documents. This may be useful for small projects and may help to
 # save some trees in general.
 
 COMPACT_RTF            = NO
 
 # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
 # will contain hyperlink fields. The RTF file will
 # contain links (just like the HTML output) instead of page references.
 # This makes the output suitable for online browsing using WORD or other
 # programs which support those fields.
 # Note: wordpad (write) and others do not support links.
 
 RTF_HYPERLINKS         = NO
 
 # Load stylesheet definitions from file. Syntax is similar to doxygen's
 # config file, i.e. a series of assignments. You only have to provide
 # replacements, missing definitions are set to their default value.
 
 RTF_STYLESHEET_FILE    =
 
 # Set optional variables used in the generation of an rtf document.
 # Syntax is similar to doxygen's config file.
 
 RTF_EXTENSIONS_FILE    =
 
 #---------------------------------------------------------------------------
 # configuration options related to the man page output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_MAN tag is set to YES (the default) Doxygen will
 # generate man pages
 
 GENERATE_MAN           = NO
 
 # The MAN_OUTPUT tag is used to specify where the man pages will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `man' will be used as the default path.
 
 MAN_OUTPUT             = man
 
 # The MAN_EXTENSION tag determines the extension that is added to
 # the generated man pages (default is the subroutine's section .3)
 
 MAN_EXTENSION          = .3
 
 # If the MAN_LINKS tag is set to YES and Doxygen generates man output,
 # then it will generate one additional man file for each entity
 # documented in the real man page(s). These additional files
 # only source the real man page, but without them the man command
 # would be unable to find the correct page. The default is NO.
 
 MAN_LINKS              = NO
 
 #---------------------------------------------------------------------------
 # configuration options related to the XML output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_XML tag is set to YES Doxygen will
 # generate an XML file that captures the structure of
 # the code including all documentation.
 
 GENERATE_XML           = NO
 
 # The XML_OUTPUT tag is used to specify where the XML pages will be put.
 # If a relative path is entered the value of OUTPUT_DIRECTORY will be
 # put in front of it. If left blank `xml' will be used as the default path.
 
 XML_OUTPUT             = xml
 
 # The XML_SCHEMA tag can be used to specify an XML schema,
 # which can be used by a validating XML parser to check the
 # syntax of the XML files.
 
 XML_SCHEMA             =
 
 # The XML_DTD tag can be used to specify an XML DTD,
 # which can be used by a validating XML parser to check the
 # syntax of the XML files.
 
 XML_DTD                =
 
 # If the XML_PROGRAMLISTING tag is set to YES Doxygen will
 # dump the program listings (including syntax highlighting
 # and cross-referencing information) to the XML output. Note that
 # enabling this will significantly increase the size of the XML output.
 
 XML_PROGRAMLISTING     = YES
 
 #---------------------------------------------------------------------------
 # configuration options for the AutoGen Definitions output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
 # generate an AutoGen Definitions (see autogen.sf.net) file
 # that captures the structure of the code including all
 # documentation. Note that this feature is still experimental
 # and incomplete at the moment.
 
 GENERATE_AUTOGEN_DEF   = NO
 
 #---------------------------------------------------------------------------
 # configuration options related to the Perl module output
 #---------------------------------------------------------------------------
 
 # If the GENERATE_PERLMOD tag is set to YES Doxygen will
 # generate a Perl module file that captures the structure of
 # the code including all documentation. Note that this
 # feature is still experimental and incomplete at the
 # moment.
 
 GENERATE_PERLMOD       = NO
 
 # If the PERLMOD_LATEX tag is set to YES Doxygen will generate
 # the necessary Makefile rules, Perl scripts and LaTeX code to be able
 # to generate PDF and DVI output from the Perl module output.
 
 PERLMOD_LATEX          = NO
 
 # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
 # nicely formatted so it can be parsed by a human reader.
 # This is useful
 # if you want to understand what is going on.
 # On the other hand, if this
 # tag is set to NO the size of the Perl module output will be much smaller
 # and Perl will parse it just the same.
 
 PERLMOD_PRETTY         = YES
 
 # The names of the make variables in the generated doxyrules.make file
 # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
 # This is useful so different doxyrules.make files included by the same
 # Makefile don't overwrite each other's variables.
 
 PERLMOD_MAKEVAR_PREFIX =
 
 #---------------------------------------------------------------------------
 # Configuration options related to the preprocessor
 #---------------------------------------------------------------------------
 
 # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
 # evaluate all C-preprocessor directives found in the sources and include
 # files.
 
 ENABLE_PREPROCESSING   = YES
 
 # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
 # names in the source code. If set to NO (the default) only conditional
 # compilation will be performed. Macro expansion can be done in a controlled
 # way by setting EXPAND_ONLY_PREDEF to YES.
 
 MACRO_EXPANSION        = NO
 
 # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
 # then the macro expansion is limited to the macros specified with the
 # PREDEFINED and EXPAND_AS_DEFINED tags.
 
 EXPAND_ONLY_PREDEF     = NO
 
 # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
 # in the INCLUDE_PATH (see below) will be search if a #include is found.
 
 SEARCH_INCLUDES        = YES
 
 # The INCLUDE_PATH tag can be used to specify one or more directories that
 # contain include files that are not input files but should be processed by
 # the preprocessor.
 
 INCLUDE_PATH           = ./
 
 # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
 # patterns (like *.h and *.hpp) to filter out the header-files in the
 # directories. If left blank, the patterns specified with FILE_PATTERNS will
 # be used.
 
 INCLUDE_FILE_PATTERNS  =
 
 # The PREDEFINED tag can be used to specify one or more macro names that
 # are defined before the preprocessor is started (similar to the -D option of
 # gcc). The argument of the tag is a list of macros of the form: name
 # or name=definition (no spaces). If the definition and the = are
 # omitted =1 is assumed. To prevent a macro definition from being
 # undefined via #undef or recursively expanded use the := operator
 # instead of the = operator.
 
 PREDEFINED             =
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
 # this tag can be used to specify a list of macro names that should be expanded.
 # The macro definition that is found in the sources will be used.
 # Use the PREDEFINED tag if you want to use a different macro definition.
 
 EXPAND_AS_DEFINED      =
 
 # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
 # doxygen's preprocessor will remove all function-like macros that are alone
 # on a line, have an all uppercase name, and do not end with a semicolon. Such
 # function macros are typically used for boiler-plate code, and will confuse
 # the parser if not removed.
 
 SKIP_FUNCTION_MACROS   = YES
 
 #---------------------------------------------------------------------------
 # Configuration::additions related to external references
 #---------------------------------------------------------------------------
 
 # The TAGFILES option can be used to specify one or more tagfiles.
 # Optionally an initial location of the external documentation
 # can be added for each tagfile. The format of a tag file without
 # this location is as follows:
 #
 # TAGFILES = file1 file2 ...
 # Adding location for the tag files is done as follows:
 #
 # TAGFILES = file1=loc1 "file2 = loc2" ...
 # where "loc1" and "loc2" can be relative or absolute paths or
 # URLs. If a location is present for each tag, the installdox tool
 # does not have to be run to correct the links.
 # Note that each tag file must have a unique name
 # (where the name does NOT include the path)
 # If a tag file is not located in the directory in which doxygen
 # is run, you must also specify the path to the tagfile here.
 
 TAGFILES               =
 
 # When a file name is specified after GENERATE_TAGFILE, doxygen will create
 # a tag file that is based on the input files it reads.
 
 GENERATE_TAGFILE       =
 
 # If the ALLEXTERNALS tag is set to YES all external classes will be listed
 # in the class index. If set to NO only the inherited external classes
 # will be listed.
 
 ALLEXTERNALS           = NO
 
 # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
 # in the modules index. If set to NO, only the current project's groups will
 # be listed.
 
 EXTERNAL_GROUPS        = YES
 
 # The PERL_PATH should be the absolute path and name of the perl script
 # interpreter (i.e. the result of `which perl').
 
 PERL_PATH              = /usr/bin/perl
 
 #---------------------------------------------------------------------------
 # Configuration options related to the dot tool
 #---------------------------------------------------------------------------
 
 # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
 # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
 # or super classes. Setting the tag to NO turns the diagrams off. Note that
 # this option is superseded by the HAVE_DOT option below. This is only a
 # fallback. It is recommended to install and use dot, since it yields more
 # powerful graphs.
 
 CLASS_DIAGRAMS         = YES
 
 # You can define message sequence charts within doxygen comments using the \msc
 # command. Doxygen will then run the mscgen tool (see
 # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
 # documentation. The MSCGEN_PATH tag allows you to specify the directory where
 # the mscgen tool resides. If left empty the tool is assumed to be found in the
 # default search path.
 
 MSCGEN_PATH            =
 
 # If set to YES, the inheritance and collaboration graphs will hide
 # inheritance and usage relations if the target is undocumented
 # or is not a class.
 
 HIDE_UNDOC_RELATIONS   = YES
 
 # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
 # available from the path. This tool is part of Graphviz, a graph visualization
 # toolkit from AT&T and Lucent Bell Labs. The other options in this section
 # have no effect if this option is set to NO (the default)
 
 HAVE_DOT               = NO
 
 # By default doxygen will write a font called FreeSans.ttf to the output
 # directory and reference it in all dot files that doxygen generates. This
 # font does not include all possible unicode characters however, so when you need
 # these (or just want a differently looking font) you can specify the font name
 # using DOT_FONTNAME. You need need to make sure dot is able to find the font,
 # which can be done by putting it in a standard location or by setting the
 # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
 # containing the font.
 
 DOT_FONTNAME           = FreeSans
 
 # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
 # The default size is 10pt.
 
 DOT_FONTSIZE           = 10
 
 # By default doxygen will tell dot to use the output directory to look for the
 # FreeSans.ttf font (which doxygen will put there itself). If you specify a
 # different font using DOT_FONTNAME you can set the path where dot
 # can find it using this tag.
 
 DOT_FONTPATH           =
 
 # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
 # will generate a graph for each documented class showing the direct and
 # indirect inheritance relations. Setting this tag to YES will force the
 # the CLASS_DIAGRAMS tag to NO.
 
 CLASS_GRAPH            = YES
 
 # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
 # will generate a graph for each documented class showing the direct and
 # indirect implementation dependencies (inheritance, containment, and
 # class references variables) of the class with other documented classes.
 
 COLLABORATION_GRAPH    = YES
 
 # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
 # will generate a graph for groups, showing the direct groups dependencies
 
 GROUP_GRAPHS           = YES
 
 # If the UML_LOOK tag is set to YES doxygen will generate inheritance and
 # collaboration diagrams in a style similar to the OMG's Unified Modeling
 # Language.
 
 UML_LOOK               = NO
 
 # If set to YES, the inheritance and collaboration graphs will show the
 # relations between templates and their instances.
 
 TEMPLATE_RELATIONS     = NO
 
 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
 # tags are set to YES then doxygen will generate a graph for each documented
 # file showing the direct and indirect include dependencies of the file with
 # other documented files.
 
 INCLUDE_GRAPH          = YES
 
 # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
 # HAVE_DOT tags are set to YES then doxygen will generate a graph for each
 # documented header file showing the documented files that directly or
 # indirectly include this file.
 
 INCLUDED_BY_GRAPH      = YES
 
 # If the CALL_GRAPH and HAVE_DOT options are set to YES then
 # doxygen will generate a call dependency graph for every global function
 # or class method. Note that enabling this option will significantly increase
 # the time of a run. So in most cases it will be better to enable call graphs
 # for selected functions only using the \callgraph command.
 
 CALL_GRAPH             = NO
 
 # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
 # doxygen will generate a caller dependency graph for every global function
 # or class method. Note that enabling this option will significantly increase
 # the time of a run. So in most cases it will be better to enable caller
 # graphs for selected functions only using the \callergraph command.
 
 CALLER_GRAPH           = NO
 
 # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
 # will graphical hierarchy of all classes instead of a textual one.
 
 GRAPHICAL_HIERARCHY    = YES
 
 # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
 # then doxygen will show the dependencies a directory has on other directories
 # in a graphical way. The dependency relations are determined by the #include
 # relations between the files in the directories.
 
 DIRECTORY_GRAPH        = YES
 
 # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
 # generated by dot. Possible values are png, jpg, or gif
 # If left blank png will be used.
 
 DOT_IMAGE_FORMAT       = png
 
 # The tag DOT_PATH can be used to specify the path where the dot tool can be
 # found. If left blank, it is assumed the dot tool can be found in the path.
 
 DOT_PATH               =
 
 # The DOTFILE_DIRS tag can be used to specify one or more directories that
 # contain dot files that are included in the documentation (see the
 # \dotfile command).
 
 DOTFILE_DIRS           =
 
 # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
 # nodes that will be shown in the graph. If the number of nodes in a graph
 # becomes larger than this value, doxygen will truncate the graph, which is
 # visualized by representing a node as a red box. Note that doxygen if the
 # number of direct children of the root node in a graph is already larger than
 # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
 # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
 
 DOT_GRAPH_MAX_NODES    = 50
 
 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
 # graphs generated by dot. A depth value of 3 means that only nodes reachable
 # from the root by following a path via at most 3 edges will be shown. Nodes
 # that lay further from the root node will be omitted. Note that setting this
 # option to 1 or 2 may greatly reduce the computation time needed for large
 # code bases. Also note that the size of a graph can be further restricted by
 # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
 
 MAX_DOT_GRAPH_DEPTH    = 0
 
 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
 # background. This is disabled by default, because dot on Windows does not
 # seem to support this out of the box. Warning: Depending on the platform used,
 # enabling this option may lead to badly anti-aliased labels on the edges of
 # a graph (i.e. they become hard to read).
 
 DOT_TRANSPARENT        = NO
 
 # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
 # files in one run (i.e. multiple -o and -T options on the command line). This
 # makes dot run faster, but since only newer versions of dot (>1.8.10)
 # support this, this feature is disabled by default.
 
 DOT_MULTI_TARGETS      = NO
 
 # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
 # generate a legend page explaining the meaning of the various boxes and
 # arrows in the dot generated graphs.
 
 GENERATE_LEGEND        = YES
 
 # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
 # remove the intermediate dot files that are used to generate
 # the various graphs.
 
 DOT_CLEANUP            = YES
diff --git a/parameters/config.xml b/parameters/config.xml
new file mode 100644
index 0000000..7dc9fb0
--- /dev/null
+++ b/parameters/config.xml
@@ -0,0 +1,176 @@
+<nuisance>
+<!-- # ###################################################### -->
+<!-- # 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='5'/>
+<config VERBOSITY='5'/>
+
+<!-- # ERROR goes from -->
+<!-- # 0 NONE -->
+<!-- # 1 FATAL -->
+<!-- # 2 WARN -->
+<config ERROR='2'/>
+<config TRACE='1'/>
+
+<config cores='2' />
+<config spline_test_throws='50' />
+<config spline_cores='6' />
+<config spline_chunks='10' />
+<config spline_procchunk='-1' />
+
+<config Electron_NThetaBins='4' />
+<config Electron_NEnergyBins='4' />
+<config Electron_ThetaWidth='2.0' />
+<config Electron_EnergyWidth='0.10' />
+
+<config RemoveFSIParticles='0' />
+<config RemoveUndefParticles='0' />
+<config RemoveNuclearParticles='0'/>
+<config logging.JointFCN.cxx='4'/>
+
+
+<!-- # 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'/>
+<config includeemptystackhists='0'/>
+<!-- # 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='1'/>
+<config EventManager='1'/>
+
+<!-- # 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/'/>
+<config SaveNuWroExtra='0' />
+
+<!-- # 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 -->
+<config 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/INCOV/DECOMP/CANVPDG/CANVMC'/>
+
+<!-- # Save the shape scaling applied with option SHAPE into the main MC hist -->
+<config saveshapescaling='0'/>
+
+<config CorrectGENIEMECNorm='1'/>
+
+<!-- # 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'/>
+<config WriteSeperateStacks='1'/>
+
+<!-- # 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'/>
+<config SignalReconfigures='0'/>
+
+</nuisance>
diff --git a/parameters/fitter.config.dat b/parameters/fitter.config.dat
index 17a988f..e8ab1ba 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
+# 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/INCOV/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
\ No newline at end of file
+config NumRangeSteps 50
diff --git a/profiling/runprofiler.sh b/profiling/runprofiler.sh
new file mode 100755
index 0000000..3f5b9ca
--- /dev/null
+++ b/profiling/runprofiler.sh
@@ -0,0 +1,22 @@
+#!/bin/env sh
+
+# Read Inputs
+PROFILEOUT=$1
+PROGRAM=$(which $2)
+ARGUMENTS=${@:3}
+PPROF=$EXT_FIT/build/Ext/src/gperftools/src/pprof
+
+# Log
+echo "Profiling : $PROGRAM"
+echo "Saving to : $CPUPROFILE"
+echo "Running : $PROGRAM $ARGUMENTS"
+
+# Run PROFILING
+echo ""
+CPUPROFILE=$PROFILEOUT $2 $ARGUMENTS
+
+# Make PDF + TXT
+echo ""
+echo "Building outputs"
+$PPROF --pdf $PROGRAM $PROFILEOUT > ${PROFILEOUT}.pdf
+$PPROF --text $PROGRAM $PROFILEOUT > ${PROFILEOUT}.txt
diff --git a/scripts/nuissamples b/scripts/nuissamples
new file mode 100755
index 0000000..01eb247
--- /dev/null
+++ b/scripts/nuissamples
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+for line in $(grep compare $EXT_FIT/src/FCN/SampleList.cxx)
+do
+    if [[ $line != *"compare"* ]];
+    then
+	continue
+    fi
+    line=${line//\!name\.compare\(/}
+    line=${line//\(/}
+    line=${line//\)/}
+    line=${line//\"/}
+
+    if [[ $line != *"$1"* ]];
+    then
+	continue
+    fi
+
+    echo ${2}${line}${3}
+done
diff --git a/src/ANL/._CMakeLists.txt~ b/src/ANL/._CMakeLists.txt~
new file mode 100644
index 0000000..89a44f4
Binary files /dev/null and b/src/ANL/._CMakeLists.txt~ differ
diff --git a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
index c4598ce..bf5b664 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DQ2_nu.cxx
@@ -1,112 +1,106 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CC1npip_Evt_1DQ2_nu.h"
 
-// The constructor
-// User can specify W < 1.4 or no W cut in std::string type (W14 or NOW, default reverts to NOW)
+
 //********************************************************************
-ANL_CC1npip_Evt_1DQ2_nu::ANL_CC1npip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
+ANL_CC1npip_Evt_1DQ2_nu::ANL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "ANL_CC1npip_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes = "EVT/SHAPE/DIAG/W14/NOW";
-
-  // User can specify W < 1.4 or no W cut
-  if (type.find("W14") != std::string::npos) {
-    HadCut = 1.4;
-  } else {
-    HadCut = 10.0;
-  }
-    
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_n/";
+  // 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.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) {
-    DataLocation += "ANL_CC1pip_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pip_on_n/ANL_CC1pip_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
   } else {
-    //DataLocation += "ANL_CC1pip_on_n_noEvents_Q2_noWcut_firstQ2rem.txt";
-    DataLocation += "ANL_CC1pip_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt";
-  }
-
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pip_on_n/ANL_CC1pip_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt" );
   }
 
-  SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  // Set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
+  
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral()/double(fNEvents));
 };
 
-
 //********************************************************************
 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;
+  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 d75b431..e99fc2b 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC1npip_Evt_1DQ2_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
+	ANL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey);
+	virtual ~ANL_CC1npip_Evt_1DQ2_nu() {};
 
- private:
-  double HadCut;
+	void FillEventVariables(FitEvent *event);
+	bool isSignal(FitEvent *event);
+
+private:
+	double HadCut;
 };
-  
+
 #endif
diff --git a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
index ae4d8c0..7e7f5ab 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.cxx
@@ -1,86 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CC1npip_Evt_1DcosmuStar_nu.h"
 
-// The constructor
-ANL_CC1npip_Evt_1DcosmuStar_nu::ANL_CC1npip_Evt_1DcosmuStar_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1npip_Evt_1DcosmuStar_nu";
-  fPlotTitles = "; cos(#theta*); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_n/ANL_CC1npip_cosmuStar.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+//********************************************************************
+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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
 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 5283818..b963bf3 100644
--- a/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1DcosmuStar_nu.h
@@ -1,40 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC1npip_Evt_1DcosmuStar_nu() {};
+	ANL_CC1npip_Evt_1DcosmuStar_nu(nuiskey samplekey);
 
-  void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
-  bool isSignal(FitEvent *event);
-  //void FillHistograms();
+	virtual ~ANL_CC1npip_Evt_1DcosmuStar_nu() {};
 
- private:
+	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 77e1c42..785bcfe 100644
--- a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.cxx
@@ -1,78 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CC1npip_Evt_1Dppi_nu.h"
 
-// The constructor
-ANL_CC1npip_Evt_1Dppi_nu::ANL_CC1npip_Evt_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1npip_Evt_1Dppi_nu";
-  fPlotTitles = "; p_{#pi} (MeV); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // ANL ppi has Enu < 1.5 GeV, W < 1.4 GeV
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_n/ANL_ppi_CC1npip.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/double(fNEvents)*(16./8.);
+//********************************************************************
+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.SetDescription(descrip);
+  // fSettings.SetTitle("ANL #nu_mu CC1n#pi^{+}");
+  // fSettings.SetPlotTitles("p_{#pi} (MeV); Number of events");
+  // fSettings.SetAllowedTypes("EVT/SHAPE/DIAG");
+  // fSettings.SetDefaultTypes("EVT/SHAPE/DIAG");
+  // fSettings.SetAllowedTargets("D,H");
+  // fSettings.SetAllowedSpecies("numu");
+  // fSettings.SetEnergyRange(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.;
+  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 387347c..a3adb06 100644
--- a/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h
+++ b/src/ANL/ANL_CC1npip_Evt_1Dppi_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC1npip_Evt_1Dppi_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  
-  //void ScaleEvents();
-  bool isSignal(FitEvent *event);
-  //void FillHistograms();
-  
- private:
+	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 a3a16ee..5a796ed 100644
--- a/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,138 +1,140 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-/** 
+/**
  * 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"
 
-// The constructor
-ANL_CC1npip_XSec_1DEnu_nu::ANL_CC1npip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) : wTrueCut(2.0), UseCorrectedData(true) {
-
-  // Measurement Details
-  fName = "ANL_CC1npip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fNormError = 0.20;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR/CORR/W14/W16/NOW";
-  
-  // User can specify "UNCORR" for uncorrected data
-  // Default is to use correction
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
-  } else {
-    UseCorrectedData = true;
-  }
+
+//********************************************************************
+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 (type.find("W14") != std::string::npos) {
-    wTrueCut = 1.4;
-  } else if (type.find("W16") != std::string::npos) {
-    wTrueCut = 1.6;
-  } else {
-    // In the case 
-    wTrueCut = 10.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) {
     ERR(FTL) << "Can not run ANL CC1pi+1n W < 1.6 GeV with CORRECTION, because the data DOES NOT EXIST" << std::endl;
     ERR(FTL) << "Correction exists for W < 1.4 GeV and no W cut data ONLY" << std::endl;
     ERR(FTL) << "Reverting to using uncorrected data!" << std::endl;
     UseCorrectedData = false;
   }
 
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
-
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile); 
-
   // Now read in different data depending on what the user has specified
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_n/";
+  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
+    // 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);
+
 
-  // Setup Plots
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // 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();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
 };
 
+
 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;
+  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 ed72006..26336aa 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC1npip_XSec_1DEnu_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
+	ANL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
+	virtual ~ANL_CC1npip_XSec_1DEnu_nu() {};
 
- private:
-  // What W cut are we imposing
-  double wTrueCut;
-  // Are we using corrected data?
-  bool UseCorrectedData;
+	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 1bfa1b0..1cbb60d 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.cxx
@@ -1,122 +1,121 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CC1pi0_Evt_1DQ2_nu.h"
 
-// The constructor
-ANL_CC1pi0_Evt_1DQ2_nu::ANL_CC1pi0_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1pi0_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG/W14/NOW";
-
-  // User can specify W < 1.4 or no W cut
-  if (type.find("W14") != std::string::npos) {
-    HadCut = 1.4;
-  } else {
-    HadCut = 10.0;
-  }
-
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pi0_on_n/";
+//********************************************************************
+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.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) {
-    DataLocation += "ANL_CC1pi0_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pi0_on_n/ANL_CC1pi0_on_n_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
   } else {
-    //DataLocation += "ANL_CC1pi0_on_n_noEvents_Q2_noWcut_firstQ2rem.txt";
-    DataLocation += "ANL_CC1pi0_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt";
-  }
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pi0_on_n/ANL_CC1pi0_on_n_noEvents_Q2_noWcut_HighQ2Gone.txt" );
   }
 
-  SetupMeasurement(inputfile, type, rw, fakeDataFile);
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  // Set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.);
-};
+  // 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;
+  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 fb62eac..d318924 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1pi0_Evt_1DQ2_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  virtual ~ANL_CC1pi0_Evt_1DQ2_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
-//  void ScaleEvents();
- // void FillHistograms();
+	ANL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey);
+	virtual ~ANL_CC1pi0_Evt_1DQ2_nu() {};
 
- private:
-  double HadCut;
+	void FillEventVariables(FitEvent *event);
+	bool isSignal(FitEvent *event);
+
+private:
+	double HadCut;
 };
-  
+
 #endif
diff --git a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
index 1f8c7b8..919263e 100644
--- a/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_Evt_1DcosmuStar_nu.cxx
@@ -1,86 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CC1pi0_Evt_1DcosmuStar_nu.h"
 
-// The constructor
-ANL_CC1pi0_Evt_1DcosmuStar_nu::ANL_CC1pi0_Evt_1DcosmuStar_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1pi0_Evt_1DcosmuStar_nu";
-  fPlotTitles = "; cos(#theta*); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pi0_on_n/ANL_CC1pi0_cosmuStar.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
-};
+//********************************************************************
+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 ecb696e..c2bc2fa 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 f5a3894..d083565 100644
--- a/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,132 +1,136 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /** 
  * 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"
 
-// The constructor
-ANL_CC1pi0_XSec_1DEnu_nu::ANL_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC1pi0_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 0.;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fNormError = 0.20;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR/CORR/W14/W16/NOW";
-
-  // User can specify "UNCORR" for uncorrected data
-  // Default is to use correction
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
-  } else {
-    UseCorrectedData = true;
-  }
+//********************************************************************
+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 no W cut (10 GeV)
-  if (type.find("W14") != std::string::npos) {
-    wTrueCut = 1.4;
-  } else if (type.find("W16") != std::string::npos) {
-    wTrueCut = 1.6;
-  } else {
-    wTrueCut = 10.0;
-  }
+  //                  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) {
     ERR(FTL) << "Can not run ANL CC1pi+1n W < 1.6 GeV with CORRECTION, because the data DOES NOT EXIST" << std::endl;
     ERR(FTL) << "Correction exists for W < 1.4 GeV and no W cut data ONLY" << std::endl;
     ERR(FTL) << "Reverting to using uncorrected data!" << std::endl;
     UseCorrectedData = false;
   }
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
-
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
   // Now read in different data depending on what the user has specified
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pi0_on_n/";
+  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.));
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents+0.)*(16./8.);
 };
 
 
 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 0703d25..4a9d65a 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 c7f0c24..4b7b236 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,127 +1,104 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_Evt_1DQ2_nu::ANL_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG/W14/NOW";
-
-  // User can specify W < 1.4 or no W cut
-  if (type.find("W14") != std::string::npos) {
-    HadCut = 1.4;
-  } else {
-    HadCut = 10.0;
-  }
-    
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/";
+
+//********************************************************************
+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.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) {
-    DataLocation += "ANL_CC1pip_on_p_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_Q2_W14GeV_rebin_firstQ2rem.txt" );
   } else {
-    //DataLocation += "ANL_CC1pip_on_p_noEvents_Q2_noW_firstQ2rem.txt";
-    DataLocation += "ANL_CC1pip_on_p_noEvents_Q2_noW_HighQ2Gone.txt";
-  }
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_Q2_noW_HighQ2Gone.txt" );
   }
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  FinaliseSampleSettings();
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral() / double(fNEvents));
 
-  // Set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
 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;
+  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);
 }
 
-/*
-void ANL_CC1ppip_Evt_1DQ2_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC1ppip_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_CC1ppip_Evt_1DQ2_nu.h b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
index 2abe377..b6f2464 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DQ2_nu.h
@@ -1,41 +1,39 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~ANL_CC1ppip_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
   double HadCut;
 
 };
   
 #endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
index 0ff7c2b..4f08b57 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.cxx
@@ -1,90 +1,105 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_Evt_1DcosmuStar_nu::ANL_CC1ppip_Evt_1DcosmuStar_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1DcosmuStar_nu";
-  fPlotTitles = "; cos(#theta*); Number of events";
-  EnuMin = 0;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_cosmuStar_1982.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
+
+
+//********************************************************************
+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 68e2c17..1823533 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosmuStar_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC1ppip_Evt_1DcosmuStar_nu(nuiskey samplekey);
   virtual ~ANL_CC1ppip_Evt_1DcosmuStar_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
 
 };
   
 #endif
diff --git a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
index dcb5dc6..06be048 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.cxx
@@ -1,121 +1,135 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_Evt_1DcosthAdler_nu::ANL_CC1ppip_Evt_1DcosthAdler_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1DcosthAdler_nu";
-  fPlotTitles = "; cos#theta_{Adler}; Number of events";
-  EnuMin = 0;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_costhAdler_1982.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+//********************************************************************
+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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
+
 void ANL_CC1ppip_Evt_1DcosthAdler_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;
 
   // Get the hadronic mass
   double hadMass = FitUtils::MpPi(Pp, Ppip);
   // Need to boost pion and muon into resonance rest-frame to get phi (e.g. see F. Sanchez arxiv 1511.00501v2)
   //
   // Get the resonance 4-vector
   TLorentzVector Pres = Ppip + Pp;
   // Boost in/outgoing particles into rest frame
   Ppip.Boost(-Pres.BoostVector());
   Pmu.Boost(-Pres.BoostVector());
   Pnu.Boost(Pres.BoostVector());
   // Define the vectors
   TVector3 PpipVect = Ppip.Vect();
   TVector3 PnuVect = Pnu.Vect();
   TVector3 PmuVect = Pmu.Vect();
   // Define the z-direction; should be same as Pres
-  TVector3 zVect = (PnuVect-PmuVect);
-  zVect *= 1/double(zVect.Mag());
+  TVector3 zVect = (PnuVect - PmuVect);
+  zVect *= 1 / double(zVect.Mag());
 
   // Then finally construct phi as the angle between pion projection and x axis
   double cosThAdler = -999;
   // ANL has a M(pi, p) < 1.4 GeV cut imposed
   if (hadMass < 1400) cosThAdler = cos(PpipVect.Angle(zVect));
 
   fXVar = cosThAdler;
 
   return;
 };
 
 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 bc2aec2..100af15 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h
+++ b/src/ANL/ANL_CC1ppip_Evt_1DcosthAdler_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC1ppip_Evt_1DcosthAdler_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
-  bool isSignal(FitEvent *event);
-  //void FillHistograms();
+	ANL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey);
+	virtual ~ANL_CC1ppip_Evt_1DcosthAdler_nu() {};
 
- private:
+	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 0e1d43e..1a41fb5 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dphi_nu.cxx
@@ -1,152 +1,164 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_Evt_1Dphi_nu::ANL_CC1ppip_Evt_1Dphi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1Dphi_nu";
-  fPlotTitles = "; #phi_{Adler}; Number of events";
-  EnuMin = 0;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_phiAdler_1982.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
 
-  TRandom3 rand;
+//********************************************************************
+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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
 void ANL_CC1ppip_Evt_1Dphi_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;
 
   // Get the hadronic mass
   double hadMass = FitUtils::MpPi(Pp, Ppip);
   // Need to boost pion and muon into resonance rest-frame to get phi (e.g. see F. Sanchez arxiv 1511.00501v2)
   //
   // Get the resonance 4-vector
   TLorentzVector Pres = Ppip + Pp;
   // Boost the outgoing and incoming particles into the resonance frame
   Pnu.Boost(Pres.BoostVector());
   Pmu.Boost(-Pres.BoostVector());
   Ppip.Boost(-Pres.BoostVector());
 
   // Get the vectors from the 4-vector
   TVector3 PmuVect = Pmu.Vect();
   TVector3 PnuVect = Pnu.Vect();
   TVector3 PresVect = Pres.Vect();
   TVector3 PpipVect = Ppip.Vect();
 
   // Define the z-direction
   TVector3 zVect = (PnuVect-PmuVect);
   zVect *= 1/double(zVect.Mag());
   // Define y direction as being z (resonance direction) x pmu*
   TVector3 yVect = zVect.Cross(PmuVect);
   // Normalise yVector
   yVect *= 1/double(yVect.Mag());
   // define x direction as being y X z
   TVector3 xVect = yVect.Cross(zVect);
   // Normalise zVector
   xVect *= 1/double(xVect.Mag());
 
   // Project pion onto z axis
   TVector3 PpipVectZ = zVect * PpipVect.Dot(zVect);
   // Then subtract this vector off the pion vector
   TVector3 PpipVectPlane = PpipVect - PpipVectZ;
 
   // Then finally construct phi as the angle between pion projection and x axis
   double phi = -999;
 
   // ANL has a M(pi, p) < 1.4 GeV cut imposed
   if (hadMass < 1400) {
     if (PpipVectPlane.Y() > 0) {
       phi = (180./M_PI)*PpipVectPlane.Angle(xVect);
     } else if (PpipVectPlane.Y() < 0) {
       phi = (180./M_PI)*(2*M_PI-PpipVectPlane.Angle(xVect));
     } else if (PpipVectPlane.Y() == 0) {
       double randNo = rand.Rndm();
       if (randNo > 0.5) {
         phi = (180./M_PI)*PpipVectPlane.Angle(xVect);
       } else {
         phi = (180./M_PI)*(2*M_PI-PpipVectPlane.Angle(xVect));
       }
     }
   }
 
   fXVar = phi;
 
   return;
 };
 
 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 e6aad41..80a304e 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 f8313af..1ce30b5 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dppi_nu.cxx
@@ -1,80 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
 */
 
 #include "ANL_CC1ppip_Evt_1Dppi_nu.h"
 
-// The constructor
-ANL_CC1ppip_Evt_1Dppi_nu::ANL_CC1ppip_Evt_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1Dppi_nu";
-  fPlotTitles = "; p_{#pi} (MeV); Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5; // Different EnuMax here, see M. Derrick et al, Phys Rev D, V23 N3, p572, Fig 2
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_ppi.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*(16./8.);
+
+//********************************************************************
+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.SetXTitle("p_{#pi} (MeV)");
+  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_ppi.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_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;
 
   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.;
+  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 83e34c3..01e1fe0 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  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 c374606..696f074 100644
--- a/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_Evt_1Dthpr_nu.cxx
@@ -1,80 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 /**
  * Derrick et al. Phys Rev D, Vol 23, Number 3, 1 Feb 1981, p 569-575
 */
 #include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
 
-// The constructor
-ANL_CC1ppip_Evt_1Dthpr_nu::ANL_CC1ppip_Evt_1Dthpr_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_CC1ppip_Evt_1Dthpr_nu";
-  fPlotTitles = "; cos #theta_{p}; Number of events";
-  EnuMin = 0;
-  EnuMax = 1.5; // Different EnuMax for cos(thpr), see Derrick et al, Phys Rev D V23 N3, p572 fig 3
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // ANL ppi has Enu < 1.5 GeV, W < 1.4 GeV
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_noEvents_thProt.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.))*(16./8.);
+//********************************************************************
+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));
+  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 392f7b8..488a52c 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 f6bc67a..1a0b143 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,134 +1,138 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_XSec_1DEnu_nu::ANL_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) : wTrueCut(2.0), UseCorrectedData(true) {
-
-  fName = "ANL_CC1ppip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR/CORR/W14/W16/NOW";
-
-  // User can specify "UNCORR" for uncorrected data
-  // Default is to use correction
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
-  } else {
-    UseCorrectedData = true;
-  }
+
+//********************************************************************
+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 (type.find("W14") != std::string::npos) {
-    wTrueCut = 1.4;
-  } else if (type.find("W16") != std::string::npos) {
-    wTrueCut = 1.6;
-  } else {
-    wTrueCut = 10.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) {
     ERR(FTL) << "Can not run ANL CC1pi+1p W < 1.6 GeV with CORRECTION, because the data DOES NOT EXIST" << std::endl;
     ERR(FTL) << "Correction exists for W < 1.4 GeV and no W cut data ONLY" << std::endl;
     ERR(FTL) << "Reverting to using uncorrected data!" << std::endl;
     UseCorrectedData = false;
   }
-  // Get rid of the slashes in the type
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
-
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
   // Now read in different data depending on what the user has specified
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/";
+  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 {
+    } 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);
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 * 2.0 / 1.0 / (fNEvents + 0.));
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+  // 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 6abaffc..367d07a 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 01bbceb..d73714b 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.cxx
@@ -1,72 +1,121 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 /**
  * 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"
 
-// The constructor
-ANL_CC1ppip_XSec_1DQ2_nu::ANL_CC1ppip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "ANL_CC1ppip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ_{CC#pi^{+}}^{2} (cm^{2}/GeV^{2}/proton)";
-  EnuMin = 0.5;
-  EnuMax = 6;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+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.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();
 
-  SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC1pip_on_p/ANL_CC1pip_on_p_dSigdQ2_W14_1982.txt");
-  SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*TotalIntegratedFlux("width"))*16./8.;
 };
 
-
 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;
+  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 0e9ca2e..d9cd6a0 100644
--- a/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/ANL/ANL_CC1ppip_XSec_1DQ2_nu.h
@@ -1,38 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~ANL_CC1ppip_XSec_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  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 0c591c8..70bc38a 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.cxx
@@ -1,100 +1,114 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu::ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pMu_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+//********************************************************************
+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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
 };
 
 
 
+
+
 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 1fc2bb9..a75a153 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 b20bca2..5f54d3f 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.cxx
@@ -1,100 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pim1pip_Evt_1Dppim_nu::ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pim1pip_Evt_1Dppim_nu";
-  fPlotTitles = "; p_{#pi-} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_ppim_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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.SetYTitle("Number of events (area norm.)");
+  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/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);
 }
 
-
-/*
-void ANL_CC2pi_1pim1pip_Evt_1Dppim_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pim1pip_Evt_1Dppim_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_1Dppim_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
index ac72ab0..450d21b 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppim_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 140769c..0749bc7 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.cxx
@@ -1,100 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pim1pip_Evt_1Dppip_nu::ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pim1pip_Evt_1Dppip_nu";
-  fPlotTitles = "; p_{#pi+} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_ppip_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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.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);
 }
 
-
-/*
-void ANL_CC2pi_1pim1pip_Evt_1Dppip_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pim1pip_Evt_1Dppip_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_1Dppip_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
index cea297e..574972e 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pim1pip_Evt_1Dppip_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 b0e2422..3c63f4d 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.cxx
@@ -1,100 +1,89 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu";
-  fPlotTitles = "; p_{prot} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip_pProt_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
 
+//********************************************************************
+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.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/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);
 }
 
 
-/*
-void ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pim1pip_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_1pim1pip_Evt_1Dpprot_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
index 7658b4a..fb465d9 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
+++ b/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 edc1da9..9e36fa9 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.cxx
@@ -1,95 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fIsEnu1D = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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");
 
-  // Need to multiply the data by a factor because of the way the data is scanned (e.g. 1E-38)
-  //  fDataHist->Scale(1.E-41);
+  // CCQELike plot information
+  fSettings.SetTitle("ANL #nu_mu CC2#pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/ANL/CC2pi/1pim1pip/CC2pi_1pim1pip1p_xsec.csv" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+  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);
 }
 
 
-/*
-void ANL_CC2pi_1pim1pip_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pim1pip_XSec_1DEnu_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_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h
index cb24e3c..a65aefb 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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 114cb77..afb2c8d 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.cxx
@@ -1,100 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu::ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_pMu_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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);
 }
 
 
-/*
-void ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pi0_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_1pip1pi0_Evt_1Dpmu_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
index f30b766..35751c0 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 ddca715..2800b13 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.cxx
@@ -1,100 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu::ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu";
-  fPlotTitles = "; p_{#pi0} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_ppi0_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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.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);
 }
 
-
-/*
-void ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pi0_Evt_1Dppi0_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_1Dppi0_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
index cd3dd3e..9f9d0a4 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 51fa183..564c557 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.cxx
@@ -1,100 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu::ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu";
-  fPlotTitles = "; p_{#pi+} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_ppip_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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.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);
 }
 
-
-/*
-void ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pi0_Evt_1Dppip_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_1Dppip_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
index 3fd30df..ce19070 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 5778ed7..797a1ad 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.cxx
@@ -1,100 +1,112 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu::ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu";
-  fPlotTitles = "; p_{prot} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi0_pProt_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+//********************************************************************
+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 f28cbdc..934beb4 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 e8326a1..9c115a5 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.cxx
@@ -1,94 +1,85 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
   * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi01p_xsec.csv");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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");
 
-  // Need to multiply the data by a factor because of the way the data is scanned (e.g. 1E-38)
-  //fDataHist->Scale(1.E-41);
+  // CCQELike plot information
+  fSettings.SetTitle("ANL #nu_mu CC2#pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/ANL/CC2pi/1pip1pi0/CC2pi_1pip1pi01p_xsec.csv" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+  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);
 }
 
-
-/*
-void ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pi0_XSec_1DEnu_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_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
index 6c8143c..8b149ab 100644
--- a/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 be3b613..0a31a16 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.cxx
@@ -1,100 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu::ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pMu_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
 
+//********************************************************************
+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);
 }
 
-
-/*
-void ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pip_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_1pip1pip_Evt_1Dpmu_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
index a6ba695..70d4f14 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 7a8c5d4..2cd6926 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.cxx
@@ -1,100 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu";
-  fPlotTitles = "; p_{n} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pNeutron_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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);
 }
 
 
-/*
-void ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
-
-  mcHist->Scale(fScaleFactor);
-  mcFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
index fc066d7..83b5da7 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 833bd1c..91626cc 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.cxx
@@ -1,100 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu";
-  fPlotTitles = "; p_{#pi high} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pHigh_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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);
 }
 
 
-/*
-void ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
-
-  mcHist->Scale(fScaleFactor);
-  mcFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
index 9caf4db..57a2cf6 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 a5b89bb..215157a 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.cxx
@@ -1,110 +1,98 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu";
-  fPlotTitles = "; p_{#pi low} (GeV); Number of events (area norm.)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fIsRawEvents = true;
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // there's also _unweight rather than weight data file
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_pLow_weight.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
+//********************************************************************
+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);
 }
 
-
-/*
-void ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
-
-  mcHist->Scale(fScaleFactor);
-  mcFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
index 822a2f1..3046ce9 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  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 6b40312..550807b 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.cxx
@@ -1,95 +1,85 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
   * 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"
 
-// The constructor
-ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+//********************************************************************
+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();
 
-  fName = "ANL_CC2pi_1pip1pip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/CC2pi/1pip1pip/CC2pi_1pip1pip1n_xsec.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  // Need to multiply the data by a factor because of the way the data is scanned (e.g. 1E-38)
-  //fDataHist->Scale(1.E-41);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
 };
 
 
-
 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);
 }
-
-
-/*
-void ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void ANL_CC2pi_1pip1pip_XSec_1DEnu_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(mcHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(mcFine, GetFluxHistogram());
-
-  mcHist->Scale(fScaleFactor);
-  mcFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
index a89079d..8fc25af 100644
--- a/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~ANL_CC2pi_1pip1pip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
index 8bc6095..b6bc1de 100755
--- a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,223 +1,160 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ANL_CCQE_Evt_1DQ2_nu.h"
 
 //********************************************************************
-/// @brief ANL CCQE Q2 Measurement on Free Nucleons (Ref: PRD16 3103)
-///
-/// @details Q2 Extracted assuming numu CCQE scattering of free nucleons.
-ANL_CCQE_Evt_1DQ2_nu::ANL_CCQE_Evt_1DQ2_nu(std::string name, std::string inputfile,
-					   FitWeight *rw,    std::string type,
-					   std::string fakeDataFile){
+ANL_CCQE_Evt_1DQ2_nu::ANL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  EnuMin = 0.;
-  EnuMax = 6.;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  applyEnucorrection = type.find("ENUCORR") != std::string::npos;
-  fDefaultTypes="SHAPE/DIAG";
-  fAllowedTypes="SHAPE/DIAG/Q2CORR/MASK";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ANL CCQ2 Event Rate 1DQ2 nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fIsDiag = true;
-  fIsRawEvents = true;
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CCQE} (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");
 
-  // In future read most of these from a card file
-  if (!name.compare("ANL_CCQE_Evt_1DQ2_nu_PRL31")){
+  // plot information
+  fSettings.SetTitle("ANL #nu_mu CCQE");
+  fSettings.DefineAllowedSpecies("numu");
 
-    this->SetDataFromDatabase("ANL/ANL_CCQE_Data_PRL31_844.root", "ANL_1DQ2_Data");
-    applyEnucorrection = false;
-    EnuMax = 3.0; // Move EnuMax down
+  // Hadronic Cut Info
+  if (fSettings.Found("name", "PRL31")) {
 
-  } else if (!name.compare("ANL_CCQE_Evt_1DQ2_nu_PRD16")){
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRL31_844.root;ANL_1DQ2_Data" );
+    fSettings.SetEnuRange(0.0, 3.0);
 
-    applyEnucorrection = false;
-    this->SetDataFromDatabase("ANL/ANL_CCQE_Data_PRD16_3103.root", "ANL_1DQ2_Data");
+  } else if (fSettings.Found("name", "PRD16")) {
+
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DQ2_Data" );
 
   } else {
 
-    this->SetDataFromDatabase("ANL/ANL_Data_PRD26_537.root","ANL_1DQ2_Data");
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "ANL/ANL_Data_PRD26_537.root;ANL_1DQ2_Data" );
 
   }
 
-  // Setup Histograms
-  this->SetupDefaultHist();
-
-  if (applyQ2correction){
-    this->CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_1DQ2_Correction");
-    this->fMCHist_NoCorr = (TH1D*) this->fMCHist->Clone();
-    this->fMCHist_NoCorr->SetNameTitle( (this->fName + "_NOCORR").c_str(),(this->fName + "_NOCORR").c_str());
+  // 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_XSec_1DQ2_Correction");
   }
 
-  if (applyEnucorrection){
-    this->EnuRatePlot = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_Data_PRD26_537.root","ANL_1DEnu_Rate");
-    this->EnuvsQ2Plot = PlotUtils::MergeIntoTH2D(fDataHist, EnuRatePlot, "Events");
+  FinaliseSampleSettings();
 
-    this->EnuFluxUnfoldPlot = (TH1D*)this->EnuRatePlot->Clone();
-    for (int i = 0; i < this->EnuFluxUnfoldPlot->GetNbinsX(); i++) this->EnuFluxUnfoldPlot->SetBinContent(i+1,1.0);
-    PlotUtils::FluxUnfoldedScaling(EnuFluxUnfoldPlot, GetFluxHistogram());
-  }
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = 1.0;
 
-  // Setup Covariance
-  //  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  //  covar     = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  //  GetEventHistogram()->Scale(fDataHist->Integral()/GetEventHistogram()->Integral());
-  this->fScaleFactor = (this->fDataHist->Integral("width")/(fNEvents+0.));
+  // Correction Histogram
+  if (applyQ2correction) {
 
-  // Set starting scale factor
-  scaleF = -1.0;
+    // 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();
+
+}
 
 //********************************************************************
-/// @details Extract q2qe from event assuming quasi-elastic scattering
-void ANL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent *event){
+void ANL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent * event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   // Fill histogram with reconstructed Q2 Distribution
-  q2qe = 0.0;
+  fXVar = -999.9;
   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);
+  fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
 
-  fXVar = q2qe;
+  GetQ2Box()->fQ2 = fXVar;
   return;
 };
 
 //********************************************************************
-/// @brief Signal is defined as True CCQE numu scattering
-/// @details cut 1: CCQE event
-/// @details cut 2: numu event
-/// @details cut 3: EnuMin < Enu < EnuMax
-/// @details cut 4: Q2 non-zero
-bool ANL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent *event){
+bool ANL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
 //********************************************************************
 
   if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
 
   // Q2 cut
-  if (q2qe <= 0) return false;
+  if (GetQ2Box()->fQ2 <= 0) return false;
 
   return true;
 };
 
 //********************************************************************
-/// @details Reset the histogram uncorrect
-void ANL_CCQE_Evt_1DQ2_nu::ResetAll(){
+void ANL_CCQE_Evt_1DQ2_nu::FillHistograms() {
 //********************************************************************
 
-  Measurement1D::ResetAll();
-  this->fMCHist->Reset();
-
-  if (applyEnucorrection)
-    this->EnuvsQ2Plot->Reset();
-
-  if (applyQ2correction)
-    this->fMCHist_NoCorr->Reset();
-
+  if (applyQ2correction) {
+    fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
 
-}
-
-//********************************************************************
-/// @details Apply additional event weights for free nucleon measurements
-void ANL_CCQE_Evt_1DQ2_nu::FillHistograms(){
-//********************************************************************
-
-  if (applyEnucorrection)
-    this->EnuvsQ2Plot->Fill(fXVar, Enu, Weight);
-
-  if (applyQ2correction){
-    this->fMCHist_NoCorr->Fill(fXVar, Weight);
-
-    if (fXVar < 0.225)
-      this->Weight *= this->CorrectionHist->Interpolate(fXVar);
+    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(){
-//********************************************************************
-
-  if (applyEnucorrection){
-    this->EnuvsQ2Plot->Scale(GetEventHistogram()->Integral()/(fNEvents+0.));
-    for (int j =  0; j < EnuvsQ2Plot->GetNbinsY(); j++){
-      for (int i = 0; i < EnuvsQ2Plot->GetNbinsX(); i++){
-	this->EnuvsQ2Plot->SetBinContent(i+1,j+1, this->EnuvsQ2Plot->GetBinContent(i+1,j+1) * EnuFluxUnfoldPlot->GetBinContent(j+1));
-      }
-    }
-  }
-
-
-  this->fMCHist->Scale(fScaleFactor);
-  this->fMCFine->Scale(fScaleFactor);
-  if (applyQ2correction) this->fMCHist_NoCorr->Scale(fScaleFactor);
-
-
-  // Scale to match data
-  scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist, fMaskHist);
-
-  this->fMCHist->Scale(scaleF);
-  this->fMCFine->Scale(scaleF);
-
-  if (applyQ2correction){
-    scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist_NoCorr, fMaskHist);
-    this->fMCHist_NoCorr->Scale(scaleF);
-  }
-
-
-
-
-}
-
-
-//********************************************************************
-/// @brief Include Q2 Correction plots into data write
-void ANL_CCQE_Evt_1DQ2_nu::Write(std::string drawOpt){
+void ANL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
 //********************************************************************
 
-  Measurement1D::Write(drawOpt);
+  Measurement1D::ScaleEvents();
 
-  if (applyQ2correction){
-    this->CorrectionHist->Write();
-    this->fMCHist_NoCorr->Write();
-  }
-
-  if (applyEnucorrection){
-    this->EnuvsQ2Plot->Write();
-    ((TH1D*)this->EnuvsQ2Plot->ProjectionX())->Write();
-    ((TH1D*)this->EnuvsQ2Plot->ProjectionY())->Write();
-    EnuFluxUnfoldPlot->Write();
-    EnuRatePlot->Write();
+  // Flux unfold our extra histogram
+  if (applyQ2correction) {
+    if (fMCHist_NoCorr->Integral()) {
+      fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
+    }
   }
-
-  return;
 }
diff --git a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
index 96ca547..80e4c43 100755
--- a/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
+++ b/src/ANL/ANL_CCQE_Evt_1DQ2_nu.h
@@ -1,61 +1,66 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef ANL_CCQE_Evt_1DQ2_NU_H_SEEN
 #define ANL_CCQE_Evt_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
+#include "CustomVariableBoxes.h"
 
-/*!
-  ANL Charged Current Quasi-elastic Measurement \n
-  1D Event Rate in Q2QE \n
-  Class supports multiple published datasets: \n
-  \item PRD.26.537  = ANL_CCQE_XSec_1DQ2_nu_PRD26, or ANL_CCQE_XSec_1DEnu_nu
-  \item PRD.16.3103 = ANL_CCQE_XSec_1DQ2_nu_PRD16
-  \item PRL.31.844  = ANL_CCQE_XSec_1DEQ2_nu_PRL31
-*/
+/// \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(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  ANL_CCQE_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~ANL_CCQE_Evt_1DQ2_nu() {}; 
   
+  /// \brief Fill Q2QE Event Information
   void FillEventVariables(FitEvent *event);       
-  bool isSignal(FitEvent *event);                 
+
+  /// \brief Selection only true CCQE
+  bool isSignal(FitEvent *event);    
+
+  /// \brief Fill main histograms and correction histograms             
   void FillHistograms();
-  void ResetAll();
+
+  /// \brief scale normal MC and corrected MC
   void ScaleEvents();
-  void Write(std::string drawOpt);
+  
+  /// \brief Use Q2 Box to save correction info
+  inline Q2VariableBox1D* GetQ2Box(){ return static_cast<Q2VariableBox1D*>(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 q2qe;       ///< fXVar
-  double scaleF; ///< Nominal Scale Factor
-  bool applyEnucorrection;
-  TH2D* EnuvsQ2Plot; // For Scaling
 
-  TH1D* EnuFluxUnfoldPlot;
-  TH1D* EnuRatePlot;
 
 };
   
 #endif
diff --git a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
index 8e55f14..563487c 100644
--- a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,105 +1,154 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "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.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);
 
-ANL_CCQE_XSec_1DEnu_nu::ANL_CCQE_XSec_1DEnu_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+  } else {
 
-  // Measurement Details
-  fName = name;
-  EnuMin = 0.;
-  EnuMax = 6.;
-  fIsDiag = true;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/Q2CORR/ENUCORR";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "ANL/ANL_CCQE_Data_PRD16_3103.root;ANL_1DEnu_fluxtuned_Data" );
 
-  LOG(SAM) << "SETTING DATA"<<std::endl;
+  }
 
-  // Setup Plots
-  if (!name.compare("ANL_CCQE_XSec_1DEnu_nu_PRL31")){
-    SetDataFromDatabase("ANL/ANL_CCQE_Data_PRL31_844.root", "ANL_1DEnu_Data");
-    EnuMax = 3.0; // Move EnuMax down
-  } else {
-    SetDataFromDatabase("ANL/ANL_CCQE_Data_PRD16_3103.root", "ANL_1DEnu_fluxtuned_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_XSec_1DQ2_Correction");
   }
 
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  if (applyQ2correction){
-    CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_1DQ2_Correction");
-  }
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 2.0 / 1.0 * 1E-38 / (fNEvents + 0.));
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  // Different generators require slightly different rescaling factors.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*2.0/1.0*1E-38/(fNEvents+0.)); // NEUT
+  // Correction Histogram
+  if (applyQ2correction) {
 
-};
+    // Correction Hist
+    CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
+                     fSettings.GetS("q2correction_hist") );
+    SetAutoProcessTH1(CorrectionHist, kCMD_Write);
 
 
-/// @details Extract Enu and totcrs from event assuming quasi-elastic scattering
-void ANL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event){
+    // 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);
+  q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
+  Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0., true);
 
   fXVar = Enu_rec;
+  GetQ2Box()->fQ2 = q2qe;
 
-  // We save q2 into fYVar incase correction is applied
-  fYVar = q2qe;
   return;
 };
 
 
-/// Signal is true CCQE scattering \n
-/// \item Cut 1: numu event
-/// \item Cut 2: Mode == 1
-/// \item Cut 3: EnuMin < Enu < EnuMax
-bool ANL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event){
-
+//********************************************************************
+bool ANL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
+//********************************************************************
   return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
 };
 
 
-//! If Q2 correction is applied the CorrectionHist is interpolated
-//! using the Q2QE value saved in fYVar
-void ANL_CCQE_XSec_1DEnu_nu::FillHistograms(){
+//********************************************************************
+void ANL_CCQE_XSec_1DEnu_nu::FillHistograms() {
+//********************************************************************
 
-  if (applyQ2correction){
-    if (fYVar < CorrectionHist->GetXaxis()->GetXmin())
-      Weight *= CorrectionHist->Interpolate(fYVar);
+  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 982f64a..08397e2 100644
--- a/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_CCQE_XSec_1DEnu_nu.h
@@ -1,49 +1,63 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef ANL_CCQE_XSEC_1DENU_NU_H_SEEN
 #define ANL_CCQE_XSEC_1DENU_NU_H_SEEN
 #include "Measurement1D.h"
+#include "CustomVariableBoxes.h"
 
-/*!
-  ANL Charged Current Quasi-elastic Measurement \n
-  1D Flux unfolded cross-section in Enu \n\n
-  Class supports multiple published datasets: \n
-  \item PRD.16.3103 =  ANL_CCQE_XSec_1DEnu_nu_PRD16, or ANL_CCQE_XSec_1DEnu_nu
-  \item PRL.31.844 = ANL_CCQE_XSec_1DEnu_nu_PRL31
-*/
+
+/// /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(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+
+  ANL_CCQE_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~ANL_CCQE_XSec_1DEnu_nu() {};
   
-  //void ResetAll();
+  /// \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();
-  //void ScaleEvents(); 
-  //void ApplyNormScale(double norm);
-  //void Write();
+
+  /// \brief scale normal MC and corrected MC
+  void ScaleEvents();
+
+  /// \brief Use Q2 Box to save correction info
+  inline Q2VariableBox1D* GetQ2Box(){ return static_cast<Q2VariableBox1D*>(GetBox()); };
+
+  /// \brief Create Q2 Box to save correction info
+  inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
 
  private:
-  bool applyQ2correction;  //!< [FLAG] Apply free nucleon to dueterium correction
-  TH1D* CorrectionHist;    //!< Histogram to interpolate free nucleon correction
+  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 ecb5d1d..6cbc403 100644
--- a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx
+++ b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.cxx
@@ -1,72 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "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, 6.0);
+  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
+  fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.)*GetFluxHistogram()->Integral("width"))*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-ANL_NC1npip_Evt_1Dppi_nu::ANL_NC1npip_Evt_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_NC1npip_Evt_1Dppi_nu";
-  fPlotTitles = "; p_{#pi} (MeV); Number of events";
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // There are two different measurements here; _weight and _unweight
-  // See publication for information
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/NC1npip/ANL_ppi_NC1npip_weight.csv");
-  //this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/NC1npip/ANL_ppi_NC1npip_weight.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.)*GetFluxHistogram()->Integral("width"))*(16./8.);
 };
 
 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 6f50969..e70fb45 100644
--- a/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h
+++ b/src/ANL/ANL_NC1npip_Evt_1Dppi_nu.h
@@ -1,47 +1,41 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  
+  ANL_NC1npip_Evt_1Dppi_nu(nuiskey samplekey);
   virtual ~ANL_NC1npip_Evt_1Dppi_nu() {};
   
-  //void ResetAll();
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-  //void ScaleEvents(); 
-  //void ApplyNormScale(double norm);
-  //void Write();
 
  private:
 };
   
 #endif
diff --git a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
index 55d346a..77856e1 100644
--- a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
+++ b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.cxx
@@ -1,79 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "ANL_NC1ppim_Evt_1DcosmuStar_nu";
-  fPlotTitles = "; cos*_{#mu}; Number of events";
-  EnuMin = 0.3;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fIsEnu1D = false;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes="EVT/SHAPE/DIAG";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/NC1ppim/ANL_NC1ppim_cosMuStar.csv");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  // Set Poisson errors on data points (number of events weighted)
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; ++i) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/((fNEvents+0.)*GetFluxHistogram()->Integral("width"))*(16./8.);
+
+//********************************************************************
+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.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 bd21353..de8c258 100644
--- a/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h
+++ b/src/ANL/ANL_NC1ppim_Evt_1DcosmuStar_nu.h
@@ -1,47 +1,40 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  
+  ANL_NC1ppim_Evt_1DcosmuStar_nu(nuiskey samplekey);
   virtual ~ANL_NC1ppim_Evt_1DcosmuStar_nu() {};
   
-  //void ResetAll();
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-  //void ScaleEvents(); 
-  //void ApplyNormScale(double norm);
-  //void Write();
 
  private:
 };
   
 #endif
diff --git a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
index 9326b61..7ef5ab6 100644
--- a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
+++ b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.cxx
@@ -1,62 +1,76 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
+//********************************************************************
+ANL_NC1ppim_XSec_1DEnu_nu::ANL_NC1ppim_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  fName = "ANL_NC1ppim_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu};#sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.3;
-  EnuMax = 1.5;
-  fIsDiag = true;
-  fIsRawEvents = false;
-  fIsEnu1D = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ANL_NC1ppim_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/ANL/NC1ppim/ANL_NC1ppim_Enu_xsec.csv");
-  this->SetupDefaultHist();
+  // 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");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // CCQELike plot information
+  fSettings.SetTitle("ANL #nu_mu NC1n#pi^{+}");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/ANL/NC1ppim/ANL_NC1ppim_Enu_xsec.csv" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Scale to cross-section
-  // PDAWG: Removed this scaling because it doesn't seem consistent.
-  //  fDataHist->Scale(1.E-41);
+  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() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width") * 1E-38 /(fNEvents+0)*(16./8.);
 };
 
 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 757a380..d05fc61 100644
--- a/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h
+++ b/src/ANL/ANL_NC1ppim_XSec_1DEnu_nu.h
@@ -1,47 +1,40 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  
+  ANL_NC1ppim_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~ANL_NC1ppim_XSec_1DEnu_nu() {};
   
-  //void ResetAll();
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-  //void ScaleEvents(); 
-  //void ApplyNormScale(double norm);
-  //void Write();
 
- private:
 };
   
 #endif
diff --git a/src/ANL/CMakeLists.txt b/src/ANL/CMakeLists.txt
index c8bd255..564e292 100644
--- a/src/ANL/CMakeLists.txt
+++ b/src/ANL/CMakeLists.txt
@@ -1,135 +1,138 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 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_CC1pi0_Evt_1DcosmuStar_nu.cxx
 ANL_CC1pi0_Evt_1DQ2_nu.cxx
 ANL_CC1pi0_XSec_1DEnu_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_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_CC1pi0_Evt_1DcosmuStar_nu.h
 ANL_CC1pi0_Evt_1DQ2_nu.h
 ANL_CC1pi0_XSec_1DEnu_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_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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.cxx
index 66a1b47..3b6f702 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.cxx
@@ -1,41 +1,58 @@
 #include "ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h"
 
+
 //********************************************************************
-ArgoNeuT_CCInc_XSec_1Dpmu_antinu::ArgoNeuT_CCInc_XSec_1Dpmu_antinu(
-    std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile)
+ArgoNeuT_CCInc_XSec_1Dpmu_antinu::ArgoNeuT_CCInc_XSec_1Dpmu_antinu(nuiskey samplekey) {
 //********************************************************************
-{
-  fName = "ArgoNeuT_CCInc_XSec_1Dpmu_antinu";
-  fDefaultTypes = "FIX/DIAG/CHI2";
-  fPlotTitles = "; p_{#mu} (GeV); d#sigma/dp_{#mu} (cm^{2} Ar^{-1} GeV^{-1})";
-  EnuMin = 0;
-  EnuMax = 50;
-  fIsDiag = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() +
-                "/data/ArgoNeuT/CCInc_dsig_dmumom_nubar.dat");
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ArgoNeuT_CCInc_XSec_1Dpmu_antinu 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 antinumu 1Dp_{#mu}");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/ArgoNeuT/CCInc_dsig_dmumom_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");
 
-  fDataHist->Scale(1E-38);
-  fDataTrue->Scale(1E-38);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  ScaleData(1E-38);
+  SetCovarFromDiagonal();
 
-  SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) *
-                (40.0 /*Data is /Ar */) / TotalIntegratedFlux("width");
 };
 
+
 void ArgoNeuT_CCInc_XSec_1Dpmu_antinu::FillEventVariables(FitEvent *event) {
   FitParticle* pmu = event->GetHMFSParticle(-13);
-  if (pmu) fXVar = pmu->fP.Vect().Mag()/1000.0;
+  if (pmu) fXVar = pmu->fP.Vect().Mag() / 1000.0;
   return;
 };
 
 //********************************************************************
 bool ArgoNeuT_CCInc_XSec_1Dpmu_antinu::isSignal(FitEvent *event)
 //********************************************************************
 {
   return SignalDef::isCCINC(event, -14, EnuMin, EnuMax);
 }
 
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h
index 04e7924..5ccc4ac 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h
@@ -1,17 +1,17 @@
 #ifndef ArgoNeuT_CCInc_XSec_1Dpmu_antinu_H_SEEN
 #define ArgoNeuT_CCInc_XSec_1Dpmu_antinu_H_SEEN
 
 #include "Measurement1D.h"
 
 class ArgoNeuT_CCInc_XSec_1Dpmu_antinu : public Measurement1D {
 public:
-  ArgoNeuT_CCInc_XSec_1Dpmu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  ArgoNeuT_CCInc_XSec_1Dpmu_antinu(nuiskey samplekey);
   virtual ~ArgoNeuT_CCInc_XSec_1Dpmu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
index cf7094e..20cfb61 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dpmu_nu.cxx
@@ -1,59 +1,74 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "ArgoNeuT_CCInc_XSec_1Dpmu_nu.h"
 
+
 //********************************************************************
-ArgoNeuT_CCInc_XSec_1Dpmu_nu::ArgoNeuT_CCInc_XSec_1Dpmu_nu(
-    std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile)
+ArgoNeuT_CCInc_XSec_1Dpmu_nu::ArgoNeuT_CCInc_XSec_1Dpmu_nu(nuiskey samplekey) {
 //********************************************************************
-{
-  fName = "ArgoNeuT_CCInc_XSec_1Dpmu_nu";
-  fDefaultTypes = "FIX/DIAG/CHI2";
-  fPlotTitles = "; p_{#mu} (GeV); d#sigma/dp_{#mu} (cm^{2} Ar^{-1} GeV^{-1})";
-  EnuMin = 0;
-  EnuMax = 50;
-  fIsDiag = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() +
-                "/data/ArgoNeuT/CCInc_dsig_dmumom_nu.dat");
+  // 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");
 
-  fDataHist->Scale(1E-38);
-  fDataTrue->Scale(1E-38);
+  // CCQELike plot information
+  fSettings.SetTitle("ArgoNeut CC-INC numu 1Dp_{#mu}");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/ArgoNeuT/CCInc_dsig_dmumom_nu.dat" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  SetupDefaultHist();
+  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");
+                 (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 924001f..c02159e 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
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  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 4817f49..bfb6101 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.cxx
@@ -1,42 +1,56 @@
 #include "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h"
 
+
 //********************************************************************
-ArgoNeuT_CCInc_XSec_1Dthetamu_antinu::ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(
-    std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile)
+ArgoNeuT_CCInc_XSec_1Dthetamu_antinu::ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(nuiskey samplekey) {
 //********************************************************************
-{
-  fName = "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu";
-  fDefaultTypes = "FIX/DIAG/CHI2";
-  fPlotTitles =
-      "; theta_{#mu} (degrees); d#sigma/d#theta_{#mu} (cm^{2} Ar^{-1} "
-      "degrees^{-1})";
-  EnuMin = 0;
-  EnuMax = 50;
-  fIsDiag = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() +
-                "/data/ArgoNeuT/CCInc_dsig_dthetamu_nubar.dat");
+  // 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.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");
 
-  fDataHist->Scale(1E-38);
-  fDataTrue->Scale(1E-38);
+  // 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");
 
-  SetupDefaultHist();
+  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");
+                 (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_antinu.h b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h
index 23eb3bb..766b4f8 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h
@@ -1,17 +1,17 @@
 #ifndef ArgoNeuT_CCInc_XSec_1Dthetamu_antinu_H_SEEN
 #define ArgoNeuT_CCInc_XSec_1Dthetamu_antinu_H_SEEN
 
 #include "Measurement1D.h"
 
 class ArgoNeuT_CCInc_XSec_1Dthetamu_antinu : public Measurement1D {
 public:
-  ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(nuiskey samplekey);
   virtual ~ArgoNeuT_CCInc_XSec_1Dthetamu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
index b8df3a1..94acc32 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.cxx
@@ -1,42 +1,59 @@
 #include "ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h"
 
+
+
 //********************************************************************
-ArgoNeuT_CCInc_XSec_1Dthetamu_nu::ArgoNeuT_CCInc_XSec_1Dthetamu_nu(
-    std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile)
+ArgoNeuT_CCInc_XSec_1Dthetamu_nu::ArgoNeuT_CCInc_XSec_1Dthetamu_nu(nuiskey samplekey) {
 //********************************************************************
-{
-  fName = "ArgoNeuT_CCInc_XSec_1Dthetamu_nu";
-  fDefaultTypes = "FIX/DIAG/CHI2";
-  fPlotTitles =
-      "; theta_{#mu} (degrees); d#sigma/d#theta_{#mu} (cm^{2} Ar^{-1} "
-      "degrees^{-1})";
-  EnuMin = 0;
-  EnuMax = 50;
-  fIsDiag = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() +
-                "/data/ArgoNeuT/CCInc_dsig_dthetamu_nu.dat");
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu sample. \n" \
+                        "Target: Ar40 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fDataHist->Scale(1E-38);
-  fDataTrue->Scale(1E-38);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  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");
 
-  SetupDefaultHist();
+  // 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");
+                 (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/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h
index 6a61d2b..befb184 100644
--- a/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h
+++ b/src/ArgoNeuT/ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h
@@ -1,17 +1,17 @@
 #ifndef ArgoNeuT_CCInc_XSec_1Dthetamu_nu_H_SEEN
 #define ArgoNeuT_CCInc_XSec_1Dthetamu_nu_H_SEEN
 
 #include "Measurement1D.h"
 
 class ArgoNeuT_CCInc_XSec_1Dthetamu_nu : public Measurement1D {
 public:
-  ArgoNeuT_CCInc_XSec_1Dthetamu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  ArgoNeuT_CCInc_XSec_1Dthetamu_nu(nuiskey samplekey);
   virtual ~ArgoNeuT_CCInc_XSec_1Dthetamu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/ArgoNeuT/CMakeLists.txt b/src/ArgoNeuT/CMakeLists.txt
index 1690a22..52157fc 100644
--- a/src/ArgoNeuT/CMakeLists.txt
+++ b/src/ArgoNeuT/CMakeLists.txt
@@ -1,60 +1,63 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 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_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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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)
 
 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 5ec8b9e..ead028f 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.cxx
@@ -1,69 +1,89 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1npim_XSec_1DEnu_antinu.h"
 
-// The constructor
-BEBC_CC1npim_XSec_1DEnu_antinu::BEBC_CC1npim_XSec_1DEnu_antinu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1npim_XSec_1DEnu_antinu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/theses/BEBC_theses_ANU_CC1pi-_nFin_W14.txt");
-  this->SetupDefaultHist();
+//********************************************************************
+BEBC_CC1npim_XSec_1DEnu_antinu::BEBC_CC1npim_XSec_1DEnu_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1npim_XSec_1DEnu_antinu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+  // 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 44296c0..b0c2b91 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DEnu_antinu.h
@@ -1,39 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BEBC_CC1npim_XSec_1DEnu_antinu(nuiskey samplekey);
   virtual ~BEBC_CC1npim_XSec_1DEnu_antinu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
 
 };
 
 #endif
diff --git a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
index 9ae0e47..9cdb865 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.cxx
@@ -1,88 +1,109 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1npim_XSec_1DQ2_antinu.h"
 
-// The constructor
-BEBC_CC1npim_XSec_1DQ2_antinu::BEBC_CC1npim_XSec_1DQ2_antinu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1npim_XSec_1DQ2_antinu";
-  fPlotTitles = "; Q^{2} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1npim_XSec_1DQ2_antinu::BEBC_CC1npim_XSec_1DQ2_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/Dfill/BEBC_Dfill_CC1pi-_on_n_W14_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1npim_XSec_1DQ2_antinu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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());
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*this->TotalIntegratedFlux("width"))*16./8.;
+  // 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 57b77a4..72bc15e 100644
--- a/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h
+++ b/src/BEBC/BEBC_CC1npim_XSec_1DQ2_antinu.h
@@ -1,43 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BEBC_CC1npim_XSec_1DQ2_antinu(nuiskey samplekey);
   virtual ~BEBC_CC1npim_XSec_1DQ2_antinu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   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 6b4fd6f..74fb299 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,65 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1npip_XSec_1DEnu_nu.h"
 
-// The constructor
-BEBC_CC1npip_XSec_1DEnu_nu::BEBC_CC1npip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1npip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1npip_XSec_1DEnu_nu::BEBC_CC1npip_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/theses/BEBC_theses_CC1pip_on_n_W14.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1npip_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
 };
 
 
+
 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 cc49d59..e9f2345 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DEnu_nu.h
@@ -1,39 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BEBC_CC1npip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
 
 };
   
 #endif
diff --git a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
index 08cb539..c486408 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.cxx
@@ -1,89 +1,108 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1npip_XSec_1DQ2_nu.h"
 
-// The constructor
-BEBC_CC1npip_XSec_1DQ2_nu::BEBC_CC1npip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "BEBC_CC1npip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)";
-  EnuMin = 5;
-  EnuMax = 200;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1npip_XSec_1DQ2_nu::BEBC_CC1npip_XSec_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/Dfill/BEBC_Dfill_CC1pi+_on_n_W14_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1npip_XSec_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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());
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*this->TotalIntegratedFlux("width"))*16./8.;
-};
+  // 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 4de557c..1581a1c 100644
--- a/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1npip_XSec_1DQ2_nu.h
@@ -1,43 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1npip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~BEBC_CC1npip_XSec_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   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 fe05fd5..3f31236 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,67 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
 
-// The constructor
-BEBC_CC1pi0_XSec_1DEnu_nu::BEBC_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1pi0_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1pi0_XSec_1DEnu_nu::BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/theses/BEBC_theses_CC1pi0_W14.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1pi0_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-  //this->fScaleFactor = double(1.0E-38)/double(fNEvents)*(16./8.);
 };
 
 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 380c817..5ec66b8 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DEnu_nu.h
@@ -1,39 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BEBC_CC1pi0_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
 private:
 
 };
 
 #endif
diff --git a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
index 855573e..31a4725 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.cxx
@@ -1,88 +1,108 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1pi0_XSec_1DQ2_nu.h"
 
-// The constructor
-BEBC_CC1pi0_XSec_1DQ2_nu::BEBC_CC1pi0_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "BEBC_CC1pi0_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/neutron)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1pi0_XSec_1DQ2_nu::BEBC_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/Dfill/BEBC_Dfill_CC1pi0_on_n_W14_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1pi0_XSec_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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());
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*this->TotalIntegratedFlux("width"))*16./8.;
+  // 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 a65c1f8..d6172ef 100644
--- a/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1pi0_XSec_1DQ2_nu.h
@@ -1,43 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~BEBC_CC1pi0_XSec_1DQ2_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   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 72ea5f0..0503e31 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.cxx
@@ -1,68 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1ppim_XSec_1DEnu_antinu.h"
 
-// The constructor
-BEBC_CC1ppim_XSec_1DEnu_antinu::BEBC_CC1ppim_XSec_1DEnu_antinu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1ppim_XSec_1DEnu_antinu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/proton)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/theses/BEBC_theses_ANU_CC1pi-_pFin_W14.txt");
-  this->SetupDefaultHist();
+//********************************************************************
+BEBC_CC1ppim_XSec_1DEnu_antinu::BEBC_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1ppim_XSec_1DEnu_antinu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
+  // 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 0024128..d8b3c47 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DEnu_antinu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BEBC_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey);
   virtual ~BEBC_CC1ppim_XSec_1DEnu_antinu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
index 6c403b2..d7f376f 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.cxx
@@ -1,88 +1,107 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1ppim_XSec_1DQ2_antinu.h"
 
-// The constructor
-BEBC_CC1ppim_XSec_1DQ2_antinu::BEBC_CC1ppim_XSec_1DQ2_antinu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1ppim_XSec_1DQ2_antinu";
-  fPlotTitles = "; Q^{2} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/proton)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1ppim_XSec_1DQ2_antinu::BEBC_CC1ppim_XSec_1DQ2_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/Dfill/BEBC_Dfill_CC1pi-_on_p_W14_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1ppim_XSec_1DQ2_antinu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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());
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*this->TotalIntegratedFlux("width"))*16./8.;
-};
+  // 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 0944694..027824b 100644
--- a/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h
+++ b/src/BEBC/BEBC_CC1ppim_XSec_1DQ2_antinu.h
@@ -1,44 +1,43 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1ppim_XSec_1DQ2_antinu(nuiskey samplekey);
   virtual ~BEBC_CC1ppim_XSec_1DQ2_antinu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   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 2137252..ca501fc 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,67 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1ppip_XSec_1DEnu_nu.h"
 
-// The constructor
-BEBC_CC1ppip_XSec_1DEnu_nu::BEBC_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "BEBC_CC1ppip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/proton)";
-  EnuMin = 5.;
-  EnuMax = 200.;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/theses/BEBC_theses_CC1pip_on_p_W14.txt");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
+//********************************************************************
+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 b8e5056..d4b100f 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DEnu_nu.h
@@ -1,41 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BEBC_CC1ppip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
index 6c451ba..3bc4a93 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.cxx
@@ -1,91 +1,112 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CC1ppip_XSec_1DQ2_nu.h"
 
-// The constructor
-BEBC_CC1ppip_XSec_1DQ2_nu::BEBC_CC1ppip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "BEBC_CC1ppip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/proton)";
-  EnuMin = 5;
-  EnuMax = 200;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+BEBC_CC1ppip_XSec_1DQ2_nu::BEBC_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BEBC/Dfill/BEBC_Dfill_CC1pi+_on_p_W14_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BEBC_CC1ppip_XSec_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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());
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.)*this->TotalIntegratedFlux("width"))*16./8.;
+  // 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 c3551f5..7c3e913 100644
--- a/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CC1ppip_XSec_1DQ2_nu.h
@@ -1,43 +1,41 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BEBC_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~BEBC_CC1ppip_XSec_1DQ2_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   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 dd21074..b1b323f 100755
--- a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx
+++ b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.cxx
@@ -1,163 +1,132 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BEBC_CCQE_XSec_1DQ2_nu.h"
 
+
 //********************************************************************
-/// @brief BEBC CCQE Q2 Measurement on Free Nucleons (Ref: Nuc.Phys.B.343 285)
-///
-/// @details Q2 Extracted assuming numu CCQE scattering of free nucleons.
-BEBC_CCQE_XSec_1DQ2_nu::BEBC_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-//********************************************************************
+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.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");
+  }
 
-  // Measurement Details
-  fName = name;
-  EnuMin = 0.;
-  EnuMax = 200.;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  fIsDiag = true;
-  fIsRawEvents = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  FinaliseSampleSettings();
 
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = (GetEventHistogram()->Integral("width")/(fNEvents+0.))*1E-38 / (TotalIntegratedFlux("width"));
 
-  // In future read most of these from a card file
-  this->SetDataFromDatabase("BEBC/BEBC_CCQE_Data_NPB343_285.root", "BEBC_1DQ2_Data");
-  this->SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  if (applyQ2correction){
-    this->CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_XSec_1DQ2_Correction");
-    this->fMCHist_NoCorr = (TH1D*) this->fMCHist->Clone();
-    this->fMCHist_NoCorr->SetNameTitle( (this->fName + "_NOCORR").c_str(),(this->fName + "_NOCORR").c_str());
-  }
+  // Correction Histogram
+  if (applyQ2correction) {
 
+    // Correction Hist
+    CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
+                     fSettings.GetS("q2correction_hist") );
+    SetAutoProcessTH1(CorrectionHist, kCMD_Write);
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
 
-  // Generate events on H2 to get the normalisation right.
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")/(fNEvents+0.))*1E-38 / (this->TotalIntegratedFlux("width")); // NEUT
+    // 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);
+  }
 
-  // Set starting scale factor
-  scaleF = -1.0;
-
-};
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
+}
 
 //********************************************************************
-/// @details Extract q2qe from event assuming quasi-elastic scattering
-void BEBC_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent *event){
+void BEBC_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent * event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   // Fill histogram with reconstructed Q2 Distribution
-  q2qe = 0.0;
+  fXVar = -999.9;
   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);
+  fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
 
-  fXVar = q2qe;
+  GetQ2Box()->fQ2 = fXVar;
   return;
 };
 
 //********************************************************************
-/// @brief Signal is defined as True CCQE numu scattering
-/// @details cut 1: numu event
-/// @details cut 2: EnuMin < Enu < EnuMax
-/// @details cut 3: Q2 non-zero
-bool BEBC_CCQE_XSec_1DQ2_nu::isSignal(FitEvent *event){
-//********************************************************************
-  if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
-  if (q2qe <= 0) return false;
-  return true;
-};
-
-//********************************************************************
-/// @details Reset the histogram uncorrect
-void BEBC_CCQE_XSec_1DQ2_nu::ResetAll(){
+bool BEBC_CCQE_XSec_1DQ2_nu::isSignal(FitEvent * event) {
 //********************************************************************
 
-  Measurement1D::ResetAll();
-  this->fMCHist->Reset();
-
-  if (applyQ2correction)
-    this->fMCHist_NoCorr->Reset();
+  if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
 
+  // Q2 cut
+  if (GetQ2Box()->fQ2 <= 0) return false;
 
-}
+  return true;
+};
 
 //********************************************************************
-/// @details Apply additional event weights for free nucleon measurements
-void BEBC_CCQE_XSec_1DQ2_nu::FillHistograms(){
+void BEBC_CCQE_XSec_1DQ2_nu::FillHistograms() {
 //********************************************************************
 
+  if (applyQ2correction) {
+    fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
 
-  if (applyQ2correction){
-    this->fMCHist_NoCorr->Fill(fXVar, Weight);
-
-    if (fXVar < 0.225)
-      this->Weight *= this->CorrectionHist->Interpolate(fXVar);
+    if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
+        GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
+      Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
   }
 
   Measurement1D::FillHistograms();
 
 }
 
-//********************************************************************
-void BEBC_CCQE_XSec_1DQ2_nu::ScaleEvents(){
-//********************************************************************
-
-  Measurement1D::ScaleEvents();
-  if (applyQ2correction) this->fMCHist_NoCorr->Scale(this->fScaleFactor, "width");
-
-  return;
-}
-
-//********************************************************************
-void BEBC_CCQE_XSec_1DQ2_nu::ApplyNormScale(double norm){
-//********************************************************************
-
-  Measurement1D::ApplyNormScale(norm);
-  if (norm == 0.0) scaleF = 0.0;
-  else scaleF = 1.0/norm;
-
-  if (applyQ2correction) this->fMCHist_NoCorr->Scale(scaleF);
-
-  return;
-}
-
-//********************************************************************
-/// @brief Include Q2 Correction plots into data write
-void BEBC_CCQE_XSec_1DQ2_nu::Write(std::string drawOpt){
-//********************************************************************
-
-  Measurement1D::Write(drawOpt);
-
-  if (applyQ2correction){
-    this->CorrectionHist->Write();
-    this->fMCHist_NoCorr->Write();
-  }
-
-
-  return;
-}
diff --git a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
index c732a2c..3e10cce 100755
--- a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
+++ b/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
@@ -1,52 +1,57 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  
+  BEBC_CCQE_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~BEBC_CCQE_XSec_1DQ2_nu() {}; 
   
+  /// \brief Fill Q2QE Event Information
   void FillEventVariables(FitEvent *event);       
-  void ApplyNormScale(double norm);
-  bool isSignal(FitEvent *event);                 
+
+  /// \brief Selection only true CCQE
+  bool isSignal(FitEvent *event);    
+
+  /// \brief Fill main histograms and correction histograms             
   void FillHistograms();
-  void Write(std::string drawOpt);
-  void ResetAll();
-  void ScaleEvents();
+
+  /// \brief Use Q2 Box to save correction info
+  inline Q2VariableBox1D* GetQ2Box(){ return static_cast<Q2VariableBox1D*>(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 q2qe;       ///< fXVar
-  double scaleF; ///< Nominal Scale Factor
-
 
 };
   
 #endif
diff --git a/src/BEBC/CMakeLists.txt b/src/BEBC/CMakeLists.txt
index e1d6202..0682d6f 100644
--- a/src/BEBC/CMakeLists.txt
+++ b/src/BEBC/CMakeLists.txt
@@ -1,71 +1,74 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/BNL_CC1npip_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
index fce757e..6c7c65a 100644
--- a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.cxx
@@ -1,95 +1,83 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1npip_Evt_1DQ2_nu.h"
 
-// The constructor
-BNL_CC1npip_Evt_1DQ2_nu::BNL_CC1npip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1npip_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0.;
-  EnuMax = 3.;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fAllowedTypes += "EVT";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  //SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_n/BNL_CC1pip_on_n_noEvents_q2_noWcut_firstQ2rem.txt");
-  SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_n/BNL_CC1pip_on_n_noEvents_q2_noWcut_HighQ2Gone.txt");
-  SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-
-  fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.);
-};
 
+//********************************************************************
+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.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_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);
 }
 
-
-/*
-void BNL_CC1npip_Evt_1DQ2_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1npip_Evt_1DQ2_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
-
-  fMCHist->Scale(fScaleFactor);
-  fMCFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
index a88b110..0c985cd 100644
--- a/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1npip_Evt_1DQ2_nu.h
@@ -1,38 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
 #define BNL_CC1NPIP_EVT_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1npip_Evt_1DQ2_nu : public Measurement1D {
 public:
-  BNL_CC1npip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  BNL_CC1npip_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~BNL_CC1npip_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
 };
   
 #endif
diff --git a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
index 3e35b38..5a67861 100644
--- a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.cxx
@@ -1,117 +1,104 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1npip_XSec_1DEnu_nu.h"
 
-// The constructor
-BNL_CC1npip_XSec_1DEnu_nu::BNL_CC1npip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1npip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 0.;
-  EnuMax = 3.0;
-  fIsDiag = true;
-  fNormError = 0.15;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR";
-
-  // User can give option of corrected BNL data or not
-  // The correction follows Wilkinson & Rodriguez et al.
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
-  } else {
-    UseCorrectedData = true;
-  }
-
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_n/";
 
+//********************************************************************
+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";
   }
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
+  fSettings.SetDataInput(DataLocation);
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  FinaliseSampleSettings();
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/proton
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / ((fNEvents + 0.)) * 2. / 1.;
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.))*16./8.;
 };
 
 
 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);
 }
-
-
-/*
-void BNL_CC1npip_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1npip_XSec_1DEnu_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
-
-  fMCHist->Scale(fScaleFactor);
-  fMCFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
index 8622c03..5cdab22 100644
--- a/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1npip_XSec_1DEnu_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
 #define BNL_CC1NPIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1npip_XSec_1DEnu_nu : public Measurement1D {
 
 public:
-  BNL_CC1npip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1npip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BNL_CC1npip_XSec_1DEnu_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  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 98aa3cb..5ce9ba0 100644
--- a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.cxx
@@ -1,71 +1,85 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1pi0_Evt_1DQ2_nu.h"
 
-// The constructor
-BNL_CC1pi0_Evt_1DQ2_nu::BNL_CC1pi0_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1pi0_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fAllowedTypes += "EVT";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  //SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pi0_on_n/BNL_CC1pi0_on_n_noEvents_q2_noWcut_firstQ2rem.txt");
-  SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pi0_on_n/BNL_CC1pi0_on_n_noEvents_q2_noWcut_HighQ2Gone.txt");
-  SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
 
+
+//********************************************************************
+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.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 f1de8c0..7ae08e2 100644
--- a/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1pi0_Evt_1DQ2_nu.h
@@ -1,39 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PI0_EVT_1DQ2_NU_H_SEEN
 #define BNL_CC1PI0_EVT_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1pi0_Evt_1DQ2_nu : public Measurement1D {
 public:
-  BNL_CC1pi0_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1pi0_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~BNL_CC1pi0_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
   
 private:
 
 };
 
 #endif
diff --git a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
index 2392332..13c0251 100644
--- a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,107 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1pi0_XSec_1DEnu_nu.h"
 
-// The constructor
-BNL_CC1pi0_XSec_1DEnu_nu::BNL_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "BNL_CC1pi0_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/neutron)";
-  EnuMin = 0.;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fNormError = 0.15;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR";
-
-  // User can give option of corrected BNL data or not
-  // The correction follows Wilkinson & Rodriguez et al.
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
-  } else {
-    UseCorrectedData = true;
-  }
 
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pi0_on_n/";
 
+//********************************************************************
+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";
   }
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
+  fSettings.SetDataInput(DataLocation);
+
+  FinaliseSampleSettings();
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/proton
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / (fNEvents + 0.) * 2. / 1.;
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/(fNEvents+0.)*16./8.;
 };
 
 
 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.;
+  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);
 }
 
 
-/*
-void BNL_CC1pi0_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1pi0_XSec_1DEnu_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
-
-  fMCHist->Scale(fScaleFactor);
-  fMCFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
index 6c58236..688acab 100644
--- a/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1pi0_XSec_1DEnu_nu.h
@@ -1,39 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PI0_XSEC_1DENU_NU_H_SEEN
 #define BNL_CC1PI0_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1pi0_XSec_1DEnu_nu : public Measurement1D {
 public:
-  BNL_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BNL_CC1pi0_XSec_1DEnu_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
- // void FillHistograms();
 
  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 43529bc..c1f4573 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,138 +1,110 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 /**
  * Kitagaki et al. Phys Rev D, Volume 34, Number 9, 1 November 1986, p2254-2565
- * K. Furuno et al. NuInt02 proceedings, (supposedly published in Nucl. Phys. B but I never found it), Retreieved from KEK preprints. 
+ * 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
 */
 
 #include "BNL_CC1ppip_Evt_1DQ2_nu.h"
 
-// The constructor
-BNL_CC1ppip_Evt_1DQ2_nu::BNL_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1ppip_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); Number of events";
-  EnuMin = 0.5;
-  EnuMax = 6.;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fDefaultTypes="EVT/SHAPE/DIAG";
-  fAllowedTypes = "EVT/SHAPE/DIAG/W14/NOW";
-
-  // Look if user has specified a W cut
-  if (type.find("W14") != std::string::npos) {
-    HadCut = 1.4;
-  } else {
-    HadCut = 10.0;
-    EnuMin = 0.0;
-    EnuMax = 10.0;
-  }
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
+//********************************************************************
+BNL_CC1ppip_Evt_1DQ2_nu::BNL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_p/";
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "BNL_CC1ppip_Evt_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  // If W < 1.4 GeV cut
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CC#pi} (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) {
-    DataLocation += "BNL_CC1pip_on_p_noEvents_q2_w14_enu05to6_firstQ2rem.txt";
-  // If W < 2.0 GeV
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/BNL/CC1pip_on_p/BNL_CC1pip_on_p_noEvents_q2_w14_enu05to6_firstQ2rem.txt" );
   } else {
-    // No Enu cuts on full W space
-    //DataLocation += "BNL_CC1pip_on_p_noEvents_q2_noWcut_firstQ2rem.txt";
-    DataLocation += "BNL_CC1pip_on_p_noEvents_q2_noWcut_HighQ2Gone.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase()
+                             + "/BNL/CC1pip_on_p/BNL_CC1pip_on_p_noEvents_q2_noWcut_HighQ2Gone.txt");
+    fSettings.SetEnuRange(0.0, 10.0);
   }
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  // Set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width") / (fNEvents + 0.);
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.);
-};
+  // 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. 
+  // 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;
+  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);
+  return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
 }
 
-/*
-void BNL_CC1ppip_Evt_1DQ2_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1ppip_Evt_1DQ2_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_1DQ2_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
index 8cd481d..9c58c22 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DQ2_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 #define BNL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
 public:
-  BNL_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~BNL_CC1ppip_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
-  //void ScaleEvents();
-  //void FillHistograms();
-
  private:
   double HadCut; // Hadronic mass cut, specified by user (W < 1.4 or no W cut)
 };
   
 #endif
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
index 7fd731f..0d2f6eb 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.cxx
@@ -1,118 +1,109 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1ppip_Evt_1DcosthAdler_nu.h"
 
-// The constructor
-BNL_CC1ppip_Evt_1DcosthAdler_nu::BNL_CC1ppip_Evt_1DcosthAdler_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1ppip_Evt_1DcosthAdler_nu";
-  fPlotTitles = "; cos#theta_{Adler}; Number of events";
-  EnuMin = 0.5;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fAllowedTypes += "EVT";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_p/BNL_CC1ppip_W14_cosThAdler.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+//********************************************************************
+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();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
 void BNL_CC1ppip_Evt_1DcosthAdler_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;
 
   // Get the hadronic mass
   double hadMass = FitUtils::MpPi(Pp, Ppip);
   // Need to boost pion and muon into resonance rest-frame to get phi (e.g. see F. Sanchez arxiv 1511.00501v2)
   //
   // Get the resonance 4-vector
   TLorentzVector Pres = Ppip + Pp;
   Ppip.Boost(-Pres.BoostVector());
   Pmu.Boost(-Pres.BoostVector());
   Pnu.Boost(Pres.BoostVector());
   // Define the vectors
   TVector3 PpipVect = Ppip.Vect();
   TVector3 PnuVect = Pnu.Vect();
   TVector3 PmuVect = Pmu.Vect();
   // Define the z-direction; should be same as Pres
   TVector3 zVect = (PnuVect-PmuVect);
   zVect *= 1/double(zVect.Mag());
 
   // Then finally construct phi as the angle between pion projection and x axis
   double cosThAdler = -999;
 
   // BNL has a M(pi, p) < 1.4 GeV cut imposed
   if (hadMass < 1400) {
     cosThAdler = cos(PpipVect.Angle(zVect));
   }
 
   fXVar = cosThAdler;
 
   return;
 };
 
 bool BNL_CC1ppip_Evt_1DcosthAdler_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi3Prong(event, 14, 211, 2212,EnuMin,EnuMax);
 }
 
-/*
-void BNL_CC1ppip_Evt_1DcosthAdler_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1ppip_Evt_1DcosthAdler_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_1DcosthAdler_nu.h b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
index 1f6f04d..a60c714 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
 #define BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1ppip_Evt_1DcosthAdler_nu : public Measurement1D {
 
 public:
-  BNL_CC1ppip_Evt_1DcosthAdler_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1ppip_Evt_1DcosthAdler_nu(nuiskey samplekey);
   virtual ~BNL_CC1ppip_Evt_1DcosthAdler_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
 
 };
   
 #endif
diff --git a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
index 1262946..e33d926 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.cxx
@@ -1,147 +1,159 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1ppip_Evt_1Dphi_nu.h"
 
-// The constructor
-BNL_CC1ppip_Evt_1Dphi_nu::BNL_CC1ppip_Evt_1Dphi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "BNL_CC1ppip_Evt_1Dphi_nu";
-  fPlotTitles = "; #phi_{Adler}; Number of events";
-  EnuMin = 0.5;
-  EnuMax = 6.0;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  fAllowedTypes += "EVT";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_p/BNL_CC1ppip_W14_phiAdler.csv");
-  this->SetupDefaultHist();
-
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
+//********************************************************************
+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.5, 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();
 
-  TRandom3 rand;
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
 };
 
 
 void BNL_CC1ppip_Evt_1Dphi_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;
 
   // Get the hadronic mass
   double hadMass = FitUtils::MpPi(Pp, Ppip);
   // Need to boost pion and muon into resonance rest-frame to get phi (e.g. see F. Sanchez arxiv 1511.00501v2)
   //
   // Get the resonance 4-vector
   TLorentzVector Pres = Ppip + Pp;
   // Boost the pion 4-vector into the resonance 4-vector rest-frame
   Ppip.Boost(Pres.BoostVector());
   Pmu.Boost(-Pres.BoostVector());
   Pp.Boost(-Pres.BoostVector());
 
   // Get the vectors from the 4-vector
   TVector3 PmuVect = Pmu.Vect();
   TVector3 PnuVect = Pnu.Vect();
   TVector3 PresVect = Pres.Vect();
   TVector3 PpipVect = Ppip.Vect();
 
   // Define y direction as being z (resonance direction) x pmu*
   TVector3 zVect = (PnuVect-PmuVect);
   zVect *= 1/double(zVect.Mag());
   TVector3 yVect = zVect.Cross(PmuVect);
   // Normalise yVector
   yVect *= 1/double(yVect.Mag());
   // define x direction as being y X z
   TVector3 xVect = yVect.Cross(zVect);
   // Normalise zVector
   xVect *= 1/double(xVect.Mag());
 
   // Project pion onto z axis
   TVector3 PpipVectZ = zVect * PpipVect.Dot(zVect);
   // Then subtract this vector off the pion vector
   TVector3 PpipVectPlane = PpipVect - PpipVectZ;
 
   // Then finally construct phi as the angle between pion projection and x axis
   double phi = -999;
 
   // BNL has a M(pi, p) < 1.4 GeV cut imposed
   if (hadMass < 1400) {
     if (PpipVectPlane.Y() > 0) {
       phi = (180./M_PI)*PpipVectPlane.Angle(xVect);
     } else if (PpipVectPlane.Y() < 0) {
       phi = (180./M_PI)*(2*M_PI-PpipVectPlane.Angle(xVect));
     } else if (PpipVectPlane.Y() == 0) {
       double randNo = rand.Rndm();
       if (randNo > 0.5) {
         phi = (180./M_PI)*PpipVectPlane.Angle(xVect);
       } else {
         phi = (180./M_PI)*(2*M_PI-PpipVectPlane.Angle(xVect));
       }
     }
   }
 
   fXVar = phi;
 
   return;
 };
 
 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 67c9ec6..867c0a7 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h
+++ b/src/BNL/BNL_CC1ppip_Evt_1Dphi_nu.h
@@ -1,41 +1,39 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
 #define BNL_CC1PPIP_EVT_1DPHI_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1ppip_Evt_1Dphi_nu : public Measurement1D {
 
 public:
-  BNL_CC1ppip_Evt_1Dphi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1ppip_Evt_1Dphi_nu(nuiskey samplekey);
   virtual ~BNL_CC1ppip_Evt_1Dphi_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  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 90bb7b0..e4a9675 100644
--- a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,114 +1,117 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CC1ppip_XSec_1DEnu_nu.h"
 
-// The constructor
-BNL_CC1ppip_XSec_1DEnu_nu::BNL_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "BNL_CC1ppip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/proton)";
-  EnuMin = 0.;
-  EnuMax = 3.0;
-  fIsDiag = true;
-  fNormError = 0.15;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/UNCORR";
-
-  // User can give option of corrected BNL data or not
-  // The correction follows Wilkinson & Rodriguez et al.
-  // Currently I've only implemented no W cut data but will implement the W < 1.4
-  if (type.find("UNCORR") != std::string::npos) {
-    UseCorrectedData = false;
+//********************************************************************
+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 {
-    UseCorrectedData = true;
+    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);
+    }
   }
 
-  std::string DataLocation = GeneralUtils::GetTopLevelDir()+"/data/BNL/CC1pip_on_p/";
+  fSettings.SetDataInput(DataLocation);
 
-  if (UseCorrectedData) {
-    DataLocation += "BNL_CC1pip_on_p_1986_corr.txt";
-    EnuMax = 6.0;
-  } else {
-    DataLocation += "BNL_CC1pip_on_p_1986.txt";
-    EnuMax = 3.0;
-  }
-  if (!type.empty() && type != "DEFAULT") {
-    std::string temp_type = type;
-    std::replace(temp_type.begin(), temp_type.end(), '/', '_');
-    fName += "_"+temp_type;
-  }
+  FinaliseSampleSettings();
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/proton
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / ((fNEvents + 0.)) * 2. / 1.;
 
-  SetDataValues(DataLocation);
-  SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/((fNEvents+0.))*16./8.;
 };
 
 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;
 
-  // Include W < 1.4 GeV data sometime soon
-  //double hadMass = FitUtils::MpPi(Pp, Ppip);
+  double hadMass = FitUtils::MpPi(Pp, Ppip);
   double Enu     = -1.0;
 
-  Enu = Pnu.E()/1000.;
+  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);
 }
 
-/*
-void BNL_CC1ppip_XSec_1DEnu_nu::FillHistograms() {
-
-  if (makeHadronicMassHist) {
-    hadMassHist->Fill(hadMass);
-  }
-
-  Measurement1D::FillHistograms();
-
-}
-
-
-void BNL_CC1ppip_XSec_1DEnu_nu::ScaleEvents() {
-
-  PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram());
-  PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram());
-
-  fMCHist->Scale(fScaleFactor);
-  fMCFine->Scale(fScaleFactor);
-
-  return;
-}
-*/
diff --git a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
index 3be2dc6..61592da 100644
--- a/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CC1ppip_XSec_1DEnu_nu.h
@@ -1,39 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef BNL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 #define BNL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class BNL_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
 public:
-  BNL_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BNL_CC1ppip_XSec_1DEnu_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
  private:
+  double wTrueCut;
   bool UseCorrectedData;
 };
   
 #endif
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
index e0099c9..9dfb637 100755
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,181 +1,148 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CCQE_Evt_1DQ2_nu.h"
 
+
 //********************************************************************
-/// @brief BNL CCQE Enu Measurement on Free Nucleons (Ref:PRD23 2499)
-///
-/// @details Enu Extracted assuming numu CCQE scattering of free nucleons.
-//********************************************************************
-BNL_CCQE_Evt_1DQ2_nu::BNL_CCQE_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+BNL_CCQE_Evt_1DQ2_nu::BNL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = "BNL_CCQE_Evt_1DQ2_nu";
-  EnuMin = 0.;
-  EnuMax = 10.;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // override input options
-  fIsDiag = true;
-  fIsRawEvents =true;
-  EnuVsQ2 = new TH2D("EnuVsQ2","EnuVsQ2",25,0.0,10.0,60,0.0,3.0);
-
-  //Setup Plots
-  this->SetDataFromDatabase("BNL/BNL_Data_PRD23_2499.root", "BNL_1DQ2_Data");
-  this->SetupDefaultHist();
-
-  // Get correction hist
-  if (applyQ2correction){
-    LOG(SAM) <<"Retrieving Q2 Correction"<<std::endl;
-    this->CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_1DQ2_Correction");
-
-    LOG(SAM) << "Creating fMCHist NoCORR"<<std::endl;
-    this->fMCHist_NoCorr = (TH1D*) this->fMCHist->Clone();
-    this->fMCHist_NoCorr->SetNameTitle( (this->fName + "_NOCORR").c_str(),(this->fName + "_NOCORR").c_str());
+  // 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.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_XSec_1DQ2_Correction");
   }
 
+  FinaliseSampleSettings();
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = 1.0;
 
-  LOG(SAM)<<"Setting up scaling"<<std::endl;
-  // Setup Scaling
-  GetEventHistogram()->Scale(this->fDataHist->Integral()/GetEventHistogram()->Integral());
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  // Different generators require slightly different rescaling factors.
-  this->fScaleFactor = (GetEventHistogram()->Integral()/(fNEvents+0.));
-  scaleF = -1.0;
-};
+  // Correction Histogram
+  if (applyQ2correction) {
 
-//********************************************************************
-/// @details Reset the histogram uncorrect
-void BNL_CCQE_Evt_1DQ2_nu::ResetAll(){
-//********************************************************************
-  Measurement1D::ResetAll();
-  this->fMCHist->Reset();
-  this->fMCFine->Reset();
-  EnuVsQ2->Reset();
+    // Correction Hist
+    CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
+                     fSettings.GetS("q2correction_hist") );
+    SetAutoProcessTH1(CorrectionHist, kCMD_Write);
 
-  if (applyQ2correction)
-    this->fMCHist_NoCorr->Reset();
 
-}
+    // 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();
 
+}
 
 //********************************************************************
-/// @details Extract Enu and totcrs from event assuming quasi-elastic scattering
-void BNL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent *event){
+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());
-  q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0.,true);
+  fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
 
-  fXVar = q2qe;
+  GetQ2Box()->fQ2 = fXVar;
   return;
 };
 
 //********************************************************************
-bool BNL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent *event){
+bool BNL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
 //********************************************************************
+
   if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
-  if (q2qe <= 0) return false;
-  return true;
-};
 
+  // Q2 cut
+  if (GetQ2Box()->fQ2 <= 0) return false;
 
+  return true;
+};
 
 //********************************************************************
-/// @details Apply Q2 scaling to weight if required
-void BNL_CCQE_Evt_1DQ2_nu::FillHistograms(){
-//********************************************************************
-
-  if (Signal){
-    if (applyQ2correction){
-      this->fMCHist_NoCorr->Fill(fXVar,Weight);
-
-
-      if (fXVar < 0.225)
-	this->Weight *= this->CorrectionHist->Interpolate(fXVar);
-    }
-
-    EnuVsQ2->Fill(Enu,fXVar, Weight);
-  }
-  if (Signal)
-    Measurement1D::FillHistograms();
-
-  LOG(DEB) <<"fXVar = "<<fXVar<<" "<<Weight<<std::endl;
-  return;
-}
-
-
-
+void BNL_CCQE_Evt_1DQ2_nu::FillHistograms() {
 //********************************************************************
-/// @details Apply scaling to uncorrected fMCHist_NoCorr and scale to match data
-void BNL_CCQE_Evt_1DQ2_nu::ScaleEvents(){
-  //********************************************************************
 
-  this->fMCHist->Scale(fScaleFactor);
-  this->fMCFine->Scale(fScaleFactor);
-  if (applyQ2correction) this->fMCHist_NoCorr->Scale(fScaleFactor);
+  if (applyQ2correction) {
+    fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
 
-  // Scale to match data
-  scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist, fMaskHist);
-
-  this->fMCHist->Scale(scaleF);
-  this->fMCFine->Scale(scaleF);
-
-  if (applyQ2correction){
-    scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist_NoCorr, fMaskHist);
-    this->fMCHist_NoCorr->Scale(scaleF);
+    if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
+        GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
+      Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
   }
 
-  return;
+  Measurement1D::FillHistograms();
 
 }
 
-
 //********************************************************************
-/// @brief Include Q2 Correction plots into data write
-void BNL_CCQE_Evt_1DQ2_nu::Write(std::string drawOpt){
+void BNL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
 //********************************************************************
-  Measurement1D::Write(drawOpt);
 
-  EnuVsQ2->Write();
+  Measurement1D::ScaleEvents();
 
-  if (applyQ2correction){
-    this->CorrectionHist->Write();
-    this->fMCHist_NoCorr->Write();
+  // Flux unfold our extra histogram
+  if (applyQ2correction) {
+    if (fMCHist_NoCorr->Integral()) {
+      fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
+    }
   }
-
-
-  return;
 }
 
 
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
index 212fec0..acfc74f 100755
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
+++ b/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
@@ -1,52 +1,64 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  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();
-  void Write(std::string drawOpt);
-  void ResetAll();
+
+  /// \brief scale the MC Hist and correction histograms
   void ScaleEvents();
 
+  /// \brief Use Q2 Box to save correction info
+  inline Q2VariableBox1D* GetQ2Box(){ return static_cast<Q2VariableBox1D*>(GetBox()); };
+
+  /// \brief Create Q2 Box to save correction info
+  inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
+
  private:
 
-  double q2qe; ///< fXVar
-  bool applyQ2correction; ///< Deuterium-Nucleon Correction Flag
-  TH1D* CorrectionHist; ///< Deuterium-Nucleon Correction plot
-  TH1D* fMCHist_NoCorr; ///< Q2 fMCHist without Deut correction
-  double scaleF; ///< data/mc scaling value
-  TH2D* EnuVsQ2;
+  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 4449624..f337515 100644
--- a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
+++ b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.cxx
@@ -1,91 +1,147 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "BNL_CCQE_XSec_1DEnu_nu.h"
 
 //********************************************************************
-/// @brief BNL CCQE Enu Measurement on Free Nucleons (Ref:PRD23 2499)
-///
-/// @details Enu Extracted assuming numu CCQE scattering of free nucleons.
-//********************************************************************
-BNL_CCQE_XSec_1DEnu_nu::BNL_CCQE_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+BNL_CCQE_XSec_1DEnu_nu::BNL_CCQE_XSec_1DEnu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = "BNL_CCQE_XSec_1DEnu_nu";
-  EnuMin = 0.;
-  EnuMax = 6.;
-  fIsDiag = true;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Plots
-  this->SetDataFromDatabase("BNL/BNL_Data_PRD23_2499.root", "BNL_1DEnu_Data");
-  this->SetupDefaultHist();
-
-  // Get Correction Hist
-  if (applyQ2correction){
-    this->CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_1DQ2_Correction");
+  // 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.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_XSec_1DQ2_Correction");
   }
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  FinaliseSampleSettings();
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*(2.0/1.0)*1E-38/(fNEvents+0.));
+  // 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();
 
+}
 
 //********************************************************************
-///@details Fill Enu for the event
-void BNL_CCQE_XSec_1DEnu_nu::FillEventVariables(FitEvent *event){
+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());
-  Enu_rec = FitUtils::EnuQErec(Pmu, cos(ThetaMu), 0.,true);
+  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){
+bool BNL_CCQE_XSec_1DEnu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCQE(event, 14, EnuMin, EnuMax);
 };
 
+
 //********************************************************************
-/// @details Apply Q2 scaling to weight if required
-void BNL_CCQE_XSec_1DEnu_nu::FillHistograms(){
+void BNL_CCQE_XSec_1DEnu_nu::FillHistograms() {
 //********************************************************************
 
-  if (applyQ2correction){
-    this->Weight *= this->CorrectionHist->Interpolate(q2qe);
+  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 de25aaf..6adb6ea 100644
--- a/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h
+++ b/src/BNL/BNL_CCQE_XSec_1DEnu_nu.h
@@ -1,44 +1,58 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef 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(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  BNL_CCQE_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~BNL_CCQE_XSec_1DEnu_nu() {};
   
+  /// \brief Get Q2 assuming QE scattering
   void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *nvect);
+
+  /// \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<Q2VariableBox1D*>(GetBox()); };
+
+  /// \brief Create Q2 Box to save correction info
+  inline MeasurementVariableBox* CreateBox(){ return new Q2VariableBox1D(); };
+
  private:
-  
-  double q2qe;
-  bool applyQ2correction;
-  TH1D* CorrectionHist;
+  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 e7d6e53..e92b5e1 100644
--- a/src/BNL/CMakeLists.txt
+++ b/src/BNL/CMakeLists.txt
@@ -1,69 +1,72 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 BNL_CC1npip_Evt_1DQ2_nu.cxx
 BNL_CC1npip_XSec_1DEnu_nu.cxx
 BNL_CC1pi0_Evt_1DQ2_nu.cxx
 BNL_CC1pi0_XSec_1DEnu_nu.cxx
 BNL_CC1ppip_Evt_1DQ2_nu.cxx
 BNL_CC1ppip_XSec_1DEnu_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
 )
 
 set(HEADERFILES
 BNL_CC1npip_Evt_1DQ2_nu.h
 BNL_CC1npip_XSec_1DEnu_nu.h
 BNL_CC1pi0_Evt_1DQ2_nu.h
 BNL_CC1pi0_XSec_1DEnu_nu.h
 BNL_CC1ppip_Evt_1DQ2_nu.h
 BNL_CC1ppip_XSec_1DEnu_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
 )
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/K2K/CMakeLists.txt b/src/Electron/CMakeLists.txt
similarity index 88%
copy from src/K2K/CMakeLists.txt
copy to src/Electron/CMakeLists.txt
index 756b444..c9abb0d 100644
--- a/src/K2K/CMakeLists.txt
+++ b/src/Electron/CMakeLists.txt
@@ -1,51 +1,55 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
-K2K_NC1pi0_Evt_1Dppi0_nu.cxx
+ElectronScattering_DurhamData.cxx
 )
 
 set(HEADERFILES
-K2K_NC1pi0_Evt_1Dppi0_nu.h
+ElectronScattering_DurhamData.h
 )
 
-set(LIBNAME expK2K)
+
+set(LIBNAME expElectron)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
-include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
+include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/Electron/ElectronScattering_DurhamData.cxx b/src/Electron/ElectronScattering_DurhamData.cxx
new file mode 100644
index 0000000..7a8c300
--- /dev/null
+++ b/src/Electron/ElectronScattering_DurhamData.cxx
@@ -0,0 +1,436 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "ElectronScattering_DurhamData.h"
+
+//********************************************************************
+ElectronScattering_DurhamData::ElectronScattering_DurhamData(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "Electron Scattering Durham Data sample. \n" \
+                        "Target: Multiple \n" \
+                        "Flux: Energy should match data being handled \n" \
+                        "Signal: Any event with an electron in the final state \n";
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.DefineAllowedSpecies("electron");
+  fSettings.SetTitle("Electron");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetXTitle("q0");
+  fSettings.SetYTitle("#sigma");
+  // fIsRawEvents = true;
+
+  FinaliseSampleSettings();
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromName(fSettings.GetS("name"));
+  SetCovarFromDiagonal();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  // fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) / TotalIntegratedFlux());
+  EnuMin = fZLowLim;
+  EnuMax = fZHighLim;
+
+  double sigscale = GetEventHistogram()->Integral() * 1E-38 / double(fNEvents) / TotalIntegratedFlux();
+  double dangle = 2 * M_PI * fabs((1. - cos(fYLowLim * M_PI / 180.)) - (1. - cos(fYHighLim * M_PI / 180.)));
+  fScaleFactor = sigscale / dangle / fZCenter;
+
+
+  std::cout << "Event Integral = " << GetEventHistogram()->Integral("width") << std::endl;
+  std::cout << "Flux Integral = " << TotalIntegratedFlux("width") << " " << fZLowLim << " " << fZHighLim << std::endl;
+  std::cout << "DAngle = " << dangle << std::endl;
+  std::cout << "sigscale = " << sigscale << std::endl;
+  std::cout << "fZCenter = " << fZCenter << std::endl;
+
+  // Finish up
+  FinaliseMeasurement();
+};
+
+//********************************************************************
+void ElectronScattering_DurhamData::SetDataFromName(std::string name) {
+//********************************************************************
+
+  // Data Should be given in the format
+  // Electron_Z_A_Energy_Theta_Source
+  std::vector<std::string> splitstring = GeneralUtils::ParseToStr(name, "_");
+  std::string zstring = splitstring[1];
+  std::string astring = splitstring[2];
+  std::string estring = splitstring[3];
+  std::string tstring = splitstring[4];
+  std::string sstring = splitstring[5];
+
+  fYCenter = GeneralUtils::StrToDbl(tstring);
+  fZCenter = GeneralUtils::StrToDbl(estring);
+
+  // Create effective E and Theta bin Edges
+  std::vector<double> thetabinedges;
+  std::vector<double> ebinedges;
+
+  int nthetabins    = FitPar::Config().GetParI("Electron_NThetaBins");
+  int nebins        = FitPar::Config().GetParI("Electron_NEnergyBins");
+  double thetawidth = FitPar::Config().GetParD("Electron_ThetaWidth");
+  double ewidth     = FitPar::Config().GetParD("Electron_EnergyWidth");
+
+  for (int i = -nthetabins; i <= nthetabins; i++) {
+    thetabinedges.push_back( fYCenter + thetawidth * (double(i)) );
+  }
+  for (int i = -nebins; i <= nebins; i++) {
+    double newval = fZCenter + ewidth * (double(i));
+
+    if (newval < 0.0) newval = 0.0;
+    if (newval < GetEventHistogram()->GetXaxis()->GetXmin()) newval = GetEventHistogram()->GetXaxis()->GetXmin();
+    if (newval > GetEventHistogram()->GetXaxis()->GetXmax()) newval = GetEventHistogram()->GetXaxis()->GetXmax();
+    if (std::find(ebinedges.begin(), ebinedges.end(), newval) != ebinedges.end()) continue;
+    ebinedges.push_back(newval);
+  }
+
+  // Determine target
+  std::string target = "";
+  if (!zstring.compare("6") && !astring.compare("12")) target = "12C.dat";
+  else {
+    ERR(FTL) << "Target not supported in electron scattering module!" << std::endl;
+    throw;
+  }
+
+
+  // Fill Data Points
+
+  std::string line;
+  std::ifstream mask( (FitPar::GetDataBase() + "/Electron/" + target).c_str() , ifstream::in);
+  int i = 0;
+
+  std::vector<double> pointx;
+  std::vector<double> errorx;
+  std::vector<double> pointy;
+  std::vector<double> errory;
+  double scalef = 1.E-38 * 1.E5;
+
+  while (std::getline(mask >> std::ws, line, '\n')) {
+    // std::cout << "Line = " << line << std::endl;
+    if (line.empty()) continue;
+
+    std::vector<std::string> lineentries = GeneralUtils::ParseToStr(line, " ");
+    // std::cout << "Checking : " << line << std::endl;
+    if (zstring.compare(lineentries[0])) continue;
+    if (astring.compare(lineentries[1])) continue;
+    if (estring.compare(lineentries[2])) continue;
+    if (tstring.compare(lineentries[3])) continue;
+    if (sstring.compare(lineentries[7])) continue;
+
+    std::cout << "Registering data point : " << line << std::endl;
+    std::cout << "Adding Graph Point : " <<  GeneralUtils::StrToDbl(lineentries[4]) << " " << GeneralUtils::StrToDbl(lineentries[5]) << std::endl;
+
+    // Loop through x and y points and find a place to insert
+    if (pointx.empty()) {
+      pointx.push_back(GeneralUtils::StrToDbl(lineentries[4]));
+      errorx.push_back(0.0);
+      pointy.push_back(GeneralUtils::StrToDbl(lineentries[5]) * scalef);
+      errory.push_back(GeneralUtils::StrToDbl(lineentries[6]) * scalef);
+
+    } else {
+      for (size_t j = 0; j < pointx.size(); j++) {
+
+        if (GeneralUtils::StrToDbl(lineentries[4]) < pointx[j] && j == 0) {
+          std::cout << "Inserting at start point iterator " << std::endl;
+          pointx.insert(pointx.begin() + j, GeneralUtils::StrToDbl(lineentries[4]));
+          errorx.insert(errorx.begin() + j, 0.0);
+          pointy.insert(pointy.begin() + j, GeneralUtils::StrToDbl(lineentries[5]) * scalef);
+          errory.insert(errory.begin() + j, GeneralUtils::StrToDbl(lineentries[6]) * scalef);
+          break;
+
+        } else if (GeneralUtils::StrToDbl(lineentries[4]) > pointx[j] && j == pointx.size() - 1) {
+          std::cout << "Pushing back data point " << std::endl;
+          pointx.push_back(GeneralUtils::StrToDbl(lineentries[4]));
+          errorx.push_back(0.0);
+          pointy.push_back(GeneralUtils::StrToDbl(lineentries[5]) * scalef);
+          errory.push_back(GeneralUtils::StrToDbl(lineentries[6]) * scalef);
+          break;
+
+        } else if (GeneralUtils::StrToDbl(lineentries[4]) > pointx[j - 1] && GeneralUtils::StrToDbl(lineentries[4]) < pointx[j]) {
+          std::cout << "Inserting at point iterator = " << j << std::endl;
+
+          pointx.insert(pointx.begin() + j, GeneralUtils::StrToDbl(lineentries[4]));
+          errorx.insert(errorx.begin() + j, 0.0);
+          pointy.insert(pointy.begin() + j, GeneralUtils::StrToDbl(lineentries[5]) * scalef);
+          errory.insert(errory.begin() + j, GeneralUtils::StrToDbl(lineentries[6]) * scalef);
+          break;
+        }
+      }
+
+
+
+    }
+
+    // pointx.push_back(GeneralUtils::StrToDbl(lineentries[4]));
+    // errorx.push_back(0.0);
+    // pointy.push_back(GeneralUtils::StrToDbl(lineentries[5]));
+    // errory.push_back(GeneralUtils::StrToDbl(lineentries[6]));
+
+    i++;
+  }
+
+  for (uint i  = 0; i < pointx.size(); i++) {
+    std::cout << "Q0 Point " << i << " = " << pointx[i] << std::endl;
+  }
+
+
+  fDataGraph = new TGraphErrors(pointx.size(), &pointx[0], &pointy[0], &errorx[0], &errory[0]);
+  fDataGraph->SetNameTitle((fName + "_data_GRAPH").c_str(), (fName + "_data_GRAPH").c_str());
+
+
+// Now form an effective data and mc histogram
+  std::vector<double> q0binedges;
+  const double* x = fDataGraph->GetX();
+
+// Loop over graph and get mid way point between each data point.
+  for (int i = 0; i < fDataGraph->GetN(); i++) {
+    std::cout << "X Point = " << x[i] << std::endl;
+
+    if (i == 0) {
+      // First point set lower width as half distance to point above
+      q0binedges.push_back(x[0] - ((x[1] - x[0]) / 2.0));
+    } else if (i == fDataGraph->GetN() - 1) {
+      // Last point set upper width as half distance to point above.
+      q0binedges.push_back(x[i] - ((x[i] - x[i - 1]) / 2.0));
+      q0binedges.push_back(x[i] + ((x[i] - x[i - 1]) / 2.0));
+    } else {
+      // Set half distance to point below
+      q0binedges.push_back(x[i] - ((x[i] - x[i - 1]) / 2.0));
+    }
+  }
+
+// Bubble Sort
+
+
+
+
+  for (uint i  = 0; i < q0binedges.size(); i++) {
+    std::cout << "Q0 Edge " << i << " = " << q0binedges[i] << std::endl;
+  }
+
+  for (uint i  = 0; i < ebinedges.size(); i++) {
+    std::cout << "e Edge " << i << " = " << ebinedges[i] << std::endl;
+  }
+  for (uint i  = 0; i < thetabinedges.size(); i++) {
+    std::cout << "theta Edge " << i << " = " << thetabinedges[i] << std::endl;
+  }
+
+// Form the data hist, mchist, etc
+  fDataHist = new TH1D((fName + "_data").c_str(), (fName + "_data").c_str(),
+                       q0binedges.size() - 1, &q0binedges[0]);
+  fMCHist = (TH1D*) fDataHist->Clone("MC");
+
+  const double* y = fDataGraph->GetY();
+  const double* ey = fDataGraph->GetEY();
+  for (int i = 0; i < fDataGraph->GetN(); i++) {
+    std::cout << "Setting Data Bin " << i + 1 << " to " << y[i] << " +- " << ey[i] << std::endl;
+    fDataHist->SetBinContent(i + 1, y[i]);
+    fDataHist->SetBinError(i + 1, ey[i]);
+
+    fMCHist->SetBinContent(i + 1, 0.0);
+    fMCHist->SetBinError(i + 1, 0.0);
+  }
+
+
+
+  fMCScan_Q0vsThetavsE = new TH3D((fName + "_MC_q0vsthetavse").c_str(), "MC_q0vsthetavse",
+                                  q0binedges.size() - 1, &q0binedges[0],
+                                  thetabinedges.size() - 1, &thetabinedges[0],
+                                  ebinedges.size() - 1 , &ebinedges[0]);
+  fMCScan_Q0vsThetavsE->Reset();
+  fMCScan_Q0vsTheta = new TH2D((fName + "_MC_q0vstheta").c_str(), "MC_q0vstheta",
+                               q0binedges.size() - 1, &q0binedges[0],
+                               thetabinedges.size() - 1, &thetabinedges[0]);
+  fMCScan_Q0vsTheta->Reset();
+
+  fMCScan_Q0vsE = new TH2D((fName + "_MC_q0vse").c_str(), "MC_q0vse",
+                           q0binedges.size() - 1, &q0binedges[0],
+                           ebinedges.size() - 1 , &ebinedges[0]);
+  fMCScan_Q0vsE->Reset();
+
+  fXLowLim = fMCScan_Q0vsThetavsE->GetXaxis()->GetBinLowEdge(1);
+  fXHighLim = fMCScan_Q0vsThetavsE->GetXaxis()->GetBinLowEdge(fMCScan_Q0vsThetavsE->GetNbinsX() + 2);
+
+  fYLowLim = fMCScan_Q0vsThetavsE->GetYaxis()->GetBinLowEdge(1);
+  fYHighLim = fMCScan_Q0vsThetavsE->GetYaxis()->GetBinLowEdge(fMCScan_Q0vsThetavsE->GetNbinsY() + 2);
+
+  fZLowLim = fMCScan_Q0vsThetavsE->GetZaxis()->GetBinLowEdge(1);
+  fZHighLim = fMCScan_Q0vsThetavsE->GetZaxis()->GetBinLowEdge(fMCScan_Q0vsThetavsE->GetNbinsZ() + 2);
+}
+
+
+//********************************************************************
+void  ElectronScattering_DurhamData::FillEventVariables(FitEvent * event) {
+//********************************************************************
+
+  if (event->NumFSParticle(11) == 0)
+    return;
+
+  FitParticle* ein  = event->PartInfo(0);
+  FitParticle* eout = event->GetHMFSParticle(11);
+
+  double q0    = fabs(ein->fP.E() - eout->fP.E()) / 1000.0;
+  double E     = ein->fP.E() / 1000.0;
+  double theta = ein->fP.Vect().Angle(eout->fP.Vect()) * 180. / M_PI;
+
+  fXVar = q0;
+  fYVar = theta;
+  fZVar = E;
+
+  // std::cout << "Got Event " << q0 << " " << theta << " " << E << std::endl;
+
+  return;
+};
+
+//********************************************************************
+bool ElectronScattering_DurhamData::isSignal(FitEvent * event) {
+//********************************************************************
+
+  if (event->NumFSParticle(11) == 0)
+    return false;
+
+  // std::cout << "fXVar = " << fXVar << " " << fXLowLim << " " << fXHighLim << std::endl;
+  // std::cout << "fYVar = " << fYVar << " " << fYLowLim << " " << fYHighLim << std::endl;
+  // std::cout << "fZVar = " << fZVar << " " << fZLowLim << " " << fZHighLim << std::endl;
+
+  if (fXVar < fXLowLim or fXVar > fXHighLim) return false;
+  if (fYVar < fYLowLim or fYVar > fYHighLim) return false;
+  if (fZVar < fZLowLim or fZVar > fZHighLim) return false;
+
+  return true;
+};
+
+//********************************************************************
+void ElectronScattering_DurhamData::FillHistograms() {
+//********************************************************************
+
+  Measurement1D::FillHistograms();
+
+  if (Signal) {
+    fMCScan_Q0vsThetavsE->Fill(fXVar, fYVar, fZVar);
+    fMCScan_Q0vsTheta->Fill(fXVar, fYVar);
+    fMCScan_Q0vsE->Fill(fXVar, fZVar);
+  }
+}
+//   Weight = 1.0;
+//   if (Signal) {
+//     fMCHist->Fill(fXVar, Weight);
+//     fMCFine->Fill(fXVar, Weight);
+//     fMCStat->Fill(fXVar, 1.0);
+
+//     if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, fXVar, Weight);
+//   }
+// }
+
+void ElectronScattering_DurhamData::ResetAll() {
+  Measurement1D::ResetAll();
+  fMCScan_Q0vsThetavsE->Reset();
+  fMCScan_Q0vsTheta->Reset();
+  fMCScan_Q0vsE->Reset();
+}
+
+void ElectronScattering_DurhamData::ApplyNormScale(double norm) {
+  Measurement1D::ApplyNormScale(norm);
+  fMCScan_Q0vsThetavsE->Scale(1.0 / norm);
+  fMCScan_Q0vsTheta->Scale(1.0 / norm);
+  fMCScan_Q0vsE->Scale(1.0 / norm);
+}
+
+//********************************************************************
+void ElectronScattering_DurhamData::ScaleEvents() {
+//********************************************************************
+  Measurement1D::ScaleEvents();
+
+  /*
+  fMCScan_Q0vsThetavsE->Scale(fScaleFactor, "width");
+
+  // Project into fMCScan_Q0vsTheta
+  for (int x = 0; x < fMCScan_Q0vsThetavsE->GetNbinsX(); x++) {
+    for (int y = 0; y < fMCScan_Q0vsThetavsE->GetNbinsY(); y++) {
+      double total = 0.;
+      for (int z = 0; z < fMCScan_Q0vsThetavsE->GetNbinsZ(); z++) {
+        double zwidth = fMCScan_Q0vsThetavsE->GetZaxis()->GetBinWidth(z + 1);
+        total += fMCScan_Q0vsThetavsE->GetBinContent(x + 1, y + 1, z + 1) * zwidth;
+      }
+      fMCScan_Q0vsTheta->SetBinContent(x + 1, y + 1, total);
+    }
+  }
+
+  // Project into fMCScan_Q0vsE
+  for (int x = 0; x < fMCScan_Q0vsThetavsE->GetNbinsX(); x++) {
+    for (int z = 0; z < fMCScan_Q0vsThetavsE->GetNbinsZ(); z++) {
+      double total = 0.;
+      for (int y = 0; y < fMCScan_Q0vsThetavsE->GetNbinsY(); y++) {
+        double ywidth = fMCScan_Q0vsThetavsE->GetYaxis()->GetBinWidth(y + 1);
+        total += fMCScan_Q0vsThetavsE->GetBinContent(x + 1, y + 1, z + 1) * ywidth;
+      }
+      fMCScan_Q0vsE->SetBinContent(x + 1, z + 1, total);
+    }
+  }
+
+  // Project fMCScan_Q0vsTheta into MC Hist
+  for (int x = 0; x < fMCScan_Q0vsTheta->GetNbinsX(); x++) {
+    double total = 0.;
+    for (int y = 0; y < fMCScan_Q0vsTheta->GetNbinsY(); y++) {
+      double ywidth = fMCScan_Q0vsTheta->GetYaxis()->GetBinWidth(y + 1);
+      total += fMCScan_Q0vsTheta->GetBinContent(x + 1, y + 1);
+    }
+    double xwidth = fMCScan_Q0vsTheta->GetXaxis()->GetBinWidth(x + 1);
+    fMCHist->SetBinContent(x + 1, total * xwidth);
+  }
+
+  fMCHist->Scale(fDataHist->Integral() / fMCHist->Integral());
+  */
+}
+
+//********************************************************************
+int ElectronScattering_DurhamData::GetNDOF() {
+//********************************************************************
+  return fDataGraph->GetN();
+}
+
+
+void ElectronScattering_DurhamData::Write(std::string drawOpts) {
+
+  Measurement1D::Write(drawOpts);
+
+  fMCScan_Q0vsThetavsE->Write();
+  fMCScan_Q0vsTheta->Write();
+  fMCScan_Q0vsE->Write();
+  fDataGraph->Write();
+
+}
+
+double ElectronScattering_DurhamData::GetLikelihood() {
+  return 0.0;
+}
+
+void ElectronScattering_DurhamData::SetFitOptions(std::string opt) {
+  return;
+}
+
+TH1D* ElectronScattering_DurhamData::GetMCHistogram(void) {
+  return fMCHist;
+}
+
+TH1D* ElectronScattering_DurhamData::GetDataHistogram(void) {
+  return fDataHist;
+}
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h b/src/Electron/ElectronScattering_DurhamData.h
similarity index 56%
copy from src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h
copy to src/Electron/ElectronScattering_DurhamData.h
index c7873f1..b76d539 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h
+++ b/src/Electron/ElectronScattering_DurhamData.h
@@ -1,53 +1,65 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef MINIBOONE_CCQE_XSEC_1DQ2_ANTINU_H_SEEN
-#define MINIBOONE_CCQE_XSEC_1DQ2_ANTINU_H_SEEN
+#ifndef ElectronScattering_DurhamData_H_SEEN
+#define ElectronScattering_DurhamData_H_SEEN
 
 #include "Measurement1D.h"
+#include "TH3D.h"
 
 //********************************************************************
-class MiniBooNE_CCQE_XSec_1DQ2_antinu : public Measurement1D {
+class ElectronScattering_DurhamData : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MiniBooNE_CCQE_XSec_1DQ2_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~MiniBooNE_CCQE_XSec_1DQ2_antinu() {};
+  ElectronScattering_DurhamData(nuiskey samplekey);
+  virtual ~ElectronScattering_DurhamData() {};
 
   void FillEventVariables(FitEvent *event);
-  void Write(std::string drawOpt);
   void FillHistograms();
   bool isSignal(FitEvent *event);
-  void ScaleEvents();
-  void ApplyNormScale(double norm);
+  void ScaleEvents(); // Converts TH3D to TH1D
   void ResetAll();
-  TH1D* fMCHist_NONCCPIM[61]; ///< Plots in CCQELike mode to tag PDG of the NONCCPIM background
-  TH1D* fMCHist_CCPIM[61]; ///< Plots in CCQELike mode to tag PDG of the CCPIM background
-  TH1D* fMCHist_CCQELIKE[61]; ///< Plots in CCQELike mode to tag PDG of the background
-
- private:
-  bool fCCQElike; ///< Flag for running in CCQELike mode
-  bool fUseCorrectedCTarget; ///< Flag for using corrected `C-Target' data.
-  TH1D* fDataHist_CCQELIKE; ///< CCQELike data contribution
-  TH1D* fDataHist_CCPIM; ///< CCPIM data contribution
-  TH1D* fDataHist_NONCCPIM; ///< NONCCPIM data contribution
+  void ApplyNormScale(double norm);
+  void Write(std::string drawOpts);
+void SetDataFromName(std::string name);
+  int GetNDOF();
+  double GetLikelihood();
+  void SetFitOptions(std::string opt);
+  // MeasurementVariableBox* CreateBox() {return new MeasurementVariableBox1D();};
+  // ElectronVariableBox* GetBox() { return static_cast<ElectronVariableBox*>(MeasurementBase::GetBox()); };
+
+  TH1D* GetMCHistogram(void);
+  TH1D* GetDataHistogram(void);
+
+private:
+
+  TH3D* fMCScan_Q0vsThetavsE;
+  TH2D* fMCScan_Q0vsTheta;
+  TH2D* fMCScan_Q0vsE;
+  // TH1D* fMCHist;
+  // TH1D* fDataHist;
+  TGraphErrors* fDataGraph;
+
+  double fXLowLim, fXHighLim, fYLowLim, fYHighLim, fZLowLim, fZHighLim;
+  double fYCenter, fZCenter;
 };
 
 #endif
diff --git a/src/FCN/CMakeLists.txt b/src/FCN/CMakeLists.txt
index e9e4283..274ee82 100644
--- a/src/FCN/CMakeLists.txt
+++ b/src/FCN/CMakeLists.txt
@@ -1,68 +1,72 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 JointFCN.cxx
 SampleList.cxx
 )
 
 set(HEADERFILES
 JointFCN.h
 MinimizerFCN.h
 SampleList.h
 )
 
 set(LIBNAME FCN)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 include_directories(${EXP_INCLUDE_DIRECTORIES})
 
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 
 include_directories(${CMAKE_SOURCE_DIR}/src/ANL)
 include_directories(${CMAKE_SOURCE_DIR}/src/BNL)
 include_directories(${CMAKE_SOURCE_DIR}/src/FNAL)
 include_directories(${CMAKE_SOURCE_DIR}/src/GGM)
 include_directories(${CMAKE_SOURCE_DIR}/src/MINERvA)
 include_directories(${CMAKE_SOURCE_DIR}/src/MiniBooNE)
 include_directories(${CMAKE_SOURCE_DIR}/src/T2K)
-
+include_directories(${CMAKE_SOURCE_DIR}/src/Electron)
 include_directories(${CMAKE_SOURCE_DIR}/src/MCStudies)
 include_directories(${CMAKE_SOURCE_DIR}/src/FCN)
 
+
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/FCN/JointFCN.cxx b/src/FCN/JointFCN.cxx
index 9a51ec4..6bced04 100755
--- a/src/FCN/JointFCN.cxx
+++ b/src/FCN/JointFCN.cxx
@@ -1,554 +1,1036 @@
 #include "JointFCN.h"
 #include <stdio.h>
 #include "FitUtils.h"
 
-//***************************************************
-JointFCN::JointFCN(std::string cardfile, TFile* outfile) {
-  //***************************************************
+// //***************************************************
+// JointFCN::JointFCN(std::string cardfile, TFile* outfile) {
+//   //***************************************************
+
+//   fOutputDir = gDirectory;
+//   FitPar::Config().out = outfile;
+
+//   fCardFile = cardfile;
+
+//   LoadSamples(fCardFile);
+
+//   fCurIter = 0;
+//   fMCFilled = false;
+
+//   fOutputDir->cd();
+
+//   fIterationTree = NULL;
+//   fDialVals = NULL;
+//   fNDials = 0;
+
+//   fUsingEventManager = FitPar::Config().GetParB("EventManager");
+//   fOutputDir->cd();
+// };
+
+
+JointFCN::JointFCN(TFile* outfile) {
 
   fOutputDir = gDirectory;
-  FitPar::Config().out = outfile;
+  if (outfile)
+    FitPar::Config().out = outfile;
 
-  fCardFile = cardfile;
+  std::vector<nuiskey> samplekeys =  Config::QueryKeys("sample");
+  LoadSamples(samplekeys);
+
+  std::vector<nuiskey> covarkeys =  Config::QueryKeys("covar");
+  LoadPulls(covarkeys);
+
+  fCurIter = 0;
+  fMCFilled = false;
+
+  fIterationTree = NULL;
+  fDialVals = NULL;
+  fNDials = 0;
+
+  fUsingEventManager = FitPar::Config().GetParB("EventManager");
+  fOutputDir->cd();
+
+}
+
+JointFCN::JointFCN(std::vector<nuiskey> samplekeys, TFile* outfile) {
+
+  fOutputDir = gDirectory;
+  if (outfile)
+    FitPar::Config().out = outfile;
 
-  LoadSamples(fCardFile);
+  LoadSamples(samplekeys);
 
   fCurIter = 0;
   fMCFilled = false;
 
   fOutputDir->cd();
 
   fIterationTree = NULL;
   fDialVals = NULL;
   fNDials = 0;
 
   fUsingEventManager = FitPar::Config().GetParB("EventManager");
-};
+  fOutputDir->cd();
+
+}
 
 //***************************************************
 JointFCN::~JointFCN() {
   //***************************************************
 
   // Delete Samples
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
     delete exp;
   }
 
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
     delete pull;
   }
 
   // Sort Tree
   if (fIterationTree) DestroyIterationTree();
   if (fDialVals) delete fDialVals;
   if (fSampleLikes) delete fSampleLikes;
 };
 
 //***************************************************
 void JointFCN::CreateIterationTree(std::string name, FitWeight* rw) {
   //***************************************************
 
-  LOG(FIT) << " Creating new iteration tree! " << endl;
+  LOG(FIT) << " Creating new iteration tree! " << std::endl;
   if (fIterationTree && !name.compare(fIterationTree->GetName())) {
     fIterationTree->Reset();
     return;
   }
 
   fIterationTree = new TTree(name.c_str(), name.c_str());
 
   // Setup Main Branches
   fIterationTree->Branch("total_likelihood", &fLikelihood,
                          "total_likelihood/D");
   fIterationTree->Branch("total_ndof", &fNDOF, "total_ndof/I");
 
   // Setup Sample Arrays
   int ninputs = fSamples.size() + fPulls.size();
   fSampleLikes = new double[ninputs];
   fSampleNDOF = new int[ninputs];
   fNDOF = GetNDOF();
 
   // Setup Sample Branches
   int count = 0;
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
 
     std::string name = exp->GetName();
     std::string liketag = name + "_likelihood";
     std::string ndoftag = name + "_ndof";
 
     fIterationTree->Branch(liketag.c_str(), &fSampleLikes[count],
                            (liketag + "/D").c_str());
     fIterationTree->Branch(ndoftag.c_str(), &fSampleNDOF[count],
                            (ndoftag + "/D").c_str());
 
     count++;
   }
 
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
 
     std::string name = pull->GetName();
     std::string liketag = name + "_likelihood";
     std::string ndoftag = name + "_ndof";
 
     fIterationTree->Branch(liketag.c_str(), &fSampleLikes[count],
                            (liketag + "/D").c_str());
     fIterationTree->Branch(ndoftag.c_str(), &fSampleNDOF[count],
                            (ndoftag + "/D").c_str());
 
     count++;
   }
 
   // Add Dial Branches
   std::vector<std::string> dials = rw->GetDialNames();
   fNDials = dials.size();
   fDialVals = new double[fNDials];
 
   for (int i = 0; i < fNDials; i++) {
     fIterationTree->Branch(dials[i].c_str(), &fDialVals[i],
                            (dials[i] + "/D").c_str());
   }
 }
 
 //***************************************************
 void JointFCN::DestroyIterationTree() {
   //***************************************************
 
   if (!fIterationTree) {
     delete fIterationTree;
   }
 }
 
 //***************************************************
 void JointFCN::WriteIterationTree() {
   //***************************************************
 
   if (!fIterationTree) {
-    ERR(FTL) << "Can't save empty iteration tree!" << endl;
+    ERR(FTL) << "Can't save empty iteration tree!" << std::endl;
     throw;
   }
   fIterationTree->Write();
 }
 
 //***************************************************
 void JointFCN::FillIterationTree(FitWeight* rw) {
   //***************************************************
 
   if (!fIterationTree) {
-    ERR(FTL) << "Trying to fill iteration_tree when it is NULL!" << endl;
+    ERR(FTL) << "Trying to fill iteration_tree when it is NULL!" << std::endl;
     throw;
   }
 
   rw->GetAllDials(fDialVals, fNDials);
   fIterationTree->Fill();
 }
 
 //***************************************************
 double JointFCN::DoEval(const double* x) {
   //***************************************************
 
   // WEIGHT ENGINE
   fDialChanged = FitBase::GetRW()->HasRWDialChanged(x);
   FitBase::GetRW()->UpdateWeightEngine(x);
   if (fDialChanged) {
     FitBase::GetRW()->Reconfigure();
     FitBase::EvtManager().ResetWeightFlags();
   }
+  if (LOG_LEVEL(REC)) {
+    FitBase::GetRW()->Print();
+  }
 
   // SORT SAMPLES
   ReconfigureSamples();
 
   // GET TEST STAT
   fLikelihood = GetLikelihood();
 
   // PRINT PROGRESS
   LOG(FIT) << "Current Stat (iter. " << this->fCurIter << ") = " << fLikelihood
            << std::endl;
 
   // UPDATE TREE
   if (fIterationTree) FillIterationTree(FitBase::GetRW());
 
   return fLikelihood;
 }
 
 //***************************************************
 int JointFCN::GetNDOF() {
   //***************************************************
 
   int totaldof = 0;
   int count = 0;
 
   // Total number of Free bins in each MC prediction
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
     int dof = exp->GetNDOF();
 
     // Save Seperate DOF
     if (fIterationTree) {
       fSampleNDOF[count] = dof;
     }
 
     // Add to total
     totaldof += dof;
     count++;
   }
 
   // Loop over pulls
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
     double dof = pull->GetLikelihood();
 
     // Save seperate DOF
     if (fIterationTree) {
       fSampleNDOF[count] = dof;
     }
 
     // Add to total
     totaldof += dof;
     count++;
   }
 
   // Set Data Variable
   fNDOF = totaldof;
 
   return totaldof;
 }
 
 //***************************************************
 double JointFCN::GetLikelihood() {
   //***************************************************
 
-  LOG(MIN) << std::left << std::setw(43) << "Getting likelihoods..." << " : " << "-2logL" << endl;
+  LOG(MIN) << std::left << std::setw(43) << "Getting likelihoods..." << " : " << "-2logL" << std::endl;
 
   // Loop and add up likelihoods in an uncorrelated way
   double like = 0.0;
   int count = 0;
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
     double newlike = exp->GetLikelihood();
 
     // Save seperate likelihoods
     if (fIterationTree) {
       fSampleLikes[count] = newlike;
     }
 
-    LOG(MIN) << "-> " << std::left << std::setw(40) << exp->GetName() << " : " << newlike << endl;
+    LOG(MIN) << "-> " << std::left << std::setw(40) << exp->GetName() << " : " << newlike << std::endl;
 
     // Add Weight Scaling
-    like *= FitBase::GetRW()->GetSampleLikelihoodWeight(exp->GetName());
+    // like *= FitBase::GetRW()->GetSampleLikelihoodWeight(exp->GetName());
 
     // Add to total
     like += newlike;
     count++;
   }
 
   // Loop over pulls
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
     double newlike = pull->GetLikelihood();
 
     // Save seperate likelihoods
     if (fIterationTree) {
       fSampleLikes[count] = newlike;
     }
 
     // Add to total
     like += newlike;
     count++;
   }
 
   // Set Data Variable
   fLikelihood = like;
 
   return like;
 };
 
-//***************************************************
-void JointFCN::LoadSamples(std::string cardinput)
-//***************************************************
-{
-  LOG(MIN) << "Initializing Samples" << std::endl;
+void JointFCN::LoadSamples(std::vector<nuiskey> samplekeys) {
 
-  // Read the card file here and load objects
-  std::string line;
-  std::ifstream card(cardinput.c_str(), ifstream::in);
+  LOG(MIN) << "Loading Samples : " << samplekeys.size() << std::endl;
+  for (size_t i = 0; i < samplekeys.size(); i++) {
+    nuiskey key = samplekeys[i];
 
-  // Make sure they are created in correct working DIR
-  fOutputDir->cd();
+    // Get Sample Options
+    std::string samplename = key.GetS("name");
+    std::string samplefile = key.GetS("input");
+    std::string sampletype = key.GetS("type");
+    std::string fakeData = "";
 
-  while (std::getline(card >> std::ws, line, '\n')) {
-    // Skip Empties
-    if (line.c_str()[0] == '#') continue;
-    if (line.empty()) continue;
-
-    // Parse line
-    std::vector<std::string> samplevect = GeneralUtils::ParseToStr(line, " ");
-
-    // Sample Inputs
-    if (!samplevect[0].compare("sample")) {
-      // Get all inputs
-      std::string name = samplevect[1];
-      std::string files = samplevect[2];
-      std::string type = "DEFAULT";
-      if (samplevect.size() > 3) type = samplevect[3];
-
-      // Create Sample Class
-      LOG(MIN) << "Loading up sample: " << name << " << " << files << " ("
-               << type << ")" << std::endl;
-      std::string fakeData = "";
-      fOutputDir->cd();
-      bool LoadedSample = SampleUtils::LoadSample(&fSamples, name, files, type,
-                                                  fakeData, FitBase::GetRW());
-
-      if (!LoadedSample) {
-        ERR(FTL) << "Could not load sample provided: " << name << std::endl;
-        ERR(FTL) << "Check spelling with that in src/FCN/SampleList.cxx"
-                 << endl;
-        throw;
-      }
-    }
+    LOG(MIN) << "Loading Sample : " << samplename << std::endl;
 
-    // Sample Inputs
-    if (!samplevect[0].compare("covar") || !samplevect[0].compare("pulls") ||
-        !samplevect[0].compare("throws")) {
-      // Get all inputs
-      std::string name = samplevect[1];
-      std::string files = samplevect[2];
-      std::string type = "DEFAULT";
-
-      if (samplevect.size() > 3) {
-        type = samplevect[3];
-      } else if (!samplevect[0].compare("pull")) {
-        type = "GAUSPULL";
-      } else if (!samplevect[0].compare("throws")) {
-        type = "GAUSTHROWS";
-      }
+    fOutputDir->cd();
+    MeasurementBase* NewLoadedSample
+      = SampleUtils::CreateSample(key);
 
-      // Create Pull Class
-      LOG(MIN) << "Loading up pull term: " << name << " << " << files << " ("
-               << type << ")" << std::endl;
-      std::string fakeData = "";
-      fOutputDir->cd();
-      fPulls.push_back(new ParamPull(name, files, type));
+    if (!NewLoadedSample) {
+      ERR(FTL) << "Could not load sample provided: " << samplename << std::endl;
+      ERR(FTL) << "Check spelling with that in src/FCN/SampleList.cxx"
+               << std::endl;
+      throw;
+    } else {
+      fSamples.push_back(NewLoadedSample);
     }
   }
-  card.close();
-};
+}
+
+void JointFCN::LoadPulls(std::vector<nuiskey> pullkeys) {
+
+  for (size_t i = 0; i < pullkeys.size(); i++) {
+    nuiskey key = pullkeys[i];
+
+    std::string pullname = key.GetS("name");
+    std::string pullfile = key.GetS("input");
+    std::string pulltype = key.GetS("type");
+
+    fOutputDir->cd();
+    fPulls.push_back(new ParamPull(pullname, pullfile, pulltype));
+
+  }
+
+  //     // Sample Inputs
+//     if (!samplevect[0].compare("covar") || !samplevect[0].compare("pulls") ||
+//         !samplevect[0].compare("throws")) {
+//       // Get all inputs
+//       std::string name = samplevect[1];
+//       std::string files = samplevect[2];
+//       std::string type = "DEFAULT";
+
+//       if (samplevect.size() > 3) {
+//         type = samplevect[3];
+//       } else if (!samplevect[0].compare("pull")) {
+//         type = "GAUSPULL";
+//       } else if (!samplevect[0].compare("throws")) {
+//         type = "GAUSTHROWS";
+//       }
+
+//       // Create Pull Class
+//       LOG(MIN) << "Loading up pull term: " << name << " << " << files << " ("
+//                << type << ")" << std::endl;
+//       std::string fakeData = "";
+//       fOutputDir->cd();
+//       fPulls.push_back(new ParamPull(name, files, type));
+//     }
+
+
+
+}
+
+
+// //***************************************************
+// void JointFCN::LoadSamples(std::string cardinput)
+// //***************************************************
+// {
+//   LOG(MIN) << "Initializing Samples" << std::endl;
+
+//   // Read the card file here and load objects
+//   std::string line;
+//   std::ifstream card(cardinput.c_str(), ifstream::in);
+
+//   // Make sure they are created in correct working DIR
+//   fOutputDir->cd();
+
+//   while (std::getline(card >> std::ws, line, '\n')) {
+//     // Skip Empties
+//     if (line.c_str()[0] == '#') continue;
+//     if (line.empty()) continue;
+
+//     // Parse line
+//     std::vector<std::string> samplevect = GeneralUtils::ParseToStr(line, " ");
+
+//     // Sample Inputs
+//     if (!samplevect[0].compare("sample")) {
+//       // Get all inputs
+//       std::string name = samplevect[1];
+//       std::string files = samplevect[2];
+//       std::string type = "DEFAULT";
+//       if (samplevect.size() > 3) type = samplevect[3];
+
+//       // Create Sample Class
+//       LOG(MIN) << "Loading up sample: " << name << " << " << files << " ("
+//                << type << ")" << std::endl;
+//       std::string fakeData = "";
+//       fOutputDir->cd();
+//       MeasurementBase* NewLoadedSample = SampleUtils::CreateSample(name, files, type,
+//                                          fakeData, FitBase::GetRW());
+
+//       if (!NewLoadedSample) {
+//         ERR(FTL) << "Could not load sample provided: " << name << std::endl;
+//         ERR(FTL) << "Check spelling with that in src/FCN/SampleList.cxx"
+//                  << std::endl;
+//         throw;
+//       } else {
+//         fSamples.push_back(NewLoadedSample);
+//       }
+//     }
+
+//     // Sample Inputs
+//     if (!samplevect[0].compare("covar") || !samplevect[0].compare("pulls") ||
+//         !samplevect[0].compare("throws")) {
+//       // Get all inputs
+//       std::string name = samplevect[1];
+//       std::string files = samplevect[2];
+//       std::string type = "DEFAULT";
+
+//       if (samplevect.size() > 3) {
+//         type = samplevect[3];
+//       } else if (!samplevect[0].compare("pull")) {
+//         type = "GAUSPULL";
+//       } else if (!samplevect[0].compare("throws")) {
+//         type = "GAUSTHROWS";
+//       }
+
+//       // Create Pull Class
+//       LOG(MIN) << "Loading up pull term: " << name << " << " << files << " ("
+//                << type << ")" << std::endl;
+//       std::string fakeData = "";
+//       fOutputDir->cd();
+//       fPulls.push_back(new ParamPull(name, files, type));
+//     }
+//   }
+//   card.close();
+// };
 
 //***************************************************
 void JointFCN::ReconfigureSamples(bool fullconfig) {
   //***************************************************
 
   int starttime = time(NULL);
-  LOG(REC) << "Starting Reconfigure iter. " << this->fCurIter << endl;
-
+  LOG(REC) << "Starting Reconfigure iter. " << this->fCurIter << std::endl;
+  // std::cout << fUsingEventManager << " " << fullconfig << " " << fMCFilled << std::endl;
   // Event Manager Reconf
   if (fUsingEventManager) {
     if (!fullconfig and fMCFilled)
       ReconfigureFastUsingManager();
     else
       ReconfigureUsingManager();
 
   } else {
     // Loop over all Measurement Classes
     for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
          iter++) {
       MeasurementBase* exp = *iter;
 
       // If RW Either do signal or full reconfigure.
       if (fDialChanged or !fMCFilled or fullconfig) {
         if (!fullconfig and fMCFilled)
           exp->ReconfigureFast();
         else
           exp->Reconfigure();
 
         // If RW Not needed just do normalisation
       } else {
         exp->Renormalise();
       }
     }
   }
 
   // Loop over pulls and update
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
     pull->Reconfigure();
   }
 
   fMCFilled = true;
   LOG(MIN) << "Finished Reconfigure iter. " << fCurIter << " in "
-           << time(NULL) - starttime << "s" << endl;
+           << time(NULL) - starttime << "s" << std::endl;
 
   fCurIter++;
 }
 
 //***************************************************
 void JointFCN::ReconfigureSignal() {
   //***************************************************
   this->ReconfigureSamples(false);
 }
 
 //***************************************************
 void JointFCN::ReconfigureAllEvents() {
   //***************************************************
   FitBase::GetRW()->Reconfigure();
   FitBase::EvtManager().ResetWeightFlags();
-  this->ReconfigureSamples(true);
+  ReconfigureSamples(true);
+}
+
+std::vector<InputHandlerBase*> JointFCN::GetInputList() {
+
+  std::vector<InputHandlerBase*> InputList;
+  fIsAllSplines = true;
+
+  MeasListConstIter iterSam = fSamples.begin();
+  for (; iterSam != fSamples.end(); iterSam++) {
+    MeasurementBase* exp = (*iterSam);
+
+    std::vector<MeasurementBase*> subsamples = exp->GetSubSamples();
+    for (size_t i = 0; i < subsamples.size(); i++) {
+
+      InputHandlerBase* inp = subsamples[i]->GetInput();
+      if (std::find(InputList.begin(), InputList.end(), inp) ==  InputList.end()) {
+
+        if (subsamples[i]->GetInput()->GetType() != kSPLINEPARAMETER) fIsAllSplines = false;
+
+        InputList.push_back(subsamples[i]->GetInput());
+
+      }
+    }
+  }
+
+
+
+  return InputList;
+}
+
+std::vector<MeasurementBase*> JointFCN::GetSubSampleList() {
+
+  std::vector<MeasurementBase*> SampleList;
+
+  MeasListConstIter iterSam = fSamples.begin();
+  for (; iterSam != fSamples.end(); iterSam++) {
+    MeasurementBase* exp = (*iterSam);
+
+    std::vector<MeasurementBase*> subsamples = exp->GetSubSamples();
+    for (size_t i = 0; i < subsamples.size(); i++) {
+      SampleList.push_back(subsamples[i]);
+    }
+  }
+
+  return SampleList;
 }
 
+
 //***************************************************
 void JointFCN::ReconfigureUsingManager() {
-  //***************************************************
-  LOG(MIN) << "Using manager." << endl;
-  FitBase::EvtManager().ResetWeightFlags();
+//***************************************************
+
+  // 'Slow' Event Manager Reconfigure
+  LOG(REC) << "Event Manager Reconfigure" << std::endl;
+  int timestart = time(NULL);
+
+  // Reset all samples
+  MeasListConstIter iterSam = fSamples.begin();
+  for (; iterSam != fSamples.end(); iterSam++) {
+    MeasurementBase* exp = (*iterSam);
+    exp->ResetAll();
+  }
 
-  // Get list of inputs
-  std::map<int, InputHandler*> fInputs = FitBase::EvtManager().GetInputs();
-  std::map<int, InputHandler*>::const_iterator iterInp;
-
-  // Check Matchup
-  for (iterInp = fInputs.begin(); iterInp != fInputs.end(); iterInp++) {
-    int input_id = (iterInp->first);
-    LOG(REC) << "Input " << input_id
-             << " (Type: " << iterInp->second->GetInputFileType()
-             << ", Location:" << iterInp->second->GetInputFileName()
-             << ") Valid for : " << endl;
-
-    for (MeasListConstIter iterSam = fSamples.begin();
-         iterSam != fSamples.end(); iterSam++) {
-      MeasurementBase* exp = (*iterSam);
-      int exp_id = exp->GetInputID();
-      if (exp_id != input_id) continue;
-
-      LOG(REC) << " ---> " << exp->GetName() << endl;
+  // If we are siving signal, reset all containers.
+  bool savesignal = (FitPar::Config().GetParB("SignalReconfigures"));
+
+  if (savesignal) {
+    // Reset all of our event signal vectors
+    fSignalEventBoxes.clear();
+    fSignalEventFlags.clear();
+    fSampleSignalFlags.clear();
+    fSignalEventSplines.clear();
+
+  }
+
+  // Make sure we have a list of inputs
+  if (fInputList.empty()) {
+    fInputList = GetInputList();
+    fSubSampleList = GetSubSampleList();
+  }
+
+
+  // If all inputs are splines make sure the readers are told
+  // they need to be reconfigured.
+  std::vector<InputHandlerBase*>::iterator inp_iter = fInputList.begin();
+
+  if (fIsAllSplines) {
+    for (; inp_iter != fInputList.end(); inp_iter++) {
+      InputHandlerBase* curinput = (*inp_iter);
+
+      // Tell reader in each BaseEvent it needs a Reconfigure next weight calc.
+      BaseFitEvt* curevent = curinput->FirstBaseEvent();
+      if (curevent->fSplineRead) {
+        curevent->fSplineRead->SetNeedsReconfigure(true);
+      }
     }
   }
 
-  // Start looping over inputs
-  for (iterInp = fInputs.begin(); iterInp != fInputs.end(); iterInp++) {
-    int input_id = (iterInp->first);
-    InputHandler* cur_input = (iterInp->second);
-
-    FitEvent* cevent = cur_input->GetEventPointer();
-    int fNEvents = cur_input->GetNEvents();
-    int countwidth = (fNEvents / 10);
-
-    // MAIN EVENT LOOP
-    for (int i = 0; i < fNEvents; i++) {
-      // Get Event from input list
-      cevent = FitBase::EvtManager().GetEvent(input_id, i);
-
-      // Get Weight
-      double Weight =
-          (FitBase::GetRW()->CalcWeight(cevent) * cevent->InputWeight);
-
-      // Skip if dodgy event
-      if (fabs(cevent->Mode) > 60 || cevent->Mode == 0) continue;
-
-      // Remove bad weights
-      if (Weight > 200.0 || Weight <= 0.0) Weight = 0.0;
-
-      // Loop over samples and fill histograms
-      int j = 0;
-      for (MeasListConstIter iterSam = fSamples.begin();
-           iterSam != fSamples.end(); iterSam++, j++) {
-        MeasurementBase* exp = (*iterSam);
-        int exp_id = exp->GetInputID();
-        if (exp_id != input_id) continue;
-
-        // Reset State of event by event vars
-        exp->SetXVar(-999.9);
-        exp->SetYVar(-999.9);
-        exp->SetZVar(-999.9);
-        exp->SetMode(-999);
-        exp->SetSignal(false);
-
-        // Fill exp
-        exp->SetMode(cevent->Mode);
-        exp->FillEventVariables(cevent);
-        exp->SetSignal(exp->isSignal(cevent));
-
-        exp->SetWeight(Weight);
-        exp->FillHistograms();
+  // MAIN INPUT LOOP ====================
+
+  int fillcount = 0;
+  int inputcount = 0;
+  inp_iter = fInputList.begin();
+
+  // Loop over each input in manager
+  for (; inp_iter != fInputList.end(); inp_iter++) {
+    InputHandlerBase* curinput = (*inp_iter);
+
+    // Get event information
+    FitEvent* curevent = curinput->FirstNuisanceEvent();
+    curinput->CreateCache();
+
+    int i = 0;
+    int nevents = curinput->GetNEvents();
+    int countwidth = nevents / 20;
+
+    // Start event loop iterating until we get a NULL pointer.
+    while (curevent) {
+
+      // Get Event Weight
+      curevent->RWWeight = FitBase::GetRW()->CalcWeight(curevent);
+      curevent->Weight = curevent->RWWeight * curevent->InputWeight;
+      double rwweight = curevent->Weight;
+      // std::cout << "RWWeight = " << curevent->RWWeight  << " " << curevent->InputWeight << std::endl;
+
+
+      // Logging
+      // std::cout << CHECKLOG(1) << std::endl;
+      if (LOGGING(REC)) {
+        if (i % countwidth == 0) {
+          QLOG(REC, curinput->GetName() << " : Processed " << i
+               << " events. [M, W] = ["
+               << curevent->Mode << ", "
+               << rwweight << "]");
+        }
+      }
+
+      // Setup flag for if signal found in at least one sample
+      bool foundsignal = false;
+
+      // Create a new signal bitset for this event
+      std::vector<bool> signalbitset(fSubSampleList.size());
+
+      // Create a new signal box vector for this event
+      std::vector<MeasurementVariableBox*> signalboxes;
+
+      // Start measurement iterator
+      size_t measitercount = 0;
+      std::vector<MeasurementBase*>::iterator meas_iter = fSubSampleList.begin();
+
+      // Loop over all subsamples (sub in JointMeas)
+      for (; meas_iter != fSubSampleList.end(); meas_iter++) {
+        MeasurementBase* curmeas = (*meas_iter);
+
+        // Compare input pointers, to current input, skip if not.
+        // Pointer tells us if it matches without doing ID checks.
+        if (curinput != curmeas->GetInput()) {
+
+          if (savesignal) {
+            // Set bit to 0 as definitely not signal
+            signalbitset[measitercount] = 0;
+          }
+
+          // Count up what measurement we are on.
+          measitercount++;
+
+          // Skip sample as input not signal.
+          continue;
+        }
+
+
+        // Fill events for matching inputs.
+        MeasurementVariableBox* box = curmeas->FillVariableBox(curevent);
+
+        bool signal = curmeas->isSignal(curevent);
+        curmeas->SetSignal(signal);
+        curmeas->FillHistograms(rwweight);
+
+        // If its Signal tally up fills
+        if (signal) {
+          fillcount++;
+        }
+
+        // If we are saving signal/splines fill the bitset
+        if (savesignal) {
+          signalbitset[measitercount] = signal;
+        }
+
+        // If signal save a clone of the event box for use later.
+        if (savesignal and signal) {
+          foundsignal = true;
+          signalboxes.push_back( box->CloneSignalBox() );
+        }
+
+        // Keep track of Measurement we are on.
+        measitercount++;
+      }
+
+
+      // Once we've filled the measurements, if saving signal
+      // push back if any sample flagged this event as signal
+      if (savesignal) {
+        fSignalEventFlags.push_back(foundsignal);
+      }
+
+      // Save the vector of signal boxes for this event
+      if (savesignal and foundsignal) {
+        fSignalEventBoxes.push_back(signalboxes);
+        fSampleSignalFlags.push_back(signalbitset);
       }
 
-      // Print Out
-      if (LOG_LEVEL(REC) and i % countwidth == 0)
-        LOG(REC) << "Reconfigured " << i << " total events. W=" << Weight
-                 << " for input " << input_id << std::endl;
+
+      // If all inputs are splines we can save the spline coefficients
+      // for fast in memory reconfigures later.
+      if (fIsAllSplines and savesignal and foundsignal) {
+
+        // Make temp vector to push back with
+        std::vector<float> coeff;
+        for (size_t l = 0; l < (UInt_t)curevent->fSplineRead->GetNPar(); l++) {
+          coeff.push_back( curevent->fSplineCoeff[l] );
+        }
+
+        // Push back to signal event splines. Kept in sync with fSignalEventBoxes size.
+        // int splinecount = fSignalEventSplines.size();
+        fSignalEventSplines.push_back(coeff);
+
+        // if (splinecount % 1000 == 0) {
+        // std::cout << "Pushed Back Coeff " << splinecount << " : ";
+        // for (size_t l = 0; l < fSignalEventSplines[splinecount].size(); l++) {
+        // std::cout << " " << fSignalEventSplines[splinecount][l];
+        // }
+        // std::cout << std::endl;
+        // }
+
+      }
+
+      // Clean up vectors once done with this event
+      signalboxes.clear();
+      signalbitset.clear();
+
+      // Iterate to the next event.
+      curevent = curinput->NextNuisanceEvent();
+      i++;
     }
+
+    curinput->RemoveCache();
+
+    // Keep track of what input we are on.
+    inputcount++;
   }
 
-  // Convert Binned events
-  MeasListConstIter iterSam = fSamples.begin();
+  // End of Event Loop ===============================
+
+
+  // Now event loop is finished loop over all Measurements
+  // Converting Binned events to XSec Distributions
+  iterSam = fSamples.begin();
   for (; iterSam != fSamples.end(); iterSam++) {
     MeasurementBase* exp = (*iterSam);
     exp->ConvertEventRates();
   }
 
+  // Print out statements on approximate memory usage for profiling.
+  LOG(REC) << "Filled " << fillcount << " signal events." << std::endl;
+  if (savesignal) {
+    int mem = ( //sizeof(fSignalEventBoxes) +
+                // fSignalEventBoxes.size() * sizeof(fSignalEventBoxes.at(0)) +
+                sizeof(MeasurementVariableBox1D) * fillcount) * 1E-6;
+    LOG(REC) << " -> Saved " << fillcount << " signal boxes for faster access. (~" << mem << " MB)" << std::endl;
+    if (fIsAllSplines and !fSignalEventSplines.empty()) {
+      int splmem = sizeof(float) * fSignalEventSplines.size() * fSignalEventSplines[0].size() * 1E-6;
+      LOG(REC) << " -> Saved " << fillcount << " " << fSignalEventSplines.size() << " spline sets into memory. (~" << splmem << " MB)" << std::endl;
+    }
+  }
+
+  LOG(REC) << "Time taken ReconfigureUsingManager() : " << time(NULL) - timestart << std::endl;
+
+  // End of reconfigure
   return;
-}
+};
+
 
 //***************************************************
 void JointFCN::ReconfigureFastUsingManager() {
-  //***************************************************
+//***************************************************
 
-  // Using normal event manager for now until this is developed further.
-  ReconfigureUsingManager();
-  return;
+  LOG(FIT) << " -> Doing FAST using manager" << std::endl;
+  // Get Start time for profilling
+  int timestart = time(NULL);
 
-  return;
+  // Reset all samples
+  MeasListConstIter iterSam = fSamples.begin();
+  for (; iterSam != fSamples.end(); iterSam++) {
+    MeasurementBase* exp = (*iterSam);
+    exp->ResetAll();
+  }
+
+  // Check for saved variables if not do a full reconfigure.
+  if (fSignalEventFlags.empty()) {
+    ERR(WRN) << "Signal Flags Empty! Using normal manager." << std::endl;
+    ReconfigureUsingManager();
+    return;
+  }
+
+  bool fFillNuisanceEvent = FitPar::Config().GetParB("FullEventOnSignalReconfigure");
+
+  // Setup fast vector iterators.
+  std::vector<bool>::iterator inpsig_iter = fSignalEventFlags.begin();
+  std::vector< std::vector<MeasurementVariableBox*> >::iterator box_iter = fSignalEventBoxes.begin();
+  std::vector< std::vector<float> >::iterator spline_iter = fSignalEventSplines.begin();
+  std::vector< std::vector<bool> >::iterator samsig_iter = fSampleSignalFlags.begin();
+  int splinecount = 0;
+
+  // Setup stuff for logging
+  int fillcount = 0;
+  int nevents = fSignalEventFlags.size();
+  int countwidth = nevents / 500;
+
+  // If All Splines tell splines they need a reconfigure.
+  std::vector<InputHandlerBase*>::iterator inp_iter = fInputList.begin();
+  if (fIsAllSplines) {
+    LOG(REC) << "All Spline Inputs so using fast spline loop." << std::endl;
+    for (; inp_iter != fInputList.end(); inp_iter++) {
+      InputHandlerBase* curinput = (*inp_iter);
+
+      // Tell each fSplineRead in BaseFitEvent to reconf next weight calc
+      BaseFitEvt* curevent = curinput->FirstBaseEvent();
+      if (curevent->fSplineRead) curevent->fSplineRead->SetNeedsReconfigure(true);
+    }
+  }
+
+
+  // Loop over all possible spline inputs
+  double* coreeventweights = new double[fSignalEventBoxes.size()];
+  splinecount = 0;
+
+  inp_iter = fInputList.begin();
+  inpsig_iter = fSignalEventFlags.begin();
+  spline_iter = fSignalEventSplines.begin();
+
+
+  // Loop over all signal flags
+  // For each valid signal flag add one to splinecount
+  // Get Splines from that count and add to weight
+  // Add splinecount
+  int sigcount = 0;
+  splinecount = 0;
+
+  // #pragma omp parallel for shared(splinecount,sigcount)
+  for (uint iinput = 0; iinput < fInputList.size(); iinput++) {
+
+    InputHandlerBase* curinput = fInputList[iinput];
+    BaseFitEvt* curevent = curinput->FirstBaseEvent();
+
+    for (int i = 0; i < curinput->GetNEvents(); i++) {
+
+      double rwweight = 0.0;
+      if (fSignalEventFlags[sigcount]) {
+
+        // Get Event Info
+        if (!fIsAllSplines) {
+          if (fFillNuisanceEvent) curinput->GetNuisanceEvent(i);
+          else curevent = curinput->GetBaseEvent(i);
+        } else {
+          curevent->fSplineCoeff = &fSignalEventSplines[splinecount][0];
+        }
+
+        curevent->RWWeight = FitBase::GetRW()->CalcWeight(curevent);
+        curevent->Weight = curevent->RWWeight * curevent->InputWeight;
+        rwweight = curevent->Weight;
+
+        // #pragma omp atomic
+        if (fIsAllSplines) {
+          coreeventweights[splinecount] = rwweight;
+        }
+        if (splinecount % countwidth == 0) {
+          LOG(REC) << "Processed " << splinecount << " event weights." << std::endl;
+        }
+
+
+        // #pragma omp atomic
+        splinecount++;
+      }
+
+      // #pragma omp atomic
+      sigcount++;
+
+    }
+  }
+  LOG(SAM) << "Processed event weights." << std::endl;
+
+
+  // #pragma omp barrier
+
+  // Reset Iterators
+  inpsig_iter = fSignalEventFlags.begin();
+  spline_iter = fSignalEventSplines.begin();
+  box_iter = fSignalEventBoxes.begin();
+  samsig_iter = fSampleSignalFlags.begin();
+  int nsplineweights = splinecount;
+  splinecount = 0;
+
+
+  // Start of Fast Event Loop ============================
+
+  // Start input iterators
+  // Loop over number of inputs
+  for (int ispline = 0; ispline < nsplineweights; ispline++) {
+    double rwweight = coreeventweights[ispline];
+
+    // Get iterators for this event
+    std::vector<bool>::iterator subsamsig_iter = (*samsig_iter).begin();
+    std::vector<MeasurementVariableBox*>::iterator subbox_iter = (*box_iter).begin();
+
+    // Loop over all sub measurements.
+    std::vector<MeasurementBase*>::iterator meas_iter = fSubSampleList.begin();
+    for (; meas_iter != fSubSampleList.end(); meas_iter++, subsamsig_iter++) {
+      MeasurementBase* curmeas = (*meas_iter);
+
+      // If event flagged as signal for this sample fill from the box.
+      if (*subsamsig_iter) {
+        curmeas->SetSignal(true);
+        curmeas->FillHistogramsFromBox((*subbox_iter), rwweight);
+
+        // Move onto next box if there is one.
+        subbox_iter++;
+        fillcount++;
+      }
+    }
+
+    if (ispline % countwidth == 0) {
+      LOG(REC) << "Filled " << ispline << " sample weights." << std::endl;
+    }
+
+    // Iterate over the main signal event containers.
+    samsig_iter++;
+    box_iter++;
+    spline_iter++;
+    splinecount++;
+
+  }
+  // End of Fast Event Loop ===================
+
+  LOG(SAM) << "Filled sample distributions." << std::endl;
+
+  // Now loop over all Measurements
+  // Convert Binned events
+  iterSam = fSamples.begin();
+  for (; iterSam != fSamples.end(); iterSam++) {
+    MeasurementBase* exp = (*iterSam);
+    exp->ConvertEventRates();
+  }
+
+  // Cleanup coreeventweights
+  if (fIsAllSplines) {
+    delete coreeventweights;
+  }
+
+  // Print some reconfigure profiling.
+  LOG(REC) << "Filled " << fillcount << " signal events." << std::endl;
+  LOG(REC) << "Time taken ReconfigureFastUsingManager() : " << time(NULL) - timestart << std::endl;
 }
 
 //***************************************************
 void JointFCN::Write() {
   //***************************************************
 
   // Loop over individual experiments and call Write
-  LOG(MIN) << "Writing each of the data classes..." << endl;
+  LOG(MIN) << "Writing each of the data classes..." << std::endl;
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
     exp->Write();
   }
 
   // Save Pull Terms
   for (PullListConstIter iter = fPulls.begin(); iter != fPulls.end(); iter++) {
     ParamPull* pull = *iter;
     pull->Write();
   }
 
   if (FitPar::Config().GetParB("EventManager")) {
     // Get list of inputs
-    std::map<int, InputHandler*> fInputs = FitBase::EvtManager().GetInputs();
-    std::map<int, InputHandler*>::const_iterator iterInp;
+    std::map<int, InputHandlerBase*> fInputs = FitBase::EvtManager().GetInputs();
+    std::map<int, InputHandlerBase*>::const_iterator iterInp;
 
     for (iterInp = fInputs.begin(); iterInp != fInputs.end(); iterInp++) {
-      InputHandler* input = (iterInp->second);
+      InputHandlerBase* input = (iterInp->second);
 
       input->GetFluxHistogram()->Write();
       input->GetXSecHistogram()->Write();
       input->GetEventHistogram()->Write();
     }
   }
 };
 
 //***************************************************
 void JointFCN::SetFakeData(std::string fakeinput) {
   //***************************************************
 
-  LOG(MIN) << "Setting fake data from " << fakeinput << endl;
+  LOG(MIN) << "Setting fake data from " << fakeinput << std::endl;
   for (MeasListConstIter iter = fSamples.begin(); iter != fSamples.end();
        iter++) {
     MeasurementBase* exp = *iter;
     exp->SetFakeDataValues(fakeinput);
   }
 
   return;
 }
diff --git a/src/FCN/JointFCN.h b/src/FCN/JointFCN.h
index ef5b306..031fae4 100755
--- a/src/FCN/JointFCN.h
+++ b/src/FCN/JointFCN.h
@@ -1,143 +1,162 @@
 #ifndef _JOINT_FCN_H_
 #define _JOINT_FCN_H_
 /*!                                                                                                                                                                                                   
  *  \addtogroup FCN                                                                                                                                                                                 
  *  @{                                                                                                                                                                                                
  */
 
 #include <iostream>
 #include <vector>
 #include <fstream>
 #include <list>
 
 // ROOT headers
 #include "TTree.h"
 #include "TH1D.h"
 #include "TH2D.h"
 #include <TMatrixDSym.h>
 #include "TGraphErrors.h"
 #include <TVectorD.h>
 #include <TMath.h>
 
 #include "FitUtils.h"
 
 // External fitter headers
 #include "MeasurementBase.h"
 #include "SampleList.h"
 
 #define GetCurrentDir getcwd
 #include "EventManager.h"
 #include "Math/Functor.h"
 #include "ParamPull.h"
 
+#include "NuisConfig.h"
+#include "NuisKey.h"
+#include "MeasurementVariableBox.h"
+#include "MeasurementVariableBox1D.h"
+
 using namespace FitUtils;
 using namespace FitBase;
 //! Main FCN Class which ROOT's joint function needs to evaulate the chi2 at each stage of the fit.
 class JointFCN 
 {
  public:
 
   //! Constructor
   //! cardfile = Path to input card file listing samples
-  JointFCN(std::string cardfile, TFile *outfile);
-
+  JointFCN(std::vector<nuiskey> samplekeys, TFile* outfile=NULL);
+  JointFCN(TFile* outfile=NULL); // Loads from global config
   //! Destructor
   ~JointFCN();
 
   //! Create sample list from cardfile
-  void LoadSamples(std::string cardFile);
-
+  void LoadSamples(std::vector<nuiskey> samplekeys);
+  void LoadPulls(std::vector<nuiskey> pullkeys);
+  
   //! Main Likelihood evaluation FCN
   double DoEval(const double *x);
 
   //! Func Wrapper for ROOT
   inline double operator() (const std::vector<double> & x) {
     double* x_array = new double[x.size()];
     return this->DoEval(x_array);
   };
 
   //! Func Wrapper for ROOT
   inline double operator() (const double *x) {
     return this->DoEval(x);
   };
   
   //! Create a TTree to save all dial value iterations for this FCN
   void CreateIterationTree(std::string name, FitWeight* rw);
 
   //! Fills dial values and sample likelihoods into tree
   void FillIterationTree(FitWeight* rw);
 
   //! Writes TTree to fOutput directory
   void WriteIterationTree();
 
   //! Deletes TTree
   void DestroyIterationTree();
 
   //! Get Degrees of Freedom for samples (NBins)
   int GetNDOF();
 
   //! Return NDOF wrapper
   inline unsigned int NDim() {return this->GetNDOF();};
   
   //! Reconfigure samples where we force all events to be looped over.
   void ReconfigureAllEvents() ;
 
   //! Call Reconfigure on samples.
   //! Choice of reconfigure type depends on whether dials have changed
   //! and the MC has been filled.
   void ReconfigureSamples(bool fullconfig = false);
 
   //! Call reconfigure on only signal events (defaults to all events if CurIter=0)
   void ReconfigureSignal();
 
   //! Gets likelihood for all samples in FCN (assuming uncorrelated)
   double GetLikelihood();
 
   //! Returns list of pointers to the samples
   inline std::list<MeasurementBase*> GetSampleList(){ return fSamples; }
 
   //! Return list of pointers to all the pulls
   inline std::list<ParamPull*> GetPullList(){ return fPulls; };
   
   //! Write all samples to output DIR
   void Write();
 
   //! Set Fake data from file/MC
   void SetFakeData(std::string fakeinput);
 
   //! Reconfigure looping over duplicate inputs
   void ReconfigureUsingManager();
 
   //! Reconfigure Fast looping over duplicate inputs
   void ReconfigureFastUsingManager();
   
+
+std::vector<MeasurementBase*> GetSubSampleList(); 
+std::vector<InputHandlerBase*> GetInputList();
+
  private: 
 
   //! Append the experiments to include in the fit to this list
   std::list<MeasurementBase*> fSamples;
 
   //! Append parameter pull terms to include penalties in the fit to this list
   std::list<ParamPull*> fPulls;
   
   TDirectory *fOutputDir; //!< Directory to save contents
 
   std::string fCardFile; //!< Input Card text file
 
   bool fDialChanged;  //!< Flag for if RW dials changed
   UInt_t  fCurIter;   //!< Counter for how many times reconfigure called
   bool    fMCFilled;  //!< Check MC has at least been filled once
 
   TTree*  fIterationTree;  //!< Tree to save RW values on each function call
   int     fNDials;         //!< Number of RW Dials in FitWeight
   double* fDialVals;       //!< Current Values of RW Dials
   double  fLikelihood;     //!< Current likelihood for joint sample likelihood
   double  fNDOF;           //!< Total NDOF
   double* fSampleLikes;    //!< Likelihoods for each individual measurement in list
   int *   fSampleNDOF;     //!< NDOF for each individual measurement in list
 
   bool fUsingEventManager; //!< Flag for doing joint comparisons
   
+  std::vector< std::vector<float> > fSignalEventSplines;
+  std::vector< std::vector<MeasurementVariableBox*> > fSignalEventBoxes;
+  std::vector< bool > fSignalEventFlags;
+  std::vector< std::vector<bool> > fSampleSignalFlags;
+
+  std::vector<InputHandlerBase*> fInputList;
+  std::vector<MeasurementBase*> fSubSampleList;
+  bool fIsAllSplines;
+  
 };
 
 /*! @} */
 #endif // _JOINT_FCN_H_
diff --git a/src/FCN/SampleList.cxx b/src/FCN/SampleList.cxx
index 8df25ff..59a1314 100644
--- a/src/FCN/SampleList.cxx
+++ b/src/FCN/SampleList.cxx
@@ -1,616 +1,660 @@
 #include "SampleList.h"
 
 //! Functions to make it easier for samples to be created and handled.
 namespace SampleUtils {
 
 //! Create a given sample given its name, file, type, fakdata(fkdt) file and the
 //! current rw engine and push it back into the list fChain.
-bool LoadSample(std::list<MeasurementBase*>* fChain, std::string name,
-                std::string file, std::string type, std::string fkdt,
-                FitWeight* rw) {
+MeasurementBase* CreateSample(std::string name, std::string file,
+                              std::string type, std::string fkdt, FitWeight* rw) {
+
+  nuiskey samplekey = Config::CreateKey("sample");
+  samplekey.AddS("name", name);
+  samplekey.AddS("input", file);
+  samplekey.AddS("type", type);
+
+  return CreateSample(samplekey);
+}
+
+MeasurementBase* CreateSample(nuiskey samplekey) {
+
+  FitWeight* rw = FitBase::GetRW();
+  std::string name = samplekey.GetS("name");
+  std::string file = samplekey.GetS("input");
+  std::string type = samplekey.GetS("type");
+  std::string fkdt = "";
+
   /*
      ANL CCQE Samples
   */
 
   if (!name.compare("ANL_CCQE_XSec_1DEnu_nu") ||
+      !name.compare("ANL_CCQE_XSec_1DEnu_nu_PRD26") ||
       !name.compare("ANL_CCQE_XSec_1DEnu_nu_PRL31") ||
       !name.compare("ANL_CCQE_XSec_1DEnu_nu_PRD16")) {
-    fChain->push_back(new ANL_CCQE_XSec_1DEnu_nu(name, file, rw, type, fkdt));
+    return (new ANL_CCQE_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_CCQE_Evt_1DQ2_nu") ||
              !name.compare("ANL_CCQE_Evt_1DQ2_nu_PRL31") ||
+             !name.compare("ANL_CCQE_Evt_1DQ2_nu_PRD26") ||
              !name.compare("ANL_CCQE_Evt_1DQ2_nu_PRD16")) {
-    fChain->push_back(new ANL_CCQE_Evt_1DQ2_nu(name, file, rw, type, fkdt));
+    return (new ANL_CCQE_Evt_1DQ2_nu(samplekey));
     /*
       ANL CC1ppip samples
     */
-  } else if (!name.compare("ANL_CC1ppip_XSec_1DEnu_nu")) {
-    fChain->push_back(new ANL_CC1ppip_XSec_1DEnu_nu(file, rw, type, fkdt));
+  } else if (!name.compare("ANL_CC1ppip_XSec_1DEnu_nu") ||
+             !name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W14Cut") ||
+             !name.compare("ANL_CC1ppip_XSec_1DEnu_nu_Uncorr") ||
+             !name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr") ||
+             !name.compare("ANL_CC1ppip_XSec_1DEnu_nu_W16Cut_Uncorr")) {
+    return (new ANL_CC1ppip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_XSec_1DQ2_nu")) {
-    fChain->push_back(new ANL_CC1ppip_XSec_1DQ2_nu(file, rw, type, fkdt));
-  } else if (!name.compare("ANL_CC1ppip_Evt_1DQ2_nu")) {
-    fChain->push_back(new ANL_CC1ppip_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_XSec_1DQ2_nu(samplekey));
+  } else if (!name.compare("ANL_CC1ppip_Evt_1DQ2_nu") ||
+             !name.compare("ANL_CC1ppip_Evt_1DQ2_nu_W14Cut")) {
+    return (new ANL_CC1ppip_Evt_1DQ2_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_Evt_1Dppi_nu")) {
-    fChain->push_back(new ANL_CC1ppip_Evt_1Dppi_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_Evt_1Dppi_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_Evt_1Dthpr_nu")) {
-    fChain->push_back(new ANL_CC1ppip_Evt_1Dthpr_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_Evt_1Dthpr_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_Evt_1DcosmuStar_nu")) {
-    fChain->push_back(new ANL_CC1ppip_Evt_1DcosmuStar_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_Evt_1DcosmuStar_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_Evt_1DcosthAdler_nu")) {
-    fChain->push_back(
-        new ANL_CC1ppip_Evt_1DcosthAdler_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_Evt_1DcosthAdler_nu(samplekey));
   } else if (!name.compare("ANL_CC1ppip_Evt_1Dphi_nu")) {
-    fChain->push_back(new ANL_CC1ppip_Evt_1Dphi_nu(file, rw, type, fkdt));
+    return (new ANL_CC1ppip_Evt_1Dphi_nu(samplekey));
     /*
       ANL CC1npip sample
     */
-  } else if (!name.compare("ANL_CC1npip_XSec_1DEnu_nu")) {
-    fChain->push_back(new ANL_CC1npip_XSec_1DEnu_nu(file, rw, type, fkdt));
-  } else if (!name.compare("ANL_CC1npip_Evt_1DQ2_nu")) {
-    fChain->push_back(new ANL_CC1npip_Evt_1DQ2_nu(file, rw, type, fkdt));
+  } else if (!name.compare("ANL_CC1npip_XSec_1DEnu_nu") ||
+             !name.compare("ANL_CC1npip_XSec_1DEnu_nu_W14Cut") ||
+             !name.compare("ANL_CC1npip_XSec_1DEnu_nu_Uncorr") ||
+             !name.compare("ANL_CC1npip_XSec_1DEnu_nu_W14Cut_Uncorr") ||
+             !name.compare("ANL_CC1npip_XSec_1DEnu_nu_W16Cut_Uncorr")) {
+    return (new ANL_CC1npip_XSec_1DEnu_nu(samplekey));
+  } else if (!name.compare("ANL_CC1npip_Evt_1DQ2_nu") ||
+             !name.compare("ANL_CC1npip_Evt_1DQ2_nu_W14Cut")) {
+    return (new ANL_CC1npip_Evt_1DQ2_nu(samplekey));
   } else if (!name.compare("ANL_CC1npip_Evt_1Dppi_nu")) {
-    fChain->push_back(new ANL_CC1npip_Evt_1Dppi_nu(file, rw, type, fkdt));
+    return (new ANL_CC1npip_Evt_1Dppi_nu(samplekey));
   } else if (!name.compare("ANL_CC1npip_Evt_1DcosmuStar_nu")) {
-    fChain->push_back(new ANL_CC1npip_Evt_1DcosmuStar_nu(file, rw, type, fkdt));
+    return (new ANL_CC1npip_Evt_1DcosmuStar_nu(samplekey));
     /*
       ANL CC1pi0 sample
     */
-  } else if (!name.compare("ANL_CC1pi0_XSec_1DEnu_nu")) {
-    fChain->push_back(new ANL_CC1pi0_XSec_1DEnu_nu(file, rw, type, fkdt));
-  } else if (!name.compare("ANL_CC1pi0_Evt_1DQ2_nu")) {
-    fChain->push_back(new ANL_CC1pi0_Evt_1DQ2_nu(file, rw, type, fkdt));
+  } else if (!name.compare("ANL_CC1pi0_XSec_1DEnu_nu") ||
+             !name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W14Cut") ||
+             !name.compare("ANL_CC1pi0_XSec_1DEnu_nu_Uncorr") ||
+             !name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W14Cut_Uncorr") ||
+             !name.compare("ANL_CC1pi0_XSec_1DEnu_nu_W16Cut_Uncorr")) {
+    return (new ANL_CC1pi0_XSec_1DEnu_nu(samplekey));
+  } else if (!name.compare("ANL_CC1pi0_Evt_1DQ2_nu") ||
+             !name.compare("ANL_CC1pi0_Evt_1DQ2_nu_W14Cut")) {
+    return (new ANL_CC1pi0_Evt_1DQ2_nu(samplekey));
   } else if (!name.compare("ANL_CC1pi0_Evt_1DcosmuStar_nu")) {
-    fChain->push_back(new ANL_CC1pi0_Evt_1DcosmuStar_nu(file, rw, type, fkdt));
+    return (new ANL_CC1pi0_Evt_1DcosmuStar_nu(samplekey));
     /*
       ANL NC1npip sample
     */
   } else if (!name.compare("ANL_NC1npip_Evt_1Dppi_nu")) {
-    fChain->push_back(new ANL_NC1npip_Evt_1Dppi_nu(file, rw, type, fkdt));
+    return (new ANL_NC1npip_Evt_1Dppi_nu(samplekey));
     /*
       ANL NC1ppim sample
     */
   } else if (!name.compare("ANL_NC1ppim_XSec_1DEnu_nu")) {
-    fChain->push_back(new ANL_NC1ppim_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new ANL_NC1ppim_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_NC1ppim_Evt_1DcosmuStar_nu")) {
-    fChain->push_back(new ANL_NC1ppim_Evt_1DcosmuStar_nu(file, rw, type, fkdt));
+    return (new ANL_NC1ppim_Evt_1DcosmuStar_nu(samplekey));
     /*
       ANL CC2pi sample
     */
   } else if (!name.compare("ANL_CC2pi_1pim1pip_XSec_1DEnu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pim1pip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dppip_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pim1pip_Evt_1Dppip_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dppim_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pim1pip_Evt_1Dppim_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(samplekey));
 
   } else if (!name.compare("ANL_CC2pi_1pip1pip_XSec_1DEnu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu(samplekey));
 
   } else if (!name.compare("ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu(samplekey));
   } else if (!name.compare("ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu")) {
-    fChain->push_back(new   ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(file, rw, type, fkdt));
+    return (new   ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu(samplekey));
 
+    /*
+      ArgoNeut Samples
+    */
   } else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dpmu_antinu")) {
-    fChain->push_back(
-        new ArgoNeuT_CCInc_XSec_1Dpmu_antinu(file, rw, type, fkdt));
+    return (new ArgoNeuT_CCInc_XSec_1Dpmu_antinu(samplekey));
   } else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dpmu_nu")) {
-    fChain->push_back(new ArgoNeuT_CCInc_XSec_1Dpmu_nu(file, rw, type, fkdt));
+    return (new ArgoNeuT_CCInc_XSec_1Dpmu_nu(samplekey));
   } else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dthetamu_antinu")) {
-    fChain->push_back(
-        new ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(file, rw, type, fkdt));
+    return (new ArgoNeuT_CCInc_XSec_1Dthetamu_antinu(samplekey));
   } else if (!name.compare("ArgoNeuT_CCInc_XSec_1Dthetamu_nu")) {
-    fChain->push_back(
-        new ArgoNeuT_CCInc_XSec_1Dthetamu_nu(file, rw, type, fkdt));
+    return (new ArgoNeuT_CCInc_XSec_1Dthetamu_nu(samplekey));
+
     /*
       BNL Samples
     */
   } else if (!name.compare("BNL_CCQE_XSec_1DEnu_nu")) {
-    fChain->push_back(new BNL_CCQE_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new BNL_CCQE_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BNL_CCQE_Evt_1DQ2_nu")) {
-    fChain->push_back(new BNL_CCQE_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new BNL_CCQE_Evt_1DQ2_nu(samplekey));
+
     /*
       BNL CC1ppip samples
     */
-  } else if (!name.compare("BNL_CC1ppip_XSec_1DEnu_nu")) {
-    fChain->push_back(new BNL_CC1ppip_XSec_1DEnu_nu(file, rw, type, fkdt));
-  } else if (!name.compare("BNL_CC1ppip_Evt_1DQ2_nu")) {
-    fChain->push_back(new BNL_CC1ppip_Evt_1DQ2_nu(file, rw, type, fkdt));
+  } else if (!name.compare("BNL_CC1ppip_XSec_1DEnu_nu") ||
+             !name.compare("BNL_CC1ppip_XSec_1DEnu_nu_Uncorr") ||
+             !name.compare("BNL_CC1ppip_XSec_1DEnu_nu_W14Cut") || 
+             !name.compare("BNL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr")) {
+    return (new BNL_CC1ppip_XSec_1DEnu_nu(samplekey));
+  } else if (!name.compare("BNL_CC1ppip_Evt_1DQ2_nu") ||
+             !name.compare("BNL_CC1ppip_Evt_1DQ2_nu_W14Cut")) {
+    return (new BNL_CC1ppip_Evt_1DQ2_nu(samplekey));
   } else if (!name.compare("BNL_CC1ppip_Evt_1DcosthAdler_nu")) {
-    fChain->push_back(
-        new BNL_CC1ppip_Evt_1DcosthAdler_nu(file, rw, type, fkdt));
+    return (new BNL_CC1ppip_Evt_1DcosthAdler_nu(samplekey));
   } else if (!name.compare("BNL_CC1ppip_Evt_1Dphi_nu")) {
-    fChain->push_back(new BNL_CC1ppip_Evt_1Dphi_nu(file, rw, type, fkdt));
+    return (new BNL_CC1ppip_Evt_1Dphi_nu(samplekey));
 
     /*
       BNL CC1npip samples
     */
-  } else if (!name.compare("BNL_CC1npip_XSec_1DEnu_nu")) {
-    fChain->push_back(new BNL_CC1npip_XSec_1DEnu_nu(file, rw, type, fkdt));
+  } else if (!name.compare("BNL_CC1npip_XSec_1DEnu_nu") ||
+             !name.compare("BNL_CC1npip_XSec_1DEnu_nu_Uncorr")) {
+    return (new BNL_CC1npip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BNL_CC1npip_Evt_1DQ2_nu")) {
-    fChain->push_back(new BNL_CC1npip_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new BNL_CC1npip_Evt_1DQ2_nu(samplekey));
     /*
       BNL CC1pi0 samples
     */
   } else if (!name.compare("BNL_CC1pi0_XSec_1DEnu_nu")) {
-    fChain->push_back(new BNL_CC1pi0_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new BNL_CC1pi0_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BNL_CC1pi0_Evt_1DQ2_nu")) {
-    fChain->push_back(new BNL_CC1pi0_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new BNL_CC1pi0_Evt_1DQ2_nu(samplekey));
 
     /*
       FNAL Samples
     */
   } else if (!name.compare("FNAL_CCQE_Evt_1DQ2_nu")) {
-    fChain->push_back(new FNAL_CCQE_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new FNAL_CCQE_Evt_1DQ2_nu(samplekey));
     /*
       FNAL CC1ppip
     */
   } else if (!name.compare("FNAL_CC1ppip_XSec_1DEnu_nu")) {
-    fChain->push_back(new FNAL_CC1ppip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new FNAL_CC1ppip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("FNAL_CC1ppip_XSec_1DQ2_nu")) {
-    fChain->push_back(new FNAL_CC1ppip_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new FNAL_CC1ppip_XSec_1DQ2_nu(samplekey));
   } else if (!name.compare("FNAL_CC1ppip_Evt_1DQ2_nu")) {
-    fChain->push_back(new FNAL_CC1ppip_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new FNAL_CC1ppip_Evt_1DQ2_nu(samplekey));
     /*
       FNAL CC1ppim
     */
-    //    } else if (!name.compare("FNAL_CC1ppim_XSec_1DEnu_antinu")) {
-    //      fChain->push_back(new FNAL_CC1ppim_XSec_1DEnu_antinu(file, rw, type,
-    //      fkdt));
+  } else if (!name.compare("FNAL_CC1ppim_XSec_1DEnu_antinu")) {
+    return (new FNAL_CC1ppim_XSec_1DEnu_antinu(samplekey));
 
     /*
       BEBC Samples
     */
   } else if (!name.compare("BEBC_CCQE_XSec_1DQ2_nu")) {
-    fChain->push_back(new BEBC_CCQE_XSec_1DQ2_nu(name, file, rw, type, fkdt));
+    return (new BEBC_CCQE_XSec_1DQ2_nu(samplekey));
     /*
       BEBC CC1ppip samples
     */
   } else if (!name.compare("BEBC_CC1ppip_XSec_1DEnu_nu")) {
-    fChain->push_back(new BEBC_CC1ppip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1ppip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BEBC_CC1ppip_XSec_1DQ2_nu")) {
-    fChain->push_back(new BEBC_CC1ppip_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1ppip_XSec_1DQ2_nu(samplekey));
     /*
       BEBC CC1npip samples
     */
   } else if (!name.compare("BEBC_CC1npip_XSec_1DEnu_nu")) {
-    fChain->push_back(new BEBC_CC1npip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1npip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BEBC_CC1npip_XSec_1DQ2_nu")) {
-    fChain->push_back(new BEBC_CC1npip_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1npip_XSec_1DQ2_nu(samplekey));
     /*
       BEBC CC1pi0 samples
     */
   } else if (!name.compare("BEBC_CC1pi0_XSec_1DEnu_nu")) {
-    fChain->push_back(new BEBC_CC1pi0_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1pi0_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("BEBC_CC1pi0_XSec_1DQ2_nu")) {
-    fChain->push_back(new BEBC_CC1pi0_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new BEBC_CC1pi0_XSec_1DQ2_nu(samplekey));
     /*
       BEBC CC1npim samples
     */
   } else if (!name.compare("BEBC_CC1npim_XSec_1DEnu_antinu")) {
-    fChain->push_back(new BEBC_CC1npim_XSec_1DEnu_antinu(file, rw, type, fkdt));
+    return (new BEBC_CC1npim_XSec_1DEnu_antinu(samplekey));
   } else if (!name.compare("BEBC_CC1npim_XSec_1DQ2_antinu")) {
-    fChain->push_back(new BEBC_CC1npim_XSec_1DQ2_antinu(file, rw, type, fkdt));
+    return (new BEBC_CC1npim_XSec_1DQ2_antinu(samplekey));
     /*
       BEBC CC1ppim samples
     */
   } else if (!name.compare("BEBC_CC1ppim_XSec_1DEnu_antinu")) {
-    fChain->push_back(new BEBC_CC1ppim_XSec_1DEnu_antinu(file, rw, type, fkdt));
+    return (new BEBC_CC1ppim_XSec_1DEnu_antinu(samplekey));
   } else if (!name.compare("BEBC_CC1ppim_XSec_1DQ2_antinu")) {
-    fChain->push_back(new BEBC_CC1ppim_XSec_1DQ2_antinu(file, rw, type, fkdt));
+    return (new BEBC_CC1ppim_XSec_1DQ2_antinu(samplekey));
 
     /*
       GGM CC1ppip samples
     */
   } else if (!name.compare("GGM_CC1ppip_XSec_1DEnu_nu")) {
-    fChain->push_back(new GGM_CC1ppip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new GGM_CC1ppip_XSec_1DEnu_nu(samplekey));
   } else if (!name.compare("GGM_CC1ppip_Evt_1DQ2_nu")) {
-    fChain->push_back(new GGM_CC1ppip_Evt_1DQ2_nu(file, rw, type, fkdt));
+    return (new GGM_CC1ppip_Evt_1DQ2_nu(samplekey));
 
     /*
       MiniBooNE Samples
     */
     /*
       CCQE
     */
   } else if (!name.compare("MiniBooNE_CCQE_XSec_1DQ2_nu") ||
              !name.compare("MiniBooNE_CCQELike_XSec_1DQ2_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CCQE_XSec_1DQ2_nu(name, file, rw, type, fkdt));
+    return (new MiniBooNE_CCQE_XSec_1DQ2_nu(samplekey));
   } else if (!name.compare("MiniBooNE_CCQE_XSec_1DQ2_antinu") ||
              !name.compare("MiniBooNE_CCQELike_XSec_1DQ2_antinu") ||
              !name.compare("MiniBooNE_CCQE_CTarg_XSec_1DQ2_antinu")) {
-    fChain->push_back(
-        new MiniBooNE_CCQE_XSec_1DQ2_antinu(name, file, rw, type, fkdt));
+    return (new MiniBooNE_CCQE_XSec_1DQ2_antinu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CCQE_XSec_2DTcos_nu") ||
              !name.compare("MiniBooNE_CCQELike_XSec_2DTcos_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CCQE_XSec_2DTcos_nu(name, file, rw, type, fkdt));
+    return (new MiniBooNE_CCQE_XSec_2DTcos_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CCQE_XSec_2DTcos_antinu") ||
              !name.compare("MiniBooNE_CCQELike_XSec_2DTcos_antinu")) {
-    fChain->push_back(
-        new MiniBooNE_CCQE_XSec_2DTcos_antinu(name, file, rw, type, fkdt));
+    return (new MiniBooNE_CCQE_XSec_2DTcos_antinu(samplekey));
 
     /*
       MiniBooNE CC1pi+
     */
     // 1D
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_1DEnu_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_1DEnu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_1DQ2_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pip_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_1DQ2_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_1DTpi_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pip_XSec_1DTpi_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_1DTpi_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_1DTu_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pip_XSec_1DTu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_1DTu_nu(samplekey));
 
     // 2D
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_2DQ2Enu_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTpiCospi_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTpiEnu_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTuCosmu_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pip_XSec_2DTuEnu_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pip_XSec_2DTuEnu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pip_XSec_2DTuEnu_nu(samplekey));
 
     /*
       MiniBooNE CC1pi0
     */
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DEnu_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pi0_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pi0_XSec_1DEnu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DQ2_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pi0_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pi0_XSec_1DQ2_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1DTu_nu")) {
-    fChain->push_back(new MiniBooNE_CC1pi0_XSec_1DTu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pi0_XSec_1DTu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dcosmu_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dcospi0_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(file, rw, type, fkdt));
+    return (new MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(samplekey));
 
   } else if (!name.compare("MiniBooNE_CC1pi0_XSec_1Dppi0_nu")) {
-    fChain->push_back(
-        new MiniBooNE_CC1pi0_XSec_1Dppi0_nu(file, rw, type, fkdt));
-
-    /* 
-       MIniBooNE NC1pi0
-    */
-  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_fhc_nu") || 
-	     !name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_fhc_combined")) {
-    fChain->push_back(
-		      new MiniBooNE_NC1pi0_XSec_1Dppi0_nu(name,file,rw,type,fkdt));
-  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_fhc_nu") ||
-             !name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_fhc_combined")) {
-    fChain->push_back(
-		      new MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(name,file,rw,type,fkdt));
-  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_rhc_antinu") ||
-             !name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_rhc_combined")) {
-    fChain->push_back(
-                      new MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(name,file,rw,type,fkdt));
-  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_rhc_antinu") ||
-             !name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_rhc_combined")) {
-    fChain->push_back(
-                      new MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(name,file,rw,type,fkdt));
-  
+    return (new MiniBooNE_CC1pi0_XSec_1Dppi0_nu(samplekey));
+
+  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu") ||
+             !name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_rhc")) {
+    return (new MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(samplekey));
+
+  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_nu") ||
+             !name.compare("MiniBooNE_NC1pi0_XSec_1Dcospi0_fhc")) {
+    return (new MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(samplekey));
+
+  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_antinu") ||
+             !name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_rhc")) {
+    return (new MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(samplekey));
+
+  } else if (!name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_nu") ||
+             !name.compare("MiniBooNE_NC1pi0_XSec_1Dppi0_fhc")) {
+    return (new MiniBooNE_NC1pi0_XSec_1Dppi0_nu(samplekey));
+
     /*
       MiniBooNE NCEL
     */
   } else if (!name.compare("MiniBooNE_NCEL_XSec_Treco_nu")) {
-    ERR(FTL)
-      << "MiniBooNE_NCEL_XSec_Treco_nu not implemented in current interface."
-      << std::endl;
-    throw 5;
-    // fChain->push_back(new MiniBooNE_NCEL_XSec_Treco_nu(file, rw, type,
-    // fkdt));
+    return (new MiniBooNE_NCEL_XSec_Treco_nu(samplekey));
 
     /*
-MINERvA Samples
+    MINERvA Samples
     */
   } else if (!name.compare("MINERvA_CCQE_XSec_1DQ2_nu") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_nu_20deg") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_nu_oldflux") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_nu_20deg_oldflux")) {
-    fChain->push_back(
-        new MINERvA_CCQE_XSec_1DQ2_nu(name, file, rw, type, fkdt));
+    return (
+             new MINERvA_CCQE_XSec_1DQ2_nu(samplekey));
 
   } else if (!name.compare("MINERvA_CCQE_XSec_1DQ2_antinu") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_20deg") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_oldflux") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_antinu_20deg_oldflux")) {
-    fChain->push_back(
-        new MINERvA_CCQE_XSec_1DQ2_antinu(name, file, rw, type, fkdt));
+    return (
+             new MINERvA_CCQE_XSec_1DQ2_antinu(samplekey));
 
   } else if (!name.compare("MINERvA_CCQE_XSec_1DQ2_joint_oldflux") ||
              !name.compare("MINERvA_CCQE_XSec_1DQ2_joint_20deg_oldflux") ||
-	     !name.compare("MINERvA_CCQE_XSec_1DQ2_joint") ||
-	     !name.compare("MINERvA_CCQE_XSec_1DQ2_joint_20deg")){
+             !name.compare("MINERvA_CCQE_XSec_1DQ2_joint") ||
+             !name.compare("MINERvA_CCQE_XSec_1DQ2_joint_20deg")) {
 
-    fChain->push_back(new MINERvA_CCQE_XSec_1DQ2_joint(name, file, rw, type, fkdt));
+    return (new MINERvA_CCQE_XSec_1DQ2_joint(samplekey));
 
   } else if (!name.compare("MINERvA_CC0pi_XSec_1DEe_nue")) {
-    fChain->push_back(new MINERvA_CC0pi_XSec_1DEe_nue(file, rw, type, fkdt));
+    return (new MINERvA_CC0pi_XSec_1DEe_nue(samplekey));
 
   } else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_nue")) {
-    fChain->push_back(new MINERvA_CC0pi_XSec_1DQ2_nue(file, rw, type, fkdt));
+    return (new MINERvA_CC0pi_XSec_1DQ2_nue(samplekey));
 
   } else if (!name.compare("MINERvA_CC0pi_XSec_1DThetae_nue")) {
-    fChain->push_back(
-        new MINERvA_CC0pi_XSec_1DThetae_nue(file, rw, type, fkdt));
+    return (
+             new MINERvA_CC0pi_XSec_1DThetae_nue(samplekey));
 
   } else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_nu_proton")) {
-    fChain->push_back(
-        new MINERvA_CC0pi_XSec_1DQ2_nu_proton(file, rw, type, fkdt));
+    return (
+            new MINERvA_CC0pi_XSec_1DQ2_nu_proton(samplekey));
+
+  } else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtC_nu") || 
+	     !name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtFe_nu") ||
+	     !name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtPb_nu") ){
+    return ( new MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(samplekey) );
+  
+  } else if (!name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioC_nu") ||
+             !name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioFe_nu") ||
+             !name.compare("MINERvA_CC0pi_XSec_1DQ2_TgtRatioPb_nu") ){
+    return ( new MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu(samplekey) );
+
+
     /*
       CC1pi+
     */
 // DONE
   } else if (!name.compare("MINERvA_CC1pip_XSec_1DTpi_nu") ||
-             !name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_20deg")) {
-    fChain->push_back(new MINERvA_CC1pip_XSec_1DTpi_nu(name, file, rw, type, fkdt));
+             !name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_20deg") ||
+             !name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_fluxcorr") ||
+             !name.compare("MINERvA_CC1pip_XSec_1DTpi_nu_20deg_fluxcorr") )  {
+    return (new MINERvA_CC1pip_XSec_1DTpi_nu(samplekey));
 
 // DONE
   } else if (!name.compare("MINERvA_CC1pip_XSec_1Dth_nu") ||
-             !name.compare("MINERvA_CC1pip_XSec_1Dth_nu_20deg")) {
-    fChain->push_back(new MINERvA_CC1pip_XSec_1Dth_nu(name, file, rw, type, fkdt));
+             !name.compare("MINERvA_CC1pip_XSec_1Dth_nu_20deg") ||
+             !name.compare("MINERvA_CC1pip_XSec_1Dth_nu_fluxcorr") ||
+             !name.compare("MINERvA_CC1pip_XSec_1Dth_nu_20deg_fluxcorr")) {
+    return (new MINERvA_CC1pip_XSec_1Dth_nu(samplekey));
 
     /*
       CCNpi+
     */
-  // DONE
   } else if (!name.compare("MINERvA_CCNpip_XSec_1Dth_nu") ||
              !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015") ||
              !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2016") ||
-             !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_20deg")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1Dth_nu(name, file, rw, type, fkdt));
+             !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg") ||
+             !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_fluxcorr") ||
+             !name.compare("MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg_fluxcorr")) {
+    return (new MINERvA_CCNpip_XSec_1Dth_nu(samplekey));
 
- // Done
   } else if (!name.compare("MINERvA_CCNpip_XSec_1DTpi_nu") ||
              !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015") ||
              !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2016") ||
-             !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_20deg")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1DTpi_nu(name, file, rw, type, fkdt));
+             !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg") ||
+             !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015_fluxcorr") ||
+             !name.compare("MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg_fluxcorr")) {
+    return (new MINERvA_CCNpip_XSec_1DTpi_nu(samplekey));
 
 
 // Done
   } else if (!name.compare("MINERvA_CCNpip_XSec_1Dthmu_nu")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1Dthmu_nu(file, rw, type, fkdt));
+    return (new MINERvA_CCNpip_XSec_1Dthmu_nu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CCNpip_XSec_1Dpmu_nu")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1Dpmu_nu(file, rw, type, fkdt));
+    return (new MINERvA_CCNpip_XSec_1Dpmu_nu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CCNpip_XSec_1DQ2_nu")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1DQ2_nu(file, rw, type, fkdt));
+    return (new MINERvA_CCNpip_XSec_1DQ2_nu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CCNpip_XSec_1DEnu_nu")) {
-    fChain->push_back(new MINERvA_CCNpip_XSec_1DEnu_nu(file, rw, type, fkdt));
+    return (new MINERvA_CCNpip_XSec_1DEnu_nu(samplekey));
 
     /*
       CC1pi0
     */
-  // Done
+    // Done
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu") ||
              !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2015") ||
-             !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2016")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1Dth_antinu(name, file, rw, type, fkdt));
+             !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2016") ||
+             !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_fluxcorr") ||
+             !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2015_fluxcorr") ||
+             !name.compare("MINERvA_CC1pi0_XSec_1Dth_antinu_2016_fluxcorr")) {
+    return (new MINERvA_CC1pi0_XSec_1Dth_antinu(samplekey));
 
-  } else if (!name.compare("MINERvA_CC1pi0_XSec_1Dppi0_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1Dppi0_antinu(file, rw, type, fkdt));
+  } else if (!name.compare("MINERvA_CC1pi0_XSec_1Dppi0_antinu") ||
+             !name.compare("MINERvA_CC1pi0_XSec_1Dppi0_antinu_fluxcorr")) {
+    return (new MINERvA_CC1pi0_XSec_1Dppi0_antinu(samplekey));
 
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1DTpi0_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1DTpi0_antinu(file, rw, type, fkdt));
+    return (new MINERvA_CC1pi0_XSec_1DTpi0_antinu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1DQ2_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1DQ2_antinu(file, rw, type, fkdt));
+    return (new MINERvA_CC1pi0_XSec_1DQ2_antinu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1Dthmu_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1Dthmu_antinu(file, rw, type, fkdt));
+    return (new MINERvA_CC1pi0_XSec_1Dthmu_antinu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1Dpmu_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1Dpmu_antinu(file, rw, type, fkdt));
+    return (new MINERvA_CC1pi0_XSec_1Dpmu_antinu(samplekey));
 
 // Done
   } else if (!name.compare("MINERvA_CC1pi0_XSec_1DEnu_antinu")) {
-    fChain->push_back(
-        new MINERvA_CC1pi0_XSec_1DEnu_antinu(file, rw, type, fkdt));
+    return (new MINERvA_CC1pi0_XSec_1DEnu_antinu(samplekey));
 
     /*
       CCINC
     */
   } else if (!name.compare("MINERvA_CCinc_XSec_2DEavq3_nu")) {
-    fChain->push_back(new MINERvA_CCinc_XSec_2DEavq3_nu(file, rw, type, fkdt));
+    return (new MINERvA_CCinc_XSec_2DEavq3_nu(samplekey));
 
   } else if (!name.compare("MINERvA_CCinc_XSec_1Dx_ratio_C12_CH") ||
              !name.compare("MINERvA_CCinc_XSec_1Dx_ratio_Fe56_CH") ||
              !name.compare("MINERvA_CCinc_XSec_1Dx_ratio_Pb208_CH")) {
-    fChain->push_back(
-        new MINERvA_CCinc_XSec_1Dx_ratio(name, file, rw, type, fkdt));
+    return (
+             new MINERvA_CCinc_XSec_1Dx_ratio(samplekey));
 
   } else if (!name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_C12_CH") ||
              !name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_Fe56_CH") ||
              !name.compare("MINERvA_CCinc_XSec_1DEnu_ratio_Pb208_CH")) {
-    fChain->push_back(
-        new MINERvA_CCinc_XSec_1DEnu_ratio(name, file, rw, type, fkdt));
+    return (new MINERvA_CCinc_XSec_1DEnu_ratio(samplekey));
 
     /*
-T2K Samples
+    T2K Samples
     */
 
   } else if (!name.compare("T2K_CC0pi_XSec_2DPcos_nu") ||
-	     !name.compare("T2K_CC0pi_XSec_2DPcos_nu_I") ||
-	     !name.compare("T2K_CC0pi_XSec_2DPcos_nu_II")) {
-    fChain->push_back(new T2K_CC0pi_XSec_2DPcos_nu(name, file, rw, type));
+             !name.compare("T2K_CC0pi_XSec_2DPcos_nu_I") ||
+             !name.compare("T2K_CC0pi_XSec_2DPcos_nu_II")) {
+    return (new T2K_CC0pi_XSec_2DPcos_nu(samplekey));
+
+  } else if (!name.compare("T2K_CC0pi_XSec_2DPcos_nu_nonuniform")){
+
+    return (new T2K_CC0pi_XSec_2DPcos_nu_nonuniform(samplekey));
 
     /*
       T2K CC1pi+ CH samples
     */
     // Comment these out for now because we don't have the proper data
     /*
-    
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dpmu_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dpmu_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dppi_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dppi_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dpmu_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dpmu_nu(file, rw, type, fkdt));
+
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dppi_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dppi_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1DQ2_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1DQ2_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1DQ2_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1DQ2_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dq3_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dq3_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dq3_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dq3_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthmupi_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dthmupi_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthmupi_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dthmupi_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthpi_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dthpi_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthpi_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dthpi_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthq3pi_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1Dthq3pi_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1Dthq3pi_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1Dthq3pi_nu(file, rw, type, fkdt));
 
-  } else if (!name.compare("T2K_CC1pip_CH_XSec_1DWrec_nu")) {
-    fChain->push_back(new T2K_CC1pip_CH_XSec_1DWrec_nu(file, rw, type, fkdt));
+    } else if (!name.compare("T2K_CC1pip_CH_XSec_1DWrec_nu")) {
+    return (new T2K_CC1pip_CH_XSec_1DWrec_nu(file, rw, type, fkdt));
     */
 
     /*
       T2K CC1pi+ H2O samples
     */
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1DEnuDelta_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1DEnuMB_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1DEnuMB_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1DEnuMB_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcosmu_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1Dcosmu_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1Dcosmu_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcosmupi_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dcospi_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1Dcospi_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1Dcospi_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dpmu_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1Dpmu_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1Dpmu_nu(samplekey));
 
   } else if (!name.compare("T2K_CC1pip_H2O_XSec_1Dppi_nu")) {
-    fChain->push_back(new   T2K_CC1pip_H2O_XSec_1Dppi_nu(file, rw, type, fkdt));
+    return (new   T2K_CC1pip_H2O_XSec_1Dppi_nu(samplekey));
 
     /*
       T2K CC0pi + np CH samples
     */
   } else if (!name.compare("T2K_CC0pinp_STV_XSec_1Ddpt_nu")) {
-    fChain->push_back(new T2K_CC0pinp_STV_XSec_1Ddpt_nu(file, rw, type, fkdt));
+    return (new T2K_CC0pinp_STV_XSec_1Ddpt_nu(samplekey));
 
-    /*
-      SciBooNE COH studies
-    */
+    // SciBooNE COH studies
   } else if (!name.compare("SciBooNE_CCCOH_STOP_NTrks_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_STOP_NTrks_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_1TRK_1DQ2_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_1TRK_1DQ2_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_MuPr_1DQ2_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_MuPr_1DQ2_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_MuPiVA_1DQ2_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_MuPiVA_1DQ2_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu(name, file, rw, type, fkdt));
   } else if (!name.compare("SciBooNE_CCCOH_STOPFINAL_1DQ2_nu")) {
     fChain->push_back(new SciBooNE_CCCOH_STOPFINAL_1DQ2_nu(name, file, rw, type, fkdt));
 
     /*
-K2K Samples
+    K2K Samples
     */
     /*
       NC1pi0
     */
   } else if (!name.compare("K2K_NC1pi0_Evt_1Dppi0_nu")) {
-    fChain->push_back(new K2K_NC1pi0_Evt_1Dppi0_nu(file, rw, type, fkdt));
+    return (new K2K_NC1pi0_Evt_1Dppi0_nu(samplekey));
 
     /*
-Fake Studies
+    Fake Studies
     */
 
   } else if (name.find("ExpMultDist_CCQE_XSec_1D") != std::string::npos &&
              name.find("_FakeStudy") != std::string::npos) {
-    fChain->push_back(
-        new ExpMultDist_CCQE_XSec_1DVar_FakeStudy(name, file, rw, type, fkdt));
+    return (
+             new ExpMultDist_CCQE_XSec_1DVar_FakeStudy(name, file, rw, type, fkdt));
 
   } else if (name.find("ExpMultDist_CCQE_XSec_2D") != std::string::npos &&
              name.find("_FakeStudy") != std::string::npos) {
-    fChain->push_back(
-        new ExpMultDist_CCQE_XSec_2DVar_FakeStudy(name, file, rw, type, fkdt));
+    return (
+             new ExpMultDist_CCQE_XSec_2DVar_FakeStudy(name, file, rw, type, fkdt));
 
   } else if (name.find("GenericFlux_") != std::string::npos) {
-    fChain->push_back(new GenericFlux_Tester(name, file, rw, type, fkdt));
+    return (new GenericFlux_Tester(name, file, rw, type, fkdt));
+
+  } else if (!name.compare("T2K2017_FakeData")) {
+    return (new T2K2017_FakeData(samplekey));
+
+  } else if (!name.compare("MCStudy_CCQE")) {
+    return (new MCStudy_CCQEHistograms(name, file, rw, type, fkdt));
+
+  } else if (!name.compare("ElectronFlux_FlatTree")) {
+    return (new ElectronFlux_FlatTree(name, file, rw, type, fkdt));
+
+  } else if (name.find("ElectronData_") != std::string::npos) {
+    return new ElectronScattering_DurhamData(samplekey);
 
     //} else if (name.find("MCStudy_KaonPreSelection") != std::string::npos) {
     //fChain->push_back(new MCStudy_KaonPreSelection(name, file, rw, type, fkdt));
 
   } else if (name.find("MuonValidation_") != std::string::npos) {
-    fChain->push_back(new MCStudy_MuonValidation(name, file, rw, type, fkdt));
-        
+    return (new MCStudy_MuonValidation(name, file, rw, type, fkdt));
+
   } else {
     ERR(FTL) << "Error: No such sample: " << name << std::endl;
     exit(-1);
-    return false;
+    return NULL;
   }
 
-  // Return if sample was loaded correctly;
-  return true;
+// Return NULL if no sample loaded.
+  return NULL;
 }
 }
diff --git a/src/FCN/SampleList.h b/src/FCN/SampleList.h
index a12465f..5d1a4ed 100644
--- a/src/FCN/SampleList.h
+++ b/src/FCN/SampleList.h
@@ -1,245 +1,260 @@
 #ifndef _SAMPLE_LIST_H_
 #define _SAMPLE_LIST_H_
 
 /*!
  *  \addtogroup FCN
  *  @{
  */
 
 #include "ANL_CCQE_Evt_1DQ2_nu.h"
 #include "ANL_CCQE_XSec_1DEnu_nu.h"
 
 // ANL CC1ppip
 #include "ANL_CC1ppip_Evt_1DQ2_nu.h"
 #include "ANL_CC1ppip_Evt_1DcosmuStar_nu.h"
 #include "ANL_CC1ppip_Evt_1DcosmuStar_nu.h"
 #include "ANL_CC1ppip_Evt_1DcosthAdler_nu.h"
 #include "ANL_CC1ppip_Evt_1Dphi_nu.h"
 #include "ANL_CC1ppip_Evt_1Dppi_nu.h"
 #include "ANL_CC1ppip_Evt_1Dthpr_nu.h"
 #include "ANL_CC1ppip_XSec_1DEnu_nu.h"
 #include "ANL_CC1ppip_XSec_1DQ2_nu.h"
 // ANL CC1npip
 #include "ANL_CC1npip_Evt_1DQ2_nu.h"
 #include "ANL_CC1npip_Evt_1DcosmuStar_nu.h"
 #include "ANL_CC1npip_Evt_1Dppi_nu.h"
 #include "ANL_CC1npip_XSec_1DEnu_nu.h"
 // ANL CC1pi0
 #include "ANL_CC1pi0_Evt_1DQ2_nu.h"
 #include "ANL_CC1pi0_Evt_1DcosmuStar_nu.h"
 #include "ANL_CC1pi0_XSec_1DEnu_nu.h"
 // ANL NC1npip (mm, exotic!)
 #include "ANL_NC1npip_Evt_1Dppi_nu.h"
 // ANL NC1ppim (mm, exotic!)
 #include "ANL_NC1ppim_XSec_1DEnu_nu.h"
 #include "ANL_NC1ppim_Evt_1DcosmuStar_nu.h"
 // ANL CC2pi 1pim1pip (mm, even more exotic!)
 #include "ANL_CC2pi_1pim1pip_XSec_1DEnu_nu.h"
 #include "ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu.h"
 #include "ANL_CC2pi_1pim1pip_Evt_1Dppip_nu.h"
 #include "ANL_CC2pi_1pim1pip_Evt_1Dppim_nu.h"
 #include "ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h"
 // ANL CC2pi 1pip1pip (mm, even more exotic!)
 #include "ANL_CC2pi_1pip1pip_XSec_1DEnu_nu.h"
 #include "ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu.h"
 #include "ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu.h"
 #include "ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu.h"
 #include "ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu.h"
 // ANL CC2pi 1pip1pi0 (mm, even more exotic!)
 #include "ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu.h"
 #include "ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu.h"
 #include "ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu.h"
 #include "ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu.h"
 #include "ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu.h"
 
 // ArgoNeuT CC-inclusive
 #include "ArgoNeuT_CCInc_XSec_1Dpmu_antinu.h"
 #include "ArgoNeuT_CCInc_XSec_1Dpmu_nu.h"
 #include "ArgoNeuT_CCInc_XSec_1Dthetamu_antinu.h"
 #include "ArgoNeuT_CCInc_XSec_1Dthetamu_nu.h"
 
 // BNL CCQE
 #include "BNL_CCQE_Evt_1DQ2_nu.h"
 #include "BNL_CCQE_XSec_1DEnu_nu.h"
 // BNL CC1ppip
 #include "BNL_CC1ppip_Evt_1DQ2_nu.h"
 #include "BNL_CC1ppip_Evt_1DQ2_nu.h"
 #include "BNL_CC1ppip_Evt_1DcosthAdler_nu.h"
 #include "BNL_CC1ppip_Evt_1Dphi_nu.h"
 #include "BNL_CC1ppip_XSec_1DEnu_nu.h"
 // BNL CC1npip
 #include "BNL_CC1npip_Evt_1DQ2_nu.h"
 #include "BNL_CC1npip_XSec_1DEnu_nu.h"
 // BNL CC1pi0
 #include "BNL_CC1pi0_Evt_1DQ2_nu.h"
 #include "BNL_CC1pi0_XSec_1DEnu_nu.h"
 
 // FNAL CCQE
 #include "FNAL_CCQE_Evt_1DQ2_nu.h"
 // FNAL CC1ppip
 #include "FNAL_CC1ppip_Evt_1DQ2_nu.h"
 #include "FNAL_CC1ppip_XSec_1DEnu_nu.h"
 #include "FNAL_CC1ppip_XSec_1DQ2_nu.h"
 // FNAL CC1ppim
-//#include "FNAL_CC1ppim_XSec_1DEnu_antinu.h"
+#include "FNAL_CC1ppim_XSec_1DEnu_antinu.h"
 
 // BEBC CCQE
 #include "BEBC_CCQE_XSec_1DQ2_nu.h"
 // BEBC CC1ppip
 #include "BEBC_CC1ppip_XSec_1DEnu_nu.h"
 #include "BEBC_CC1ppip_XSec_1DQ2_nu.h"
 // BEBC CC1npip
 #include "BEBC_CC1npip_XSec_1DEnu_nu.h"
 #include "BEBC_CC1npip_XSec_1DQ2_nu.h"
 // BEBC CC1pi0
 #include "BEBC_CC1pi0_XSec_1DEnu_nu.h"
 #include "BEBC_CC1pi0_XSec_1DQ2_nu.h"
 // BEBC CC1npim
 #include "BEBC_CC1npim_XSec_1DEnu_antinu.h"
 #include "BEBC_CC1npim_XSec_1DQ2_antinu.h"
 // BEBC CC1ppim
 #include "BEBC_CC1ppim_XSec_1DEnu_antinu.h"
 #include "BEBC_CC1ppim_XSec_1DQ2_antinu.h"
 
 // GGM CC1ppip
 #include "GGM_CC1ppip_Evt_1DQ2_nu.h"
 #include "GGM_CC1ppip_XSec_1DEnu_nu.h"
 
 // MiniBooNE CCQE
 #include "MiniBooNE_CCQE_XSec_1DQ2_nu.h"
 #include "MiniBooNE_CCQE_XSec_1DQ2_antinu.h"
 #include "MiniBooNE_CCQE_XSec_2DTcos_antinu.h"
 #include "MiniBooNE_CCQE_XSec_2DTcos_antinu.h"
 #include "MiniBooNE_CCQE_XSec_2DTcos_nu.h"
 
 // MiniBooNE CC1pi+ 1D
 #include "MiniBooNE_CC1pip_XSec_1DEnu_nu.h"
 #include "MiniBooNE_CC1pip_XSec_1DQ2_nu.h"
 #include "MiniBooNE_CC1pip_XSec_1DTpi_nu.h"
 #include "MiniBooNE_CC1pip_XSec_1DTu_nu.h"
 // MiniBooNE CC1pi+ 2D
 #include "MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h"
 #include "MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h"
 #include "MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h"
 #include "MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h"
 #include "MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h"
 
 // MiniBooNE CC1pi0
 #include "MiniBooNE_CC1pi0_XSec_1DEnu_nu.h"
 #include "MiniBooNE_CC1pi0_XSec_1DQ2_nu.h"
 #include "MiniBooNE_CC1pi0_XSec_1DTu_nu.h"
 #include "MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h"
 #include "MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h"
 #include "MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h"
+#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h"
+#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h"
+#include "MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h"
+#include "MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h"
+
+
+
 
 // MiniBooNE NC1pi0
 //#include "MiniBooNE_NCpi0_XSec_1Dppi0_nu.h"
-#include "MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h"
-#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h"
-#include "MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h"
-#include "MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h"
 
 // MiniBooNE NCEL
-// #include "MiniBooNE_NCEL_XSec_Treco_nu.h"
+#include "MiniBooNE_NCEL_XSec_Treco_nu.h"
 
 // MINERvA CCQE
 #include "MINERvA_CCQE_XSec_1DQ2_antinu.h"
 #include "MINERvA_CCQE_XSec_1DQ2_joint.h"
 #include "MINERvA_CCQE_XSec_1DQ2_nu.h"
 
 // MINERvA CC0pi
 #include "MINERvA_CC0pi_XSec_1DEe_nue.h"
 #include "MINERvA_CC0pi_XSec_1DQ2_nu_proton.h"
 #include "MINERvA_CC0pi_XSec_1DQ2_nue.h"
 #include "MINERvA_CC0pi_XSec_1DThetae_nue.h"
 
 // MINERvA CC1pi+
 #include "MINERvA_CC1pip_XSec_1DTpi_20deg_nu.h"
 #include "MINERvA_CC1pip_XSec_1DTpi_nu.h"
 #include "MINERvA_CC1pip_XSec_1Dth_20deg_nu.h"
 #include "MINERvA_CC1pip_XSec_1Dth_nu.h"
 
 // MINERvA CCNpi+
 #include "MINERvA_CCNpip_XSec_1Dth_nu.h"
 #include "MINERvA_CCNpip_XSec_1DTpi_nu.h"
 #include "MINERvA_CCNpip_XSec_1Dpmu_nu.h"
 #include "MINERvA_CCNpip_XSec_1Dthmu_nu.h"
 #include "MINERvA_CCNpip_XSec_1DQ2_nu.h"
 #include "MINERvA_CCNpip_XSec_1DEnu_nu.h"
 
 // MINERvA CC1pi0
 #include "MINERvA_CC1pi0_XSec_1Dth_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1Dppi0_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1DTpi0_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1Dthmu_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1Dpmu_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1DQ2_antinu.h"
 #include "MINERvA_CC1pi0_XSec_1DEnu_antinu.h"
 
 // MINERvA CCINC
 #include "MINERvA_CCinc_XSec_2DEavq3_nu.h"
 #include "MINERvA_CCinc_XSec_1Dx_ratio.h"
 #include "MINERvA_CCinc_XSec_1DEnu_ratio.h"
 
 // T2K CC0pi
 #include "T2K_CC0pi_XSec_2DPcos_nu.h"
 
 // T2K CC1pi+ on CH
 #include "T2K_CC1pip_CH_XSec_1Dpmu_nu.h"
 #include "T2K_CC1pip_CH_XSec_1Dppi_nu.h"
 #include "T2K_CC1pip_CH_XSec_1Dthpi_nu.h"
 #include "T2K_CC1pip_CH_XSec_1Dthmupi_nu.h"
 #include "T2K_CC1pip_CH_XSec_1DQ2_nu.h"
 #include "T2K_CC1pip_CH_XSec_1Dq3_nu.h"
 #include "T2K_CC1pip_CH_XSec_1Dthq3pi_nu.h"
 #include "T2K_CC1pip_CH_XSec_1DWrec_nu.h"
 
 // T2K CC1pi+ on H2O
 #include "T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1Dcospi_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1Dpmu_nu.h"
 #include "T2K_CC1pip_H2O_XSec_1Dppi_nu.h"
 
 // T2K STV CC0pi
 #include "T2K_CC0pinp_STV_XSec_1Ddpt_nu.h"
 
 // SciBooNE COH studies
 #include "SciBooNE_CCCOH_STOP_NTrks_nu.h"
 #include "SciBooNE_CCCOH_1TRK_1DQ2_nu.h"
 #include "SciBooNE_CCCOH_MuPr_1DQ2_nu.h"
 #include "SciBooNE_CCCOH_MuPiVA_1DQ2_nu.h"
 #include "SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu.h"
 #include "SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu.h"
 #include "SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu.h"
 #include "SciBooNE_CCCOH_STOPFINAL_1DQ2_nu.h"
 
 // K2K NC1pi0
 #include "K2K_NC1pi0_Evt_1Dppi0_nu.h"
 
 // MC Studies
 #include "ExpMultDist_CCQE_XSec_1DVar_FakeStudy.h"
 #include "ExpMultDist_CCQE_XSec_2DVar_FakeStudy.h"
+#include "MCStudy_CCQEHistograms.h"
 
 #include "GenericFlux_Tester.h"
 
 #include "MCStudy_KaonPreSelection.h"
 #include "MCStudy_MuonValidation.h"
+#include "ElectronFlux_FlatTree.h"
+#include "ElectronScattering_DurhamData.h"
+#include "MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h"
+#include "T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h"
+
+#include "MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h"
+#include "T2K2017_FakeData.h"
 
 #include "FitWeight.h"
 
+#include "NuisConfig.h"
+#include "NuisKey.h"
 
 //! Functions to make it easier for samples to be created and handled.
 namespace SampleUtils {
 
 //! Create a given sample given its name, file, type, fakdata(fkdt) file and the
 //! current rw engine and push it back into the list fChain.
-bool LoadSample(std::list<MeasurementBase*>* fChain, std::string name,
+/*bool LoadSample(std::list<MeasurementBase*>* fChain, std::string name,
                 std::string file, std::string type, std::string fkdt,
-                FitWeight* rw);
+                FitWeight* rw);*/
+MeasurementBase* CreateSample(std::string name, std::string file, std::string type, std::string fkdt, FitWeight* rw);
+MeasurementBase* CreateSample(nuiskey samplekey);
 }
 
 /*! @} */
 #endif
diff --git a/src/FCN/nuiscardcreator.py b/src/FCN/nuiscardcreator.py
new file mode 100755
index 0000000..2eb6ad7
--- /dev/null
+++ b/src/FCN/nuiscardcreator.py
@@ -0,0 +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 "<nuisance>"
+   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 "</nuisance>"
+
+forceful  = False
+xmlformat = True
+def CreateBlankInputXML(outputcard):
+
+   # Parse Sample List
+   samplelist    = str(os.environ['EXT_FIT']) + '/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("<inputs>\n\n")
+
+   f.write('  <!-- INPUT NOTES --> \n')
+   for comment in commentlist:
+      f.write('  <!-- ' + comment + ' --> \n')
+   f.write('\n\n')
+
+   for id in idlist:
+      f.write('  <input type="' + id + '"  file="TYPE:/path/to/' + id + '_file.root" /> \n')
+   f.write("</inputs>")
+
+   # 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['EXT_FIT']) + '/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
+      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("<nuisance>\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( '  <!-- ' + id[1] + ' --> \n')
+         continue
+
+      # Main Writing
+      f.write('  <sample name="' + id[0] + '"  file="' + id[1] + '" /> \n')
+   f.write("</nuisance>")
+
+
+   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/FCN/sample_list.xml b/src/FCN/sample_list.xml
new file mode 100644
index 0000000..d8301e1
--- /dev/null
+++ b/src/FCN/sample_list.xml
@@ -0,0 +1,415 @@
+<sample_list>
+
+  <input eventcomment=' #### ' />
+  <input eventcomment='Replace the following file paths to point to your MC files of interest.' />
+  <input eventcomment='If you dont care about a specific set, then just remove that 
+input line, or leave the file path blank' />
+  <input eventcomment='Replace TYPE: with your generator type, e.g. "GENIE:"" ' />
+  <input eventcomment=' #### ' />
+
+  <input action='SKIP' />
+  <input comment='ANL SAMPLES' check='ANL'/>
+
+  <input eventcomment='ANL_FHC_NUMU_D2 : events generated with ANL forward horn current
+flux in muon neutrino mode on a deuterium target.' />
+
+  <input comment='ANL CCQE'    check='ANL_CCQE' />
+  <input sample="ANL_CCQE_XSec_1DEnu_nu"                  type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_XSec_1DEnu_nu_PRD26"            type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_XSec_1DEnu_nu_PRL31"            type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_XSec_1DEnu_nu_PRD16"            type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_Evt_1DQ2_nu"                    type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_Evt_1DQ2_nu_PRL31"              type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_Evt_1DQ2_nu_PRD26"              type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CCQE_Evt_1DQ2_nu_PRD16"              type="TYPE:ANL_FHC_NUMU_D2" />
+
+  <input comment='   ANL CC1PPIP' check='ANL_CC1ppip' />
+  <input sample="ANL_CC1ppip_XSec_1DEnu_nu"               type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_XSec_1DEnu_nu_W14Cut"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_XSec_1DEnu_nu_Uncorr"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr" type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_XSec_1DEnu_nu_W16Cut_Uncorr" type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_XSec_1DQ2_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1DQ2_nu"                 type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1DQ2_nu_W14Cut"          type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1Dppi_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1Dthpr_nu"               type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1DcosmuStar_nu"          type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1DcosthAdler_nu"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1ppip_Evt_1Dphi_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+
+  <input comment='   ANL CC1NPIP' check='ANL_CC1npip' />
+  <input sample="ANL_CC1npip_XSec_1DEnu_nu"               type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_XSec_1DEnu_nu_W14Cut"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_XSec_1DEnu_nu_Uncorr"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_XSec_1DEnu_nu_W14Cut_Uncorr" type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_XSec_1DEnu_nu_W16Cut_Uncorr" type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_Evt_1DQ2_nu"                 type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_Evt_1DQ2_nu_W14Cut"          type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_Evt_1Dppi_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1npip_Evt_1DcosmuStar_nu"          type="TYPE:ANL_FHC_NUMU_D2" />
+
+  <input comment='   ANL CC1PI0' check='ANL_CC1ppi0' />
+  <input sample="ANL_CC1pi0_XSec_1DEnu_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_XSec_1DEnu_nu_W14Cut"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_XSec_1DEnu_nu_Uncorr"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_XSec_1DEnu_nu_W14Cut_Uncorr"  type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_XSec_1DEnu_nu_W16Cut_Uncorr"  type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_Evt_1DQ2_nu"                  type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_Evt_1DQ2_nu_W14Cut"           type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC1pi0_Evt_1DcosmuStar_nu"           type="TYPE:ANL_FHC_NUMU_D2" />
+
+  <input comment='   ANL NC' check='ANL_NC' />
+  <input sample="ANL_NC1npip_Evt_1Dppi_nu"                type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_NC1ppim_XSec_1DEnu_nu"               type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_NC1ppim_Evt_1DcosmuStar_nu"          type="TYPE:ANL_FHC_NUMU_D2" />
+
+  <input comment='   ANL CC2PI' check='ANL_CC2pi' />
+  <input sample="ANL_CC2pi_1pim1pip_XSec_1DEnu_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pim1pip_Evt_1Dpmu_nu"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pim1pip_Evt_1Dppip_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pim1pip_Evt_1Dppim_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu"       type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pip_XSec_1DEnu_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pip_Evt_1Dpmu_nu"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pip_Evt_1Dpneut_nu"       type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pip_Evt_1DppipHigh_nu"    type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pip_Evt_1DppipLow_nu"     type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pi0_XSec_1DEnu_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pi0_Evt_1Dpmu_nu"         type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pi0_Evt_1Dppip_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pi0_Evt_1Dppi0_nu"        type="TYPE:ANL_FHC_NUMU_D2" />
+  <input sample="ANL_CC2pi_1pip1pi0_Evt_1Dpprot_nu"       type="TYPE:ANL_FHC_NUMU_D2" />
+
+
+  <input action='SKIP' />
+  <input comment='ArgoNeuT SAMPLES' check='ArgoNeuT'/>
+  
+   <input eventcomment='ArgoNeuT_FHC_NUMU_AR : events generated with ArgoNeuT forward horn current
+flux in muon neutrino mode on Argon 40 target.' />
+   <input eventcomment='ArgoNeuT_RHC_NUMUB_AR : events generated with ArgoNeuT reverse horn current
+flux in muon antineutrino mode on Argon 40 target.' />
+
+  <input comment='   ArgoNeuT Neutrino' check='ArgoNeuT+_nu' />
+  <input sample="ArgoNeuT_CCInc_XSec_1Dpmu_nu"     type="TYPE:ArgoNeuT_FHC_NUMU_AR" />
+  <input sample="ArgoNeuT_CCInc_XSec_1Dthetamu_nu" type="TYPE:ArgoNeuT_FHC_NUMU_AR" />
+  
+  <input comment='   ArgoNeuT AntiNeutrino' check='ArgoNeuT+_antinu' />
+  <input sample="ArgoNeuT_CCInc_XSec_1Dpmu_antinu"     type="TYPE:ArgoNeuT_RHC_NUMUB_AR" />
+  <input sample="ArgoNeuT_CCInc_XSec_1Dthetamu_antinu" type="TYPE:ArgoNeuT_RHC_NUMUB_AR" />
+
+
+  <input action='SKIP' />
+  <input comment='BNL SAMPLES' check='BNL'/>
+
+    <input eventcomment='BNL_FHC_NUMU_D2 : events generated with BNL forward horn current
+flux in muon neutrino mode on a deuterium target.' />
+  
+  <input comment='   BNL CCQE' check='BNL+_CCQE' />
+  <input sample="BNL_CCQE_XSec_1DEnu_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CCQE_Evt_1DQ2_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  
+  <input comment='   BNL CC1ppip' check='BNL+_CC1ppip' />
+  <input sample="BNL_CC1ppip_XSec_1DEnu_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_XSec_1DEnu_nu_Uncorr" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_XSec_1DEnu_nu_W14Cut" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_XSec_1DEnu_nu_W14Cut_Uncorr" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_Evt_1DQ2_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_Evt_1DQ2_nu_W14Cut" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_Evt_1DcosthAdler_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1ppip_Evt_1Dphi_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  
+  <input comment='   BNL CC1npip' check='BNL+_CC1npip' />
+  <input sample="BNL_CC1npip_XSec_1DEnu_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1npip_XSec_1DEnu_nu_Uncorr" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1npip_Evt_1DQ2_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  
+  <input comment='   BNL CC1ppip' check='BNL+_CC1pi0' />
+  <input sample="BNL_CC1pi0_XSec_1DEnu_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+  <input sample="BNL_CC1pi0_Evt_1DQ2_nu" type="TYPE:BNL_FHC_NUMU_D2" />
+
+
+  <input action='SKIP' />
+  <input comment='FNAL SAMPLES' check='FNAL'/>
+
+     <input eventcomment='FNAL_FHC_NUMU_D2 : events generated with FNAL forward horn current
+flux in muon neutrino mode on a deuterium target.' />
+
+  <input comment='   FNAL CCQE' check='FNAL+_CCQE' />
+  <input sample="FNAL_CCQE_Evt_1DQ2_nu" type="TYPE:FNAL_FHC_NUMU_D2" />
+  
+  <input comment='   FNAL CC1ppip' check='FNAL+_CC1ppip' />
+  <input sample="FNAL_CC1ppip_XSec_1DEnu_nu" type="TYPE:FNAL_FHC_NUMU_D2" />
+  <input sample="FNAL_CC1ppip_XSec_1DQ2_nu" type="TYPE:FNAL_FHC_NUMU_D2" />
+  <input sample="FNAL_CC1ppip_Evt_1DQ2_nu" type="TYPE:FNAL_FHC_NUMU_D2" />
+  
+  <input comment='   FNAL CC1ppim Antineutrino' check='FNAL+_CC1ppim+_antinu' />
+  <input sample="FNAL_CC1ppim_XSec_1DEnu_antinu" type="TYPE:FNAL_RHC_NUMUB_D2" />
+
+
+
+  <input action='SKIP' />
+  <input comment='BEBC SAMPLES' check='BEBC'/>
+  
+   <input eventcomment='BEBC_FHC_NUMU_D2 : events generated with BEBC forward horn current
+flux in muon neutrino mode on a deuterium target.' />
+   <input eventcomment='BEBC_RHC_NUMUB_D2 : events generated with BEBC reverse horn current
+flux in muon antineutrino mode on a deuterium target.' />
+
+  <input comment='   BEBC CCQE' check='BEBC+_CCQE' />
+  <input sample="BEBC_CCQE_XSec_1DQ2_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  
+  <input comment='   BEBC CC1ppip' check='BEBC+_CC1ppip' />
+  <input sample="BEBC_CC1ppip_XSec_1DEnu_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  <input sample="BEBC_CC1ppip_XSec_1DQ2_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  
+  <input comment='   BEBC CC1npip' check='BEBC+_CC1npip' />
+  <input sample="BEBC_CC1npip_XSec_1DEnu_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  <input sample="BEBC_CC1npip_XSec_1DQ2_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  
+  <input comment='   BEBC CC1pi0' check='BEBC+_CC1pi0' />
+  <input sample="BEBC_CC1pi0_XSec_1DEnu_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  <input sample="BEBC_CC1pi0_XSec_1DQ2_nu" type="TYPE:BEBC_FHC_NUMU_D2" />
+  
+  <input comment='   BEBC CC1npim Antineutrino' check='BEBC+_CC1npim+_antinu' />
+  <input sample="BEBC_CC1npim_XSec_1DEnu_antinu" type="TYPE:BEBC_RHC_NUMUB_D2" />
+  <input sample="BEBC_CC1npim_XSec_1DQ2_antinu" type="TYPE:BEBC_RHC_NUMUB_D2" />
+  <input sample="BEBC_CC1ppim_XSec_1DEnu_antinu" type="TYPE:BEBC_RHC_NUMUB_D2" />
+  <input sample="BEBC_CC1ppim_XSec_1DQ2_antinu" type="TYPE:BEBC_RHC_NUMUB_D2" />
+
+
+
+  <input action='SKIP' />
+  <input comment='GGM SAMPLES' check='GGM'/>
+
+  <input eventcomment='GGM_FHC_NUMU_D2 : events generated with GGM forward horn current
+flux in muon neutrino mode on a deuterium target.' />
+
+  <input comment='   GGM CC1ppip' check='GGM+_CC1ppip' />
+  <input sample="GGM_CC1ppip_XSec_1DEnu_nu" type="TYPE:GGM_FHC_NUMU_D2" />
+  <input sample="GGM_CC1ppip_Evt_1DQ2_nu" type="TYPE:GGM_FHC_NUMU_D2" />
+
+
+
+
+  <input action='SKIP' />
+  <input comment='MiniBooNE SAMPLES' check='MiniBooNE'/>
+
+  <input eventcomment='MB_FHC_NUMU_CH2 : events generated with MiniBooNE forward horn current
+flux in muon neutrino mode on a CH2 target.' />
+  <input eventcomment='MB_FHC_NUMUB_CH2 : events generated with MiniBooNE forward horn current
+flux in muon antineutrino mode on a CH2 target.' />
+  <input eventcomment='MB_RHC_NUMUB_CH2 : events generated with MiniBooNE reverse horn current
+flux in muon antineutrino mode on a CH2 target.' />
+  <input eventcomment='MB_RHC_NUMU_CH2 : events generated with MiniBooNE reverse horn current
+flux in muon neutrino mode on a CH2 target.' />
+
+  <input eventcomment='MB_FHC_NUMUandNUMUBAR_CH2 : events generated with MiniBooNE forward horn current
+flux in muon neutrino mode AND muon antineutrino mode on a CH2 target. '/>
+  <input eventcomment='    Can be a single file with both in it or can be given as a joint file like 
+TYPE:(MB_FHC_NUMU_CH2,MB_FHC_NUMUB_CH2)' />
+
+  <input eventcomment='MB_RHC_NUMUBARandNUMU_CH2 : events generated with MiniBooNE reverse horn current
+flux in muon antineutrino mode AND muon neutrino mode on a CH2 target. '/>
+  <input eventcomment='    Can be a single file with both in it or can be given as a joint file like 
+TYPE:(MB_RHC_NUMUB_CH2,MB_RHC_NUMU_CH2)' />
+
+  <input comment='   MiniBooNE CCQELike NuMu' check='MiniBooNE+_CCQE' />
+  <input sample="MiniBooNE_CCQE_XSec_1DQ2_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CCQE_XSec_2DTcos_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+
+  <input comment='   MiniBooNE CC0PI NuMu' check='MiniBooNE+_CCQELike' />
+  <input sample="MiniBooNE_CCQELike_XSec_2DTcos_nu" type="TYPE:MB_FHC_NUMUandNUMUBAR_CH2" />
+  <input sample="MiniBooNE_CCQELike_XSec_1DQ2_nu" type="TYPE:MB_FHC_NUMUandNUMUBAR_CH2" />
+
+  <input comment='   MiniBooNE CCQELike AntiNuMu' check='MiniBooNE+_CCQE+_antinu' />
+  <input sample="MiniBooNE_CCQE_XSec_1DQ2_antinu" type="TYPE:MB_RHC_NUMUB_CH2" />
+  <input sample="MiniBooNE_CCQE_CTarg_XSec_1DQ2_antinu" type="TYPE:MB_RHC_NUMUB_CH2" />
+  <input sample="MiniBooNE_CCQE_XSec_2DTcos_antinu" type="TYPE:MB_RHC_NUMUB_CH2" />
+
+  <input comment='   MiniBooNE CC0PI AntiNuMu' check='MiniBooNE+_CCQELike+_antinu' />
+  <input sample="MiniBooNE_CCQELike_XSec_2DTcos_antinu" type="TYPE:MB_RHC_NUMUBARandNUMU_CH2" />
+  <input sample="MiniBooNE_CCQELike_XSec_1DQ2_antinu" type="TYPE:MB_RHC_NUMUBARandNUMU_CH2" />
+
+  <input comment='   MiniBooNE CC1PIP ' check='MiniBooNE+_CC1pip' />
+  <input sample="MiniBooNE_CC1pip_XSec_1DEnu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_1DQ2_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_1DTpi_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_1DTu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_2DQ2Enu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_2DTpiCospi_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_2DTpiEnu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_2DTuCosmu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pip_XSec_2DTuEnu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+
+  <input comment='   MiniBooNE CC1PI0 ' check='MiniBooNE+_CC1pi0' />
+  <input sample="MiniBooNE_CC1pi0_XSec_1DEnu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pi0_XSec_1DQ2_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pi0_XSec_1DTu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pi0_XSec_1Dcosmu_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pi0_XSec_1Dcospi0_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_CC1pi0_XSec_1Dppi0_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+
+  <input comment='   MiniBooNE NC1pi0 Neutrino ' check='MiniBooNE+_NC1pi0+_nu' />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dcospi0_nu" type="TYPE:MB_FHC_NUMU_CH2" />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dppi0_nu"   type="TYPE:MB_FHC_NUMU_CH2" />
+
+  <input comment='   MiniBooNE NC1pi0 Antineutrino ' check='MiniBooNE+_NC1pi0+_antinu' />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu" type="TYPE:MB_RHC_NUMUB_CH2" />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dppi0_antinu" type="TYPE:MB_RHC_NUMUB_CH2"   />
+
+  <input comment='   MiniBooNE NC1pi0 FHC ' check='MiniBooNE+_NC1pi0+_fhc' />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dcospi0_fhc" type="TYPE:MB_FHC_NUMUandNUMUBAR_CH2" />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dppi0_fhc" type="TYPE:MB_FHC_NUMUandNUMUBAR_CH2" />
+
+  <input comment='   MiniBooNE NC1pi0 RHC ' check='MiniBooNE+_NC1pi0+_rhc' />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dcospi0_rhc" type="TYPE:MB_RHC_NUMUBARandNUMU_CH2" />
+  <input sample="MiniBooNE_NC1pi0_XSec_1Dppi0_rhc" type="TYPE:MB_RHC_NUMUBARandNUMU_CH2" />
+
+  <input comment='   MiniBooNE NCEL ' check='MiniBooNE+_NC1pi0+_NCEL' />
+  <input sample="MiniBooNE_NCEL_XSec_Treco_nu" type="TYPE:MB_FHC_NUMUandNUMUBAR_CH2" />
+
+
+
+
+  <input action='SKIP' />
+  <input comment='MINERvA SAMPLES' check='MINERvA'/>
+
+ <input eventcomment='MIN_FHC_NUMU_CH : events generated with MINERvA forward horn current
+flux in muon neutrino mode on a CH target.' />
+ <input eventcomment='MIN_FHC_NUMU_C : events generated with MINERvA forward horn current
+flux in muon neutrino mode on a C target.' />
+ <input eventcomment='MIN_FHC_NUMU_Fe : events generated with MINERvA forward horn current
+flux in muon neutrino mode on a Fe target.' />
+ <input eventcomment='MIN_FHC_NUMU_Pb : events generated with MINERvA forward horn current
+flux in muon neutrino mode on a Pb target.' />
+ <input eventcomment='MIN_RHC_NUMUB_CH : events generated with MINERvA reverse horn current
+flux in muon antineutrino mode on a CH target.' />
+ <input eventcomment='MIN_FHC_NUEandNUEB_CH : events generated with MINERvA forward horn current
+flux in electorn neutrino mode AND electorn antineutrino mode on a CH target.' />
+  <input eventcomment='    Can be a single file with both in it or can be given as a joint file like 
+TYPE:(MB_FHC_NUE_CH,MB_FHC_NUEB_CH)' />
+
+ <input comment='   MINERvA CCQELike NUMU ' check='MINERvA+_CCQE+_nu' />
+<input sample="MINERvA_CCQE_XSec_1DQ2_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_nu_20deg" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_nu_oldflux" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_nu_20deg_oldflux" type="TYPE:MIN_FHC_NUMU_CH" />
+
+ <input comment='   MINERvA CCQELike NUMUBAR ' check='MINERvA+_CCQE+_antinu' />
+<input sample="MINERvA_CCQE_XSec_1DQ2_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_antinu_20deg" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_antinu_oldflux" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_antinu_20deg_oldflux" type="TYPE:MIN_RHC_NUMUB_CH" />
+
+<input comment='   MINERvA CCQELike JOINT ' check='MINERvA+_CCQE+_joint' />
+<input sample="MINERvA_CCQE_XSec_1DQ2_joint_oldflux" type="TYPE:MIN_RHC_NUMUB_CH;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_joint_20deg_oldflux" type="TYPE:MIN_RHC_NUMUB_CH;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_joint" type="TYPE:MIN_RHC_NUMUB_CH;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCQE_XSec_1DQ2_joint_20deg" type="TYPE:MIN_RHC_NUMUB_CH;TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA CC0PI JOINT ' check='MINERvA+_CC0pi+_nue' />
+<input sample="MINERvA_CC0pi_XSec_1DEe_nue" type="TYPE:MIN_FHC_NUEandNUEB_CH" />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_nue" type="TYPE:MIN_FHC_NUEandNUEB_CH" />
+<input sample="MINERvA_CC0pi_XSec_1DThetae_nue" type="TYPE:MIN_FHC_NUEandNUEB_CH" />
+
+<input comment='   MINERvA CC0PI1p ' check='MINERvA+_CC0pi+_nu_proton' />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_nu_proton" type="TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA CC1ppip ' check='MINERvA+_CC1ppip' />
+<input sample="MINERvA_CC1pip_XSec_1DTpi_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1DTpi_nu_20deg" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1DTpi_nu_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1DTpi_nu_20deg_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1Dth_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1Dth_nu_20deg" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1Dth_nu_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CC1pip_XSec_1Dth_nu_20deg_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA CCNpip ' check='MINERvA+_CCNpip' />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu_2015" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu_2016" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu_2015_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dth_nu_2015_20deg_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu_2015" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu_2016" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu_2015_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DTpi_nu_2015_20deg_fluxcorr" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dthmu_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1Dpmu_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DQ2_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCNpip_XSec_1DEnu_nu" type="TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA CC1pi0 Antineutrino ' check='MINERvA+_CC1pi0+_antinu' />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu_2015" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu_2016" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu_fluxcorr" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu_2015_fluxcorr" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dth_antinu_2016_fluxcorr" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dppi0_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dppi0_antinu_fluxcorr" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1DTpi0_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1DQ2_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dthmu_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1Dpmu_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CC1pi0_XSec_1DEnu_antinu" type="TYPE:MIN_RHC_NUMUB_CH" />
+<input sample="MINERvA_CCinc_XSec_2DEavq3_nu" type="TYPE:MIN_RHC_NUMUB_CH" />
+
+<input comment='   MINERvA Carbon targets ' check='MINERvA+_TgtC/MINERvA+_C12/MINERvA+_TgtRatioC' />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtC_nu" type="TYPE:MIN_FHC_NUMU_C" />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtRatioC_nu" type="TYPE:MIN_FHC_NUMU_C;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1Dx_ratio_C12_CH" type="TYPE:MIN_FHC_NUMU_C;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1DEnu_ratio_C12_CH" type="TYPE:MIN_FHC_NUMU_C;TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA Iron targets ' check='MINERvA+_TgtFe/MINERvA+_Fe56/MINERvA+_TgtRatioFe' />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtFe_nu" type="TYPE:MIN_FHC_NUMU_Fe" />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtRatioFe_nu" type="TYPE:MIN_FHC_NUMU_Fe;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1Dx_ratio_Fe56_CH" type="TYPE:MIN_FHC_NUMU_Fe;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1DEnu_ratio_Fe56_CH" type="TYPE:MIN_FHC_NUMU_Fe;TYPE:MIN_FHC_NUMU_CH" />
+
+<input comment='   MINERvA Lead targets ' check='MINERvA+_TgtPb/MINERvA+_Pb208/MINERvA+_TgtRatioPb' />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtPb_nu" type="TYPE:MIN_FHC_NUMU_Pb" />
+<input sample="MINERvA_CC0pi_XSec_1DQ2_TgtRatioPb_nu" type="TYPE:MIN_FHC_NUMU_Pb;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1Dx_ratio_Pb208_CH" type="TYPE:MIN_FHC_NUMU_Pb;TYPE:MIN_FHC_NUMU_CH" />
+<input sample="MINERvA_CCinc_XSec_1DEnu_ratio_Pb208_CH" type="TYPE:MIN_FHC_NUMU_Pb;TYPE:MIN_FHC_NUMU_CH" />
+
+
+
+  <input action='SKIP' />
+  <input comment='T2K SAMPLES' check='T2K'/>
+
+   <input eventcomment='T2K_FHC_NUMU_CH : events generated with T2K forward horn current
+flux in muon neutrino mode on a CH target.' />
+   <input eventcomment='T2K_FHC_NUMU_H2O : events generated with T2K forward horn current
+flux in muon neutrino mode on a H2O target.' />
+
+  <input comment='   T2K CC0pi ' check='T2K+_CC0pi' />
+  <input sample="T2K_CC0pi_XSec_2DPcos_nu_II" type="TYPE:T2K_FHC_NUMU_CH" />
+  <input sample="T2K_CC0pi_XSec_2DPcos_nu_nonuniform" type="TYPE:T2K_FHC_NUMU_CH" />
+
+  <input comment='   T2K CC1pi H2O ' check='T2K+_CC1pip+H2O' />
+  <input sample="T2K_CC1pip_H2O_XSec_1DEnuDelta_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1DEnuMB_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1Dcosmu_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1Dcosmupi_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1Dcospi_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1Dpmu_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+  <input sample="T2K_CC1pip_H2O_XSec_1Dppi_nu" type="TYPE:T2K_FHC_NUMU_H2O" />
+
+
+
+
+  <input action='SKIP' />
+  <input comment='K2K SAMPLES' check='K2K'/>
+  <input eventcomment='K2K_FHC_NUMU_H2O : events generated with K2K forward horn current
+flux in muon neutrino mode on a H2O target.' />
+
+  <input comment='   K2K NC1pi0 H2O ' check='K2K+_NC1pi0+H2O' />
+  <input sample="K2K_NC1pi0_Evt_1Dppi0_nu" type="TYPE:K2K_FHC_NUMU_H2O" />
+
+</sample_list>
\ No newline at end of file
diff --git a/src/FNAL/CMakeLists.txt b/src/FNAL/CMakeLists.txt
index 85580ea..b87633d 100644
--- a/src/FNAL/CMakeLists.txt
+++ b/src/FNAL/CMakeLists.txt
@@ -1,58 +1,62 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 FNAL_CC1ppip_Evt_1DQ2_nu.cxx
 FNAL_CC1ppip_XSec_1DEnu_nu.cxx
 FNAL_CC1ppip_XSec_1DQ2_nu.cxx
 FNAL_CCQE_Evt_1DQ2_nu.cxx
+FNAL_CC1ppim_XSec_1DEnu_antinu.cxx
 )
 
 set(HEADERFILES
 FNAL_CC1ppim_XSec_1DEnu_antinu.h
 FNAL_CC1ppip_Evt_1DQ2_nu.h
 FNAL_CC1ppip_XSec_1DEnu_nu.h
 FNAL_CC1ppip_XSec_1DQ2_nu.h
 FNAL_CCQE_Evt_1DQ2_nu.h
 )
 
 set(LIBNAME expFNAL)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.cxx b/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.cxx
new file mode 100644
index 0000000..b000b31
--- /dev/null
+++ b/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.cxx
@@ -0,0 +1,66 @@
+#include "FNAL_CC1ppim_XSec_1DEnu_antinu.h"
+
+
+//********************************************************************
+FNAL_CC1ppim_XSec_1DEnu_antinu::FNAL_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "FNAL_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, 70.0);
+  fSettings.DefineAllowedTargets("D,H");
+
+  // plot information
+  fSettings.SetTitle("FNAL_CC1ppim_XSec_1DEnu_antinu");
+  fSettings.DefineAllowedSpecies("numub");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "FNAL/CC1ppim_on_p/FNAL_CC1ppim_on_p_Enu.csv");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+}
+
+void FNAL_CC1ppim_XSec_1DEnu_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 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 FNAL_CC1ppim_XSec_1DEnu_antinu::isSignal(FitEvent *event) {
+  return SignalDef::isCC1pi3Prong(event, -14, -211, 2212, EnuMin, EnuMax);
+}
diff --git a/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.h b/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.h
index dbe880c..9f32464 100644
--- a/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.h
+++ b/src/FNAL/FNAL_CC1ppim_XSec_1DEnu_antinu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FNAL_CC1PPIM_XSEC_1DENU_ANTINU_H_SEEN
 #define FNAL_CC1PPIM_XSEC_1DENU_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class FNAL_CC1ppim_XSec_1DEnu_antinu : public Measurement1D {
 public:
-  FNAL_CC1ppim_XSec_1DEnu_antinu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  FNAL_CC1ppim_XSec_1DEnu_antinu(nuiskey samplekey);
   virtual ~FNAL_CC1ppim_XSec_1DEnu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.cxx b/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.cxx
index 4556e9e..1607860 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,74 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FNAL_CC1ppip_Evt_1DQ2_nu.h"
 
-// The constructor
-FNAL_CC1ppip_Evt_1DQ2_nu::FNAL_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "FNAL_CC1ppip_Evt_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC1#pi} (GeV^{2}); Number of events";
-  EnuMin = 10;
-  EnuMax = 100;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+FNAL_CC1ppip_Evt_1DQ2_nu::FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/FNAL/CC1pip_on_p/FNAL_cc1ppip_nEvent_Q2_w14_bin_edit.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "FNAL_CC1ppip_Evt_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CC1#pi} (GeV^{2})");
+  fSettings.SetYTitle("Number of events");
+  fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
+  fSettings.SetEnuRange(10.0, 100.0);
+  fSettings.DefineAllowedTargets("D,H");
 
+  // plot information
+  fSettings.SetTitle("FNAL_CC1ppip_Evt_1DQ2_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "FNAL/CC1pip_on_p/FNAL_cc1ppip_nEvent_Q2_w14_bin_edit.txt");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  FinaliseSampleSettings();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")/(fNEvents+0.)*16./8.;
-};
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor =  GetEventHistogram()->Integral("width")/(fNEvents+0.)*2./1.;
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+}
 
 
 void FNAL_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;
 
   // FNAL 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 FNAL_CC1ppip_Evt_1DQ2_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/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
index 5a0d125..6acf1fd 100644
--- a/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/FNAL/FNAL_CC1ppip_Evt_1DQ2_nu.h
@@ -1,40 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 #define FNAL_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class FNAL_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
 public:
-  FNAL_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  FNAL_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~FNAL_CC1ppip_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
 
 
  private:
 
 };
   
 #endif
diff --git a/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.cxx b/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.cxx
index f7e89cf..8fdf7cb 100644
--- a/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,64 +1,84 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FNAL_CC1ppip_XSec_1DEnu_nu.h"
 
-// The constructor
-FNAL_CC1ppip_XSec_1DEnu_nu::FNAL_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+//********************************************************************
+FNAL_CC1ppip_XSec_1DEnu_nu::FNAL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  fName = "FNAL_CC1ppip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/proton)";
-  EnuMin = 10.0;
-  EnuMax = 100.0;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "FNAL_CC1ppip_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/FNAL/CC1pip_on_p/fnal78-numu-p-to-mu-p-piplus-lowW_edges.txt");
-  this->SetupDefaultHist();
+  // 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(10.0, 100.0);
+  fSettings.DefineAllowedTargets("D,H");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // plot information
+  fSettings.SetTitle("FNAL_CC1ppip_XSec_1DEnu_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "FNAL/CC1pip_on_p/fnal78-numu-p-to-mu-p-piplus-lowW_edges.txt");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+}
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
 
 void FNAL_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 FNAL_CC1ppip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
 }
 
diff --git a/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.h b/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.h
index 110638d..0b3de02 100644
--- a/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/FNAL/FNAL_CC1ppip_XSec_1DEnu_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FNAL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 #define FNAL_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class FNAL_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
 public:
-  FNAL_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  FNAL_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~FNAL_CC1ppip_XSec_1DEnu_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.cxx b/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.cxx
index 57edb0d..e5128a4 100644
--- a/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.cxx
+++ b/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.cxx
@@ -1,68 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FNAL_CC1ppip_XSec_1DQ2_nu.h"
 
-// The constructor
-FNAL_CC1ppip_XSec_1DQ2_nu::FNAL_CC1ppip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
-
-  fName = "FNAL_CC1ppip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC1#pi} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/proton)";
-  EnuMin = 10;
-  EnuMax = 100;
-  fIsDiag = true; // refers to covariance matrix; this measurement has none so only use errors, not covariance
-  fNormError = 0.20; // normalisation error on ANL BNL flux
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/FNAL/CC1pip_on_p/FNAL_cc1ppip_dsigdQ2_W14_edit.txt");
-  this->SetupDefaultHist();
-
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")/TotalIntegratedFlux("width"))*double(1E-38)/double(fNEvents)*(16./8.);
-};
+//********************************************************************
+FNAL_CC1ppip_XSec_1DQ2_nu::FNAL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "FNAL_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}_{CC1#pi} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2}/proton)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG", "FIX/DIAG");
+  fSettings.SetEnuRange(10.0, 100.0);
+  fSettings.DefineAllowedTargets("D,H");
+
+  // plot information
+  fSettings.SetTitle("FNAL_CC1ppip_XSec_1DQ2_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "FNAL/CC1pip_on_p/FNAL_cc1ppip_dsigdQ2_W14_edit.txt");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor =  (GetEventHistogram()->Integral("width")/TotalIntegratedFlux("width"))*double(1E-38)/double(fNEvents)*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
+}
 
 void FNAL_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;
 
   // FNAL 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 FNAL_CC1ppip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
 }
diff --git a/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.h b/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.h
index 8d32e1b..e642cf4 100644
--- a/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.h
+++ b/src/FNAL/FNAL_CC1ppip_XSec_1DQ2_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FNAL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
 #define FNAL_CC1PPIP_XSEC_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class FNAL_CC1ppip_XSec_1DQ2_nu : public Measurement1D {
 public:
-  FNAL_CC1ppip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  FNAL_CC1ppip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~FNAL_CC1ppip_XSec_1DQ2_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.cxx b/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.cxx
index a03ed4c..717c981 100755
--- a/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.cxx
+++ b/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.cxx
@@ -1,159 +1,146 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FNAL_CCQE_Evt_1DQ2_nu.h"
 
+
 //********************************************************************
-/// @brief FNAL CCQE Q2 Measurement on Free Nucleons (Ref: PRD16 3103)
-///
-/// @details Q2 Extracted assuming numu CCQE scattering of free nucleons.
-FNAL_CCQE_Evt_1DQ2_nu::FNAL_CCQE_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw,
-					     std::string type, std::string fakeDataFile){
+FNAL_CCQE_Evt_1DQ2_nu::FNAL_CCQE_Evt_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = "FNAL_CCQE_Evt_1DQ2_nu";
-  EnuMin = 0.;
-  EnuMax = 200.;
-  applyQ2correction = type.find("Q2CORR") != std::string::npos;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "FNAL_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.SetYTitle("Number of events");
+  fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
+  fSettings.SetEnuRange(0.0, 600.0);
+  fSettings.DefineAllowedTargets("D,H");
+
+  // plot information
+  fSettings.SetTitle("FNAL #nu_mu CCQE");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "FNAL/FNAL_CCQE_Data_PRD29_436.root;FNAL_CCQE_Data_1DQ2");
+
+  // 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_XSec_1DQ2_Correction");
+  }
 
-  fIsDiag = true;
-  fIsRawEvents = true;
+  FinaliseSampleSettings();
 
-  this->SetDataFromDatabase("FNAL/FNAL_CCQE_Data_PRD29_436.root", "FNAL_CCQE_Data_1DQ2");
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = 1.0;
 
-  this->SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
 
-  if (applyQ2correction){
-    this->CorrectionHist = PlotUtils::GetTH1DFromFile(GeneralUtils::GetTopLevelDir() + "/data/ANL/ANL_CCQE_Data_PRL31_844.root","ANL_1DQ2_Correction");
-    this->fMCHist_NoCorr = (TH1D*) this->fMCHist->Clone();
-    this->fMCHist_NoCorr->SetNameTitle( (this->fName + "_NOCORR").c_str(),(this->fName + "_NOCORR").c_str());
-  }
+  // Correction Histogram
+  if (applyQ2correction) {
 
-  // Mask out the first bin if required
-  this->SetBinMask(GeneralUtils::GetTopLevelDir() + "/data/FNAL/FNAL_CCQE_BinMask_PRD29_436.dat");
+    // Correction Hist
+    CorrectionHist = PlotUtils::GetTH1DFromFile( fSettings.GetS("q2correction_file"),
+                     fSettings.GetS("q2correction_hist") );
+    SetAutoProcessTH1(CorrectionHist, kCMD_Write);
 
-  // Setup Covariance
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
 
-  // Different generators require slightly different rescaling factors.
-  this->fScaleFactor = (GetEventHistogram()->Integral()/(fNEvents+0.)); // NEUT
+    // 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);
+  }
 
-  // Set starting scale factor
-  scaleF = -1.0;
-
-};
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
+}
 
 //********************************************************************
-/// @details Extract q2qe from event assuming quasi-elastic scattering
-void FNAL_CCQE_Evt_1DQ2_nu::FillEventVariables(FitEvent *event){
+void FNAL_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());
-  q2qe = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0.,true);
+  fXVar = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 0., true);
 
-  fXVar = q2qe;
+  GetQ2Box()->fQ2 = fXVar;
   return;
 };
 
 //********************************************************************
-bool FNAL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent *event){
-//********************************************************************
-  if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
-  if (q2qe <= 0) return false;
-  return true;
-};
-
-//********************************************************************
-/// @details Reset the histogram uncorrect
-void FNAL_CCQE_Evt_1DQ2_nu::ResetAll(){
+bool FNAL_CCQE_Evt_1DQ2_nu::isSignal(FitEvent * event) {
 //********************************************************************
 
-  Measurement1D::ResetAll();
-  this->fMCHist->Reset();
-
-  if (applyQ2correction)
-    this->fMCHist_NoCorr->Reset();
+  if (!SignalDef::isCCQE(event, 14, EnuMin, EnuMax)) return false;
 
+  // Q2 cut
+  if (GetQ2Box()->fQ2 <= 0) return false;
 
-}
+  return true;
+};
 
 //********************************************************************
-/// @details Apply additional event weights for free nucleon measurements
-void FNAL_CCQE_Evt_1DQ2_nu::FillHistograms(){
+void FNAL_CCQE_Evt_1DQ2_nu::FillHistograms() {
 //********************************************************************
 
+  if (applyQ2correction) {
+    fMCHist_NoCorr->Fill( GetQ2Box()->fQ2, Weight);
 
-  if (applyQ2correction){
-    this->fMCHist_NoCorr->Fill(fXVar, Weight);
-
-    if (fXVar < 0.225)
-      this->Weight *= this->CorrectionHist->Interpolate(fXVar);
+    if (GetQ2Box()->fQ2 < CorrectionHist->GetXaxis()->GetXmax() &&
+        GetQ2Box()->fQ2 > CorrectionHist->GetXaxis()->GetXmin())
+      Weight *= CorrectionHist->Interpolate(GetQ2Box()->fQ2);
   }
 
   Measurement1D::FillHistograms();
 
 }
 
 //********************************************************************
-void FNAL_CCQE_Evt_1DQ2_nu::ScaleEvents(){
+void FNAL_CCQE_Evt_1DQ2_nu::ScaleEvents() {
 //********************************************************************
 
-  this->fMCHist->Scale(fScaleFactor);
-  if (applyQ2correction) this->fMCHist_NoCorr->Scale(fScaleFactor);
-
-
-  // Scale to match data
-  scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist, fMaskHist);
-
-  this->fMCHist->Scale(scaleF);
-  this->fMCFine->Scale(scaleF);
+  Measurement1D::ScaleEvents();
 
-  if (applyQ2correction){
-    scaleF = PlotUtils::GetDataMCRatio(fDataHist, fMCHist_NoCorr, fMaskHist);
-    this->fMCHist_NoCorr->Scale(scaleF);
+  // Flux unfold our extra histogram
+  if (applyQ2correction) {
+    if (fMCHist_NoCorr->Integral()) {
+      fMCHist_NoCorr->Scale(fDataHist->Integral() / fMCHist_NoCorr->Integral());
+    }
   }
-
-}
-
-
-//********************************************************************
-/// @brief Include Q2 Correction plots into data write
-void FNAL_CCQE_Evt_1DQ2_nu::Write(std::string drawOpt){
-//********************************************************************
-
-  Measurement1D::Write(drawOpt);
-
-  if (applyQ2correction){
-    this->CorrectionHist->Write();
-    this->fMCHist_NoCorr->Write();
-  }
-
-
-  return;
 }
diff --git a/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.h b/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.h
index f745e9e..313ce65 100755
--- a/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.h
+++ b/src/FNAL/FNAL_CCQE_Evt_1DQ2_nu.h
@@ -1,51 +1,63 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FNAL_CCQE_Evt_1DQ2_NU_H_SEEN
 #define FNAL_CCQE_Evt_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
+#include "CustomVariableBoxes.h"
 
 //********************************************************************
 class FNAL_CCQE_Evt_1DQ2_nu : public Measurement1D {
 //********************************************************************
 
 public:
 
-  FNAL_CCQE_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~FNAL_CCQE_Evt_1DQ2_nu() {}; 
+  FNAL_CCQE_Evt_1DQ2_nu(nuiskey samplekey);
+  virtual ~FNAL_CCQE_Evt_1DQ2_nu() {};
   
-  void FillEventVariables(FitEvent *event);       
-  bool isSignal(FitEvent *event);                 
+  /// \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();
-  void Write(std::string drawOpt);
-  void ResetAll();
+
+  /// \brief scale the MC Hist and correction histograms
   void ScaleEvents();
 
+  /// \brief Use Q2 Box to save correction info
+  inline Q2VariableBox1D* GetQ2Box(){ return static_cast<Q2VariableBox1D*>(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 q2qe;       ///< fXVar
-  double scaleF; ///< Nominal Scale Factor
 
+  double ThetaMu;
+  double q2qe;
 
-};
-  
+};  
 #endif
diff --git a/src/FitBase/BaseFitEvt.cxx b/src/FitBase/BaseFitEvt.cxx
deleted file mode 100644
index a33d781..0000000
--- a/src/FitBase/BaseFitEvt.cxx
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#include <cmath>
-#include <cstdlib>
-#include <ctime>
-#include <iostream>
-#include <sstream>
-
-#include "TRandom3.h"
-
-#include "BaseFitEvt.h"
-
-struct LetterBackronym {
-  LetterBackronym(size_t n, std::string const &b, float p = 1.0,
-                  std::string const &t = "") {
-    NUsed = n;
-    Backkie = b;
-    ProbAccept = p;
-    TagLine = t;
-  };
-  size_t NUsed;
-  float ProbAccept;
-  std::string Backkie;
-  std::string TagLine;
-};
-
-__attribute__((constructor)) void nuisance_init(void) {
-  std::vector<std::vector<LetterBackronym> > Letters;
-
-  for (size_t i = 0; i < 8; ++i) {
-    Letters.push_back(std::vector<LetterBackronym>());
-  }
-
-  Letters[0].push_back(LetterBackronym(2, "Neutrino"));
-  Letters[0].push_back(LetterBackronym(3, "NUIsance", 0.2));
-
-  Letters[2].push_back(LetterBackronym(1, "Interaction"));
-
-  Letters[3].push_back(LetterBackronym(1, "Systematics"));
-  Letters[3].push_back(LetterBackronym(
-      1, "Synthesiser", 0.2, "Playing on the comparisons you want to see"));
-
-  Letters[4].push_back(LetterBackronym(2, "ANalyser"));
-  Letters[4].push_back(LetterBackronym(1, "Aggregating", 0.5));
-  Letters[4].push_back(LetterBackronym(3, "from A-Neutrino sCattering", 1,
-                                       "You can always find a frame"));
-
-  Letters[5].push_back(
-      LetterBackronym(1, "New", 1, "The freshest comparisons"));
-
-  Letters[6].push_back(LetterBackronym(1, "by Comparing"));
-  Letters[6].push_back(LetterBackronym(1, "Constraints from"));
-
-  Letters[7].push_back(LetterBackronym(1, "Experiments"));
-
-  std::vector<std::string> TagLines;
-  TagLines.push_back("Fit and compare.");
-
-  std::stringstream back("");
-
-  TRandom3 tr;
-  tr.SetSeed();
-
-  for (size_t i = 0; i < 8;) {
-    LetterBackronym const &let = Letters[i][tr.Integer(Letters[i].size())];
-    if (tr.Uniform() > let.ProbAccept) {
-      continue;
-    }
-    back << let.Backkie << " ";
-    i += let.NUsed;
-    if (let.TagLine.length()) {
-      TagLines.push_back(let.TagLine);
-    }
-  }
-
-  std::string Name = "Nuisance";
-  std::string TagL = TagLines[tr.Integer(TagLines.size())];
-
-  std::vector<std::pair<std::string, std::pair<std::string, std::string> > >
-      OneBlob;
-
-  OneBlob.push_back(
-      std::make_pair("NUISANCE", std::make_pair("", "FiXing your Neutrinos")));
-
-  if (tr.Uniform() < 0.01) {
-    std::pair<std::string, std::pair<std::string, std::string> > const &blob =
-        OneBlob[tr.Integer(OneBlob.size())];
-    Name = blob.first;
-    back.str("");
-    back << blob.second.first;
-    TagL = blob.second.second;
-  }
-
-  std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
-               "%%%%%%%%%%%%%%%"
-               "%%"
-            << std::endl
-            << "%%  Welcome to " << Name << ": \033[5m" << back.str()
-            << "\033[0m-- " << TagL << std::endl
-            << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
-               "%%%%%%%%%%%%%%%"
-               "%%"
-            << std::endl;
-}
-
-BaseFitEvt::BaseFitEvt() {
-#ifdef __NEUT_ENABLED__
-  fNeutVect = NULL;
-#endif
-
-#ifdef __NUWRO_ENABLED__
-  fNuwroEvent = NULL;
-#endif
-
-#ifdef __GENIE_ENABLED__
-  genie_event = NULL;
-#endif
-
-  fXVar = 0.0;
-  fYVar = 0.0;
-  fZVar = 0.0;
-  Mode = 0;
-  E = 0.0;
-  Weight = 0.0;
-  Signal = false;
-  Index = -1;
-  BinIndex = -1;
-
-  dial_coeff = NULL;
-};
-
-BaseFitEvt::~BaseFitEvt(){};
-
-BaseFitEvt::BaseFitEvt(const BaseFitEvt *obj) {
-  fXVar = obj->fXVar;
-  fYVar = obj->fYVar;
-  fZVar = obj->fZVar;
-  this->Mode = obj->Mode;
-  this->E = obj->E;
-  this->Weight = obj->Weight;
-  this->Signal = obj->Signal;
-  this->Index = obj->Index;
-  this->BinIndex = obj->Index;
-
-#ifdef __NEUT_ENABLED__
-  fNeutVect = obj->fNeutVect;
-#endif
-
-#ifdef __NUWRO_ENABLED__
-  fNuwroEvent = obj->fNuwroEvent;
-#endif
-
-#ifdef __GENIE_ENABLED__
-  genie_event = obj->genie_event;
-#endif
-
-  // Delete own elements
-  if (this->ndial_coeff > 0){
-    this->ndial_coeff = 0;
-    delete this->dial_coeff;
-  }
-  
-  if (obj->ndial_coeff > 0){
-    ndial_coeff = obj->ndial_coeff;
-    dial_coeff = new double[ndial_coeff];
-
-    for (int i = 0; i < ndial_coeff; i++){
-      this->dial_coeff[i] = obj->dial_coeff[i];
-    }
-  }
-};
-
-void BaseFitEvt::ResetDialCoeff(){
-  if (this->ndial_coeff > 0){
-    this->ndial_coeff = 0;
-    delete this->dial_coeff;
-  }
-}
-void BaseFitEvt::CreateDialCoeff(int n){
-  ResetDialCoeff();
-
-  ndial_coeff = n;
-  dial_coeff = new double[ndial_coeff];
-}
-
-void BaseFitEvt::AddSplineCoeffToTree(TTree* tn){
-  tn->Branch("NCoeff",&ndial_coeff,"NCoeff/I");
-  tn->Branch("DialCoeff", dial_coeff, "DialCoeff[NCoeff]/D");
-}
-
-void BaseFitEvt::SetSplineCoeffAddress(TTree* tn){
-
-  tn->SetBranchAddress("NCoeff",&ndial_coeff);
-
-  tn->GetEntry(0);
-  CreateDialCoeff(ndial_coeff);
-  
-  tn->SetBranchAddress("DialCoeff",dial_coeff);
-  
-}
-
-void BaseFitEvt::FillCoeff(double* vals){
-  for (int i = 0; i < ndial_coeff; i++){
-    dial_coeff[i] = vals[i];
-  }
-}
-
-int BaseFitEvt::GetNCoeff(){
-  return ndial_coeff;
-}
-
-double BaseFitEvt::GetCoeff(int i){
-  return dial_coeff[i];
-}
diff --git a/src/FitBase/BaseFitEvt.h b/src/FitBase/BaseFitEvt.h
deleted file mode 100644
index 4cb2104..0000000
--- a/src/FitBase/BaseFitEvt.h
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef FITEVENTBASE_H_SEEN
-#define FITEVENTBASE_H_SEEN
-
-#include "TArrayD.h"
-#include "TLorentzVector.h"
-#include "TSpline.h"
-
-#include "FitParticle.h"
-
-#ifdef __NEUT_ENABLED__
-#include "neutpart.h"
-#include "neutvect.h"
-#endif
-
-#ifdef __NUWRO_ENABLED__
-#include "event1.h"
-#endif
-
-#ifdef __GENIE_ENABLED__
-#include "EVGCore/EventRecord.h"
-#include "GHEP/GHepRecord.h"
-#include "Ntuple/NtpMCEventRecord.h"
-using namespace genie;
-#endif
-
-#ifdef __NUANCE_ENABLED__
-#include "NuanceEvent.h"
-#endif
-
-#include "TArrayD.h"
-
-/*!
- *  \addtogroup FitBase
- *  @{
- */
-
-//! Global Enum to define generator type being read with FitEvent
-// Have to define kNORM as if its a generator for the time being.
-enum generator_event_type {
-  kUNKNOWN = 999,
-  kNEUT = 0,
-  kNIWG = 1,
-  kNUWRO = 2,
-  kT2K = 3,
-  kCUSTOM = 4,
-  kGENIE = 5,
-  kEVTSPLINE = 6,
-  kNUANCE = 7,
-  kGiBUU = 8,
-  kNORM = 9,
-  kMODENORM = 10,
-  kEMPTY = 11,
-  kINPUTFITEVENT = 12
-};
-
-inline std::ostream& operator<<(std::ostream& os,
-                                generator_event_type const& gs) {
-  switch (gs) {
-    case kUNKNOWN: {
-      return os << "kUNKNOWN";
-    }
-    case kNEUT: {
-      return os << "kNEUT";
-    }
-    case kNIWG: {
-      return os << "kNIWG";
-    }
-    case kNUWRO: {
-      return os << "kNUWRO";
-    }
-    case kT2K: {
-      return os << "kT2K";
-    }
-    case kCUSTOM: {
-      return os << "kCUSTOM";
-    }
-    case kGENIE: {
-      return os << "kGENIE";
-    }
-    case kEVTSPLINE: {
-      return os << "kEVTSPLINE";
-    }
-    case kNUANCE: {
-      return os << "kNUANCE";
-    }
-    case kGiBUU: {
-      return os << "kGiBUU";
-    }
-    case kNORM: {
-      return os << "kNORM";
-    }
-    case kMODENORM: {
-      return os << "kMODENORM";
-    }
-    default: { return os << "kUNKNOWN"; }
-  }
-}
-
-//! Base Event Class used to store just the generator event pointers and flat
-//! variables
-class BaseFitEvt {
- public:
-  BaseFitEvt();
-  ~BaseFitEvt();
-  BaseFitEvt(const BaseFitEvt* obj);
-
-  inline void SetType(int type){fType = type;};
-  
-  double fXVar;
-  double fYVar;
-  double fZVar;
-  int Mode;
-  double E;
-  double Weight;
-  double InputWeight;
-  double RWWeight;
-  double CustomWeight;
-  bool Signal;
-  UInt_t Index;
-  UInt_t BinIndex;
-  UInt_t fType;
-
-  double* dial_coeff;
-  int ndial_coeff;
-
-  void ResetDialCoeff();
-  void CreateDialCoeff(int n);
-  void FillCoeff(double* vals);
-  int GetNCoeff();
-  double GetCoeff(int i);
-  
-// NEUT : Default
-#ifdef __NEUT_ENABLED__
-  NeutVect* fNeutVect;  //!< Pointer to Neut Vector
-#endif
-
-// NUWRO
-#ifdef __NUWRO_ENABLED__
-  event* fNuwroEvent;  //!< Pointer to Nuwro event
-#endif
-
-// GENIE
-#ifdef __GENIE_ENABLED__
-  NtpMCEventRecord* genie_event;  //!< Pointer to NTuple Genie Event
-  GHepRecord* genie_record;  //!< Pointer to actually accessible Genie Record
-#endif
-
-// NUANCE
-#ifdef __NUANCE_ENABLED__
-  NuanceEvent* nuance_event;
-#endif
-
-// GiBUU
-#ifdef __GiBUU_ENABLED__
-  GiBUUStdHepReader* GiRead;
-#endif
-
-  void AddSplineCoeffToTree(TTree* tn);
-  void SetSplineCoeffAddress(TTree* tn);
-  
-  double GetWeight() { return InputWeight * RWWeight * CustomWeight; };
-};
-#endif
diff --git a/src/FitBase/CMakeLists.txt b/src/FitBase/CMakeLists.txt
index 89f6e00..b4c7df3 100644
--- a/src/FitBase/CMakeLists.txt
+++ b/src/FitBase/CMakeLists.txt
@@ -1,72 +1,83 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 ParamPull.cxx
-BaseFitEvt.cxx
-FitParticle.cxx
-FitWeight.cxx
-Measurement1D.cxx
 EventManager.cxx
-InputHandler.cxx
+Measurement1D.cxx
 Measurement2D.cxx
-FitEvent.cxx
 JointMeas1D.cxx
 MeasurementBase.cxx
-GeneratorUtils.cxx
-StdHepEvt.cxx
 TemplateMeas1D.cxx
-InputUtils.cxx
+SampleSettings.cxx
+MeasurementVariableBox.cxx
+MeasurementVariableBox2D.cxx
+MeasurementVariableBox1D.cxx
+CustomVariableBoxes.h
 )
 
 set(HEADERFILES
 ParamPull.h
-NuanceEvent.h
-BaseFitEvt.h    FitEvent.h     JointMeas1D.h    Measurement2D.h
-EventManager.h  FitParticle.h  FitWeight.h      MeasurementBase.h
-InputHandler.h   Measurement1D.h GeneratorUtils.h StdHepEvt.h TemplateMeas1D.h
-InputUtils.h
+JointMeas1D.h    
+Measurement2D.h
+EventManager.h
+MeasurementBase.h   
+Measurement1D.h 
+TemplateMeas1D.h
+SampleSettings.h
+MeasurementVariableBox.h
+MeasurementVariableBox2D.h
+MeasurementVariableBox1D.h
+CustomVariableBoxes.h
 )
 
 set(LIBNAME FitBase)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
+if (USE_GENIE)
+   include_directories(${GENIE_INCLUDES}/Apps)
+   include_directories(${GENIE_INCLUDES}/FluxDrivers)
+   include_directories(${GENIE_INCLUDES}/EVGDrivers)
+endif()
+
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/FitBase/CustomVariableBoxes.h b/src/FitBase/CustomVariableBoxes.h
new file mode 100644
index 0000000..8bb8b41
--- /dev/null
+++ b/src/FitBase/CustomVariableBoxes.h
@@ -0,0 +1,21 @@
+#ifndef CUSTOM_VARIABLES_BOX_H
+#define CUSTOM_VARIABLES_BOX_H
+
+#include "MeasurementVariableBox.h"
+#include "MeasurementVariableBox1D.h"
+#include "MeasurementVariableBox2D.h"
+
+/*!
+ *  \addtogroup FitBase
+ *  @{
+ */
+
+/// Custom box used to also save Q2 for each event.
+class Q2VariableBox1D : public MeasurementVariableBox1D {
+public:
+	inline Q2VariableBox1D() { Reset(); };
+	inline void Reset() {	fQ2 = -999.9; }
+	double fQ2;
+};
+
+#endif
diff --git a/src/FitBase/EventManager.cxx b/src/FitBase/EventManager.cxx
index 3c3b88e..b159527 100644
--- a/src/FitBase/EventManager.cxx
+++ b/src/FitBase/EventManager.cxx
@@ -1,131 +1,142 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "EventManager.h"
 
 EventManager* EventManager::m_evtmgrInstance = NULL;
 
 EventManager& EventManager::Get(void) {
   if (!m_evtmgrInstance) {
     m_evtmgrInstance = new EventManager;
   }
   return *m_evtmgrInstance;
 }
 
 FitWeight* EventManager::GetRW() { return fRW; };
 
-InputHandler* EventManager::GetInput(int infile) { return finputs[infile]; };
+InputHandlerBase* EventManager::GetInput(int infile) { return finputs[infile]; };
 
 FitEvent* EventManager::GetEvent(int infile, int i) {
+  /*
   finputs[infile]->ReadEvent(i);
   FitEvent* evtpt = finputs[infile]->GetEventPointer();
 
   // If we don't need a full reweight
   if (!frwneeded[infile][i]) {
     evtpt->Weight = calc_rw[infile][i];
 
     // if we do need a full reweight
   } else {
     evtpt->RWWeight = fRW->CalcWeight(evtpt);
     evtpt->Weight = evtpt->RWWeight * evtpt->InputWeight;
 
     calc_rw[infile][i] = evtpt->Weight;
     frwneeded[infile][i] = false;
   }
-
-  return evtpt;
+*/
+  return NULL;
 }
 
 double EventManager::GetEventWeight(int infile, int i) {
+  /*
   if (!frwneeded[infile][i]) {
     return calc_rw[infile][i];
   }
 
   finputs[infile]->GetTreeEntry(i);
   FitEvent* evtpt = finputs[infile]->GetEventPointer();
   double Weight = fRW->CalcWeight(evtpt) * evtpt->InputWeight;
 
   calc_rw[infile][i] = Weight;
   frwneeded[infile][i] = false;
-
+*/
+  double Weight = 1.0;
   return Weight;
 }
 
-std::map<int, InputHandler*> EventManager::GetInputs() { return finputs; }
+std::map<int, InputHandlerBase*> EventManager::GetInputs() { return finputs; }
 
-InputHandler* EventManager::AddInput(std::string handle, std::string infile) {
+InputHandlerBase* EventManager::AddInput(std::string handle, std::string infile) {
 
   // Expect INPUTTYPE:FileLocation(s)
   std::vector<std::string> file_descriptor =
       GeneralUtils::ParseToStr(infile, ":");
   if (file_descriptor.size() != 2) {
     ERR(FTL) << "File descriptor had no filetype declaration: \"" << infile
              << "\". expected \"FILETYPE:file.root\"" << std::endl;
     throw;
   }
   InputUtils::InputType inpType =
       InputUtils::ParseInputType(file_descriptor[0]);
 
   int id = GetInputID(file_descriptor[1]);
   if ((uint)id != fid.size()) {
-    LOG(SAM) << "Event manager already contains this input."
+    LOG(SAM) << "Event manager already contains " << file_descriptor[1] 
              << std::endl;
     return finputs[id];
-  } else {
-    LOG(SAM) << "Adding input " << file_descriptor[1] << std::endl;
-  }
+  } 
 
   fid[file_descriptor[1]] = id;
-  finputs[id] = new InputHandler(handle, inpType, file_descriptor[1]);
+  finputs[id] = InputUtils::CreateInputHandler(handle, inpType, file_descriptor[1]);
   frwneeded[id] = std::vector<bool>(finputs[id]->GetNEvents(), true);
   calc_rw[id] = std::vector<double>(finputs[id]->GetNEvents(), 0.0);
+  
+  LOG(SAM) << "Registered " << handle << " with EventManager." << std::endl;
+
   return finputs[id];
 }
 
 // Reset the weight flags
 // Should be called for every succesful event loop
 void EventManager::ResetWeightFlags() {
+  /*
   // Loop over the inpts
   for (std::map<int, InputHandler*>::iterator iter = finputs.begin();
        iter != finputs.end(); iter++) {
     int id = iter->first;
     frwneeded[id].clear();
     // Reset so that all events need the reweight
     frwneeded[id] = std::vector<bool>(finputs[id]->GetNEvents(), true);
   }
+  */
 }
 
 EventManager::EventManager() {
   fRW = new FitWeight("FitWeight");
   finputs.clear();
 };
 
 EventManager::~EventManager() {
   delete fRW;
   finputs.clear();
 };
 
 int EventManager::GetInputID(std::string infile) {
   if (fid.find(infile) == fid.end()) {
     return fid.size();
   }
 
   return fid[infile];
 }
 
+void EventManager::SetRW(FitWeight* rw){
+  fRW = rw;
+}
+
+
diff --git a/src/FitBase/EventManager.h b/src/FitBase/EventManager.h
index 29af09a..d3df579 100644
--- a/src/FitBase/EventManager.h
+++ b/src/FitBase/EventManager.h
@@ -1,73 +1,76 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef EVENTMANAGER_H
 #define EVENTMANAGER_H
 
 #include "InputHandler.h"
 #include "FitWeight.h"
-
+#include "InputUtils.h"
+#include "InputFactory.h"
 // This class is menat to manage one input file for many distributions
 class EventManager {
  public:
   static EventManager& Get(void);
 
   FitWeight* GetRW();
-  InputHandler* GetInput(int id);
+  void SetRW(FitWeight* rw);
+
+  InputHandlerBase* GetInput(int id);
   FitEvent* GetEvent(int id, int i);
   double GetEventWeight(int id, int i);
-  InputHandler* AddInput(std::string handle, std::string infile);
+  InputHandlerBase* AddInput(std::string handle, std::string infile);
   void ResetWeightFlags();
   int GetInputID(std::string infile);
 
-  std::map< int, InputHandler* > GetInputs();
+  std::map< int, InputHandlerBase* > GetInputs();
 
  protected:
   EventManager();
   ~EventManager();
 
   static EventManager* m_evtmgrInstance;
 
   FitWeight* fRW;
   std::map< std::string, int > fid;
-  std::map< int, InputHandler* > finputs;
+  std::map< int, InputHandlerBase* > finputs;
   std::map< int, std::vector< bool > > frwneeded;
   std::map< int, std::vector< double > > calc_rw;
 
-
-
 };
 
 
 namespace FitBase {
 
   inline
   EventManager& EvtManager(){ return EventManager::Get(); };
   inline
   FitWeight* GetRW(){ return EvtManager().GetRW(); };
   inline
+  void SetRW(FitWeight* rw){ EvtManager().SetRW(rw); };
+  inline
   int GetInputID(std::string infile){ return EvtManager().GetInputID(infile); };
   inline
-  InputHandler* GetInput(int infile){ return EvtManager().GetInput(infile); };
+  InputHandlerBase* GetInput(int infile){ return EvtManager().GetInput(infile); };
   inline
-  InputHandler* AddInput(std::string handle, std::string infile){ return EvtManager().AddInput(handle, infile); };
+  InputHandlerBase* AddInput(std::string handle, std::string infile){ return EvtManager().AddInput(handle, infile); };
 
 
 }
 #endif
diff --git a/src/FitBase/FitEvent.cxx b/src/FitBase/FitEvent.cxx
deleted file mode 100644
index b36978c..0000000
--- a/src/FitBase/FitEvent.cxx
+++ /dev/null
@@ -1,912 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-#include "FitEvent.h"
-#include <iostream>
-#include "TObjArray.h"
-
-#ifdef __GENIE_ENABLED__
-#include "Conventions/Units.h"
-#endif
-
-//***************************************************
-// Refill all the particle vectors etc for the event
-void FitEvent::CalcKinematics() {
-//***************************************************
-// HELLO SUBLIME
-
-#ifdef __NEUT_ENABLED__
-  if (fType == kNEUT) NeutKinematics();
-#endif
-
-#ifdef __NUWRO_ENABLED__
-  if (fType == kNUWRO) NuwroKinematics();
-#endif
-
-#ifdef __GENIE_ENABLED__
-  if (fType == kGENIE) GENIEKinematics();
-#endif
-
-#ifdef __NUANCE_ENABLED__
-  if (fType == kNUANCE) NuanceKinematics();
-#endif
-
-#ifdef __GiBUU_ENABLED__
-  if (fType == kGiBUU) GiBUUKinematics();
-#endif
-
-  return;
-};
-
-//***************************************************
-void FitEvent::ResetEvent() {
-  //***************************************************
-
-  // Sort Event Info
-  fMode = 9999;
-  Mode = 9999;
-  fEventNo = -1;
-  fTotCrs = -1.0;
-  fTargetA = -1;
-  fTargetZ = -1;
-  fTargetH = -1;
-  fBound = false;
-  fNParticles = 0;
-
-  for (unsigned int i = 0; i < kMaxParticles; i++) {
-    FitParticle* fp = fParticleList[i];
-    if (fp) delete fp;
-    fParticleList[i] = NULL;
-  }
-}
-
-// NEUT GENERATOR SPECIFIC
-#ifdef __NEUT_ENABLED__
-//***************************************************
-void FitEvent::SetEventAddress(NeutVect** tempevent) {
-//***************************************************
-
-  save_neut_status = FitPar::Config().GetParB("save_neut_status");
-  fType = kNEUT;
-  fNeutVect = *tempevent;
-}
-
-//***************************************************
-void FitEvent::NeutKinematics() {
-  //***************************************************
-  ResetEvent();
-
-
-  // Get Event Info
-  fMode = fNeutVect->Mode;
-  Mode = fNeutVect->Mode;
-  fEventNo = fNeutVect->EventNo;
-  fTotCrs = fNeutVect->Totcrs;
-  fTargetA = fNeutVect->TargetA;
-  fTargetZ = fNeutVect->TargetZ;
-  fTargetH = fNeutVect->TargetH;
-  fBound = bool(fNeutVect->Ibound);
-
-  // Check Particle Stack
-  UInt_t npart = fNeutVect->Npart();
-  if (npart > kMaxParticles) {
-    ERR(FTL) << "NEUT has too many particles" << std::endl;
-    ERR(FTL) << "npart=" << npart << " kMax=" << kMaxParticles << std::endl;
-    throw;
-  }
-
-  // Fill Particle Stack
-  fNParticles = 0;
-
-  for (UInt_t i = 0; i < npart; i++) {
-    NeutPart* part = fNeutVect->PartInfo(i);
-
-    // State
-    int state = kUndefinedState;
-    // fStatus == -1 means initial  state
-    if (part->fIsAlive == false && part->fStatus == -1) {
-      state = kInitialState;
-
-      // NEUT has a bit of a strange convention for fIsAlive and fStatus
-      // combinations
-      // for NC and neutrino particle isAlive true/false and status 2 means
-      // final state particle
-      // for other particles in NC status 2 means it's an FSI particle
-      // for CC it means it was an FSI particle
-    } else if (part->fStatus == 2) {
-      // NC case is a little strange... The outgoing neutrino might be alive or
-      // not alive. Remaining particles with status 2 are FSI particles that
-      // reinteracted
-      if (abs(fNeutVect->Mode) > 30 &&
-          (abs(part->fPID) == 14 || abs(part->fPID) == 12)) {
-        state = kFinalState;
-        // The usual CC case
-      } else if (part->fIsAlive == true) {
-        state = kFSIState;
-      }
-    } else if (part->fIsAlive == true && part->fStatus == 2 &&
-               (abs(part->fPID) == 14 || abs(part->fPID) == 12)) {
-      state = kFinalState;
-
-    } else if (part->fIsAlive == true && part->fStatus == 0) {
-      state = kFinalState;
-
-    } else if (part->fIsAlive == true) {
-      ERR(WRN) << "Undefined NEUT state "
-               << " Alive: " << part->fIsAlive << " Status: " << part->fStatus
-               << " PDG: " << part->fPID << std::endl;
-      throw;
-    }
-
-    // Remove Undefined
-    //    if (kRemoveUndefParticles &&
-    //  state == kUndefinedState) continue;
-
-    // Remove FSI
-    //    if (kRemoveFSIParticles &&
-    //  state == kFSIState) continue;
-
-    fParticleState[fNParticles] = state;
-
-    // Mom
-    fParticleMom[fNParticles][0] = part->fP.X();
-    fParticleMom[fNParticles][1] = part->fP.Y();
-    fParticleMom[fNParticles][2] = part->fP.Z();
-    fParticleMom[fNParticles][3] = part->fP.T();
-
-    //    if (save_neut_status){
-    fParticleNEUTStatus[fNParticles] = part->fStatus;
-    fParticleNEUTAlive[fNParticles] = part->fIsAlive;;
-      //    }
-
-    // PDG
-    fParticlePDG[fNParticles] = part->fPID;
-
-    fNParticles++;
-  }
-
-  //  OrderStack();
-
-  return;
-};
-#endif
-
-// NUWRO GENERATOR SPECIFIC
-#ifdef __NUWRO_ENABLED__
-//***************************************************
-void FitEvent::SetEventAddress(event** tempevent) {
-  //***************************************************
-  fType = kNUWRO;
-  fNuwroEvent = *(tempevent);
-  return;
-}
-//***************************************************
-void FitEvent::NuwroKinematics() {
-  //***************************************************
-  ResetEvent();
-
-  // Sort Event Info
-  fMode = GeneratorUtils::ConvertNuwroMode(fNuwroEvent);
-  Mode = fMode;
-  fEventNo = 0.0;
-  fTotCrs = 0.0;
-  fTargetA = fNuwroEvent->par.nucleus_p + fNuwroEvent->par.nucleus_n;
-  fTargetZ = fNuwroEvent->par.nucleus_p;
-  fTargetH = 0;
-  fBound = (fTargetA) == 1;
-
-  // Check Particle Stack
-  UInt_t npart_in = fNuwroEvent->in.size();
-  UInt_t npart_out = fNuwroEvent->out.size();
-  UInt_t npart_post = fNuwroEvent->post.size();
-  UInt_t npart = npart_in + npart_out + npart_post;
-
-  if (npart > kMaxParticles) {
-    ERR(FTL) << "NUWRO has too many particles" << std::endl;
-    ERR(FTL) << "npart=" << npart << " kMax=" << kMaxParticles
-             << " in,out,post = " << npart_in << "," << npart_out << ","
-             << npart_post << std::endl;
-    throw;
-  }
-
-  // Incoming Particles
-  fNParticles = 0;
-
-  for (UInt_t i = 0; i < npart_in; i++) {
-    particle* part = &fNuwroEvent->in[i];
-
-    fParticleMom[fNParticles][0] = part->p4().x;
-    fParticleMom[fNParticles][1] = part->p4().y;
-    fParticleMom[fNParticles][2] = part->p4().z;
-    fParticleMom[fNParticles][3] = part->p4().t;
-
-    fParticleState[fNParticles] = kInitialState;
-    fParticlePDG[fNParticles] = part->pdg;
-    fNParticles++;
-  }
-
-  // FSI Particles
-  if (!kRemoveFSIParticles) {
-    for (UInt_t i = 0; i < npart_out; i++) {
-      particle* part = &fNuwroEvent->out[i];
-
-      fParticleMom[fNParticles][0] = part->p4().x;
-      fParticleMom[fNParticles][1] = part->p4().y;
-      fParticleMom[fNParticles][2] = part->p4().z;
-      fParticleMom[fNParticles][3] = part->p4().t;
-
-      fParticleState[fNParticles] = kFSIState;
-      fParticlePDG[fNParticles] = part->pdg;
-      fNParticles++;
-    }
-  }
-
-  // Final Particles
-  for (UInt_t i = 0; i < npart_post; i++) {
-    particle* part = &fNuwroEvent->post[i];
-
-    fParticleMom[fNParticles][0] = part->p4().x;
-    fParticleMom[fNParticles][1] = part->p4().y;
-    fParticleMom[fNParticles][2] = part->p4().z;
-    fParticleMom[fNParticles][3] = part->p4().t;
-
-    fParticleState[fNParticles] = kFinalState;
-    fParticlePDG[fNParticles] = part->pdg;
-    fNParticles++;
-  }
-
-  OrderStack();
-  return;
-};
-#endif  //< NuWro ifdef
-
-// REQUIRED FUNCTIONS FOR GENIE
-#ifdef __GENIE_ENABLED__
-//***************************************************
-void FitEvent::SetEventAddress(NtpMCEventRecord** tempevent) {
-  //***************************************************
-  fType = kGENIE;
-  genie_event = *tempevent;
-};
-
-//***************************************************
-void FitEvent::GENIEKinematics() {
-//***************************************************
-  ResetEvent();
-
-  if (!genie_event) return;
-  if (!genie_event->event) return;
-
-  genie_record = static_cast<GHepRecord*>(genie_event->event);
-
-  // Extra Check for MEC
-  if (genie_record->Summary()->ProcInfo().IsMEC()) {
-    if (pdg::IsNeutrino(genie_record->Summary()->InitState().ProbePdg()))
-      fMode = 2;
-    else if (pdg::IsAntiNeutrino(
-                 genie_record->Summary()->InitState().ProbePdg()))
-      fMode = -2;
-  } else {
-    fMode = utils::ghep::NeutReactionCode(genie_record);
-  }
-
-  // Set Event Info
-  Mode = fMode;
-  fEventNo = 0.0;
-  fTotCrs = genie_record->XSec();
-  fTargetA = 0.0;
-  fTargetZ = 0.0;
-  fTargetH = 0;
-  fBound = 0.0;
-  InputWeight = (1E+38 / genie::units::cm2) * genie_record->XSec();
-
-  // Get N Particle Stack
-  unsigned int npart = genie_record->GetEntries();
-  if (npart > kMaxParticles) {
-    ERR(FTL) << "GENIE has too many particles" << std::endl;
-    ERR(FTL) << "npart=" << npart << " kMax=" << kMaxParticles << std::endl;
-
-    throw;
-  }
-
-  // Fill Particle Stack
-  GHepParticle* p = 0;
-  TObjArrayIter iter(genie_record);
-
-  fNParticles = 0;
-
-  /*
-    kIStUndefined                  = -1,
-    kIStInitialState               =  0,   / generator-level initial state /
-    kIStStableFinalState           =  1,   / generator-level final state:
-    particles to be tracked by detector-level MC /
-    kIStIntermediateState          =  2,
-    kIStDecayedState               =  3,
-    kIStCorrelatedNucleon          = 10,
-    kIStNucleonTarget              = 11,
-    kIStDISPreFragmHadronicState   = 12,
-    kIStPreDecayResonantState      = 13,
-    kIStHadronInTheNucleus         = 14,   / hadrons inside the nucleus: marked
-    for hadron transport modules to act on /
-    kIStFinalStateNuclearRemnant   = 15,   / low energy nuclear fragments
-    entering the record collectively as a 'hadronic blob' pseudo-particle /
-    kIStNucleonClusterTarget       = 16,   // for composite nucleons before
-    phase space decay
-  */
-
-  // Loop over all particles
-  while ((p = (dynamic_cast<genie::GHepParticle*>((iter).Next())))) {
-    if (!p) continue;
-
-    // State
-    int state = kUndefinedState;
-    switch (p->Status()) {
-      case genie::kIStNucleonTarget:
-      case genie::kIStInitialState:
-      case genie::kIStCorrelatedNucleon:
-      case genie::kIStNucleonClusterTarget:
-        state = kInitialState;
-        break;
-
-      case genie::kIStStableFinalState:
-        state = kFinalState;
-        break;
-
-      case genie::kIStHadronInTheNucleus:
-        if (abs(fMode) == 2)
-          state = kInitialState;
-        else
-          state = kFSIState;
-        break;
-
-      case genie::kIStPreDecayResonantState:
-      case genie::kIStDISPreFragmHadronicState:
-      case genie::kIStIntermediateState:
-        state = kFSIState;
-        break;
-
-      case genie::kIStFinalStateNuclearRemnant:
-      case genie::kIStUndefined:
-      case genie::kIStDecayedState:
-      default:
-        break;
-    }
-
-    // Flag to remove nuclear part in genie
-    if (p->Pdg() > 1000000) {
-      if (state == kInitialState)
-        state = kNuclearInitial;
-      else if (state == kFinalState)
-        state = kNuclearRemnant;
-    }
-
-    // if (kRemoveGenieNuclear &&
-    //    (state == kNuclearInitial || state == kNuclearRemnant)){
-    //  continue;
-    //}
-
-    // Remove Undefined
-    // if (kRemoveUndefParticles &&
-    //  state == kUndefinedState) continue;
-
-    // Remove FSI
-    // if (kRemoveFSIParticles &&
-    //  state == kFSIState) continue;
-
-    fParticleState[fNParticles] = state;
-
-    // Mom
-    fParticleMom[fNParticles][0] = p->Px() * 1.E3;
-    fParticleMom[fNParticles][1] = p->Py() * 1.E3;
-    fParticleMom[fNParticles][2] = p->Pz() * 1.E3;
-    fParticleMom[fNParticles][3] = p->E() * 1.E3;
-
-    // PDG
-    fParticlePDG[fNParticles] = p->Pdg();
-
-    fNParticles++;
-
-    if (fNParticles == kMaxParticles) break;
-  }
-
-  OrderStack();
-
-  LOG(DEB) << "GENIE Particle Stack" << std::endl;
-  for (int i = 0; i < fNParticles; i++) {
-    LOG(DEB) << "Particle " << i << ". " << fParticlePDG[i] << " "
-             << fParticleMom[i][0] << " " << fParticleMom[i][1] << " "
-             << fParticleMom[i][2] << " " << fParticleMom[i][3] << " "
-             << fParticleState[i] << std::endl;
-  }
-
-  return;
-};
-#endif  //< GENIE ifdef
-
-// REQUIRED FUNCTIONS FOR GIBUU
-#ifdef __GiBUU_ENABLED__
-//***************************************************
-void FitEvent::SetEventAddress(GiBUUStdHepReader* tempevent) {
-  //***************************************************
-  fType = kGiBUU;
-  GiRead = tempevent;
-}
-
-//***************************************************
-void FitEvent::GiBUUKinematics() {
-  //***************************************************
-  ResetEvent();
-
-  LOG(DEB) << "Reading GiBUU Event: " << std::endl;
-  LOG(DEB) << WriteGiBUUEvent(*GiRead) << std::endl;
-
-  fMode = GiRead->GiBUU2NeutCode;
-  Mode = fMode;
-  fEventNo = 0.0;
-  fTotCrs = 0;
-  fTargetA = 0.0;
-  fTargetZ = 0.0;
-  fTargetH = 0;
-  fBound = 0.0;
-
-  // Extra GiBUU Input Weight
-  InputWeight = GiRead->EvtWght;
-
-  // Check Stack N
-  int npart = GiRead->StdHepN;
-  if ((uint)npart > kMaxParticles) {
-    ERR(FTL) << "GiBUU has too many particles" << std::endl;
-    ERR(FTL) << "npart=" << npart << " kMax=" << kMaxParticles << std::endl;
-    throw;
-  }
-
-  // Create Stack
-  fNParticles = 0;
-  for (int i = 0; i < npart; i++) {
-    // State
-    int state = kUndefinedState;
-
-    switch (GiRead->StdHepStatus[i]) {
-      case 0:   // Incoming
-      case 11:  // Struck nucleon
-        state = kInitialState;
-        break;
-
-      case 1:  // Good Final State
-        state = kFinalState;
-        break;
-
-      default:  // Other
-        break;
-    }
-
-    // Set Nuclear States Flag
-    if (GiRead->StdHepPdg[i] > 1000000) {
-      if (state == kInitialState)
-        state = kNuclearInitial;
-      else if (state == kFinalState)
-        state = kNuclearRemnant;
-      continue;
-    }
-
-    // Remove Nuclear States
-    // if (kRemoveGiBUUNuclear &&
-    //  (state == kNuclearInitial || state == kNuclearRemnant)){
-    //  continue;
-    //}
-
-    // Remove Undefined
-    //  if (kRemoveUndefParticles &&
-    //  state == kUndefinedState) continue;
-
-    // Remove FSI
-    //    if (kRemoveFSIParticles &&
-    //      state == kFSIState) continue;
-
-    // Set State
-    fParticleState[fNParticles] = state;
-
-    // Mom
-    fParticleMom[fNParticles][0] = GiRead->StdHepP4[i][0] * 1.E3;
-    fParticleMom[fNParticles][1] = GiRead->StdHepP4[i][1] * 1.E3;
-    fParticleMom[fNParticles][2] = GiRead->StdHepP4[i][2] * 1.E3;
-    fParticleMom[fNParticles][3] = GiRead->StdHepP4[i][3] * 1.E3;
-
-    // PDG
-    fParticlePDG[fNParticles] = GiRead->StdHepPdg[i];
-
-    fNParticles++;
-  }
-
-  OrderStack();
-
-  LOG(DEB) << "GiBUU Particle Stack" << std::endl;
-  for (int i = 0; i < fNParticles; i++) {
-    LOG(DEB) << "Particle " << i << ". " << fParticlePDG[i] << " "
-             << fParticleMom[i][0] << " " << fParticleMom[i][1] << " "
-             << fParticleMom[i][2] << " " << fParticleMom[i][3] << " "
-             << fParticleState[i] << std::endl;
-  }
-}
-#endif  //< GiBUU ifdef
-
-//***************************************************
-void FitEvent::OrderStack() {
-  //***************************************************
-
-  // Copy current stack
-  int oldpartpdg[kMaxParticles];
-  int oldpartstate[kMaxParticles];
-  double oldpartmom[kMaxParticles][4];
-  int npart = fNParticles;
-
-  for (int i = 0; i < npart; i++) {
-    oldpartpdg[i] = fParticlePDG[i];
-    oldpartstate[i] = fParticleState[i];
-    oldpartmom[i][0] = fParticleMom[i][0];
-    oldpartmom[i][1] = fParticleMom[i][1];
-    oldpartmom[i][2] = fParticleMom[i][2];
-    oldpartmom[i][3] = fParticleMom[i][3];
-  }
-
-  // Now run loops for each particle
-  fNParticles = 0;
-  int stateorder[6] = {kInitialState,   kFinalState,     kFSIState,
-                       kNuclearInitial, kNuclearRemnant, kUndefinedState};
-
-  for (int s = 0; s < 6; s++) {
-    for (int i = 0; i < npart; i++) {
-      if (oldpartstate[i] != stateorder[s]) continue;
-
-      fParticlePDG[fNParticles] = oldpartpdg[i];
-      fParticleState[fNParticles] = oldpartstate[i];
-      fParticleMom[fNParticles][0] = oldpartmom[i][0];
-      fParticleMom[fNParticles][1] = oldpartmom[i][1];
-      fParticleMom[fNParticles][2] = oldpartmom[i][2];
-      fParticleMom[fNParticles][3] = oldpartmom[i][3];
-
-      fNParticles++;
-    }
-  }
-
-  LOG(DEB) << "Ordered stack" << std::endl;
-  for (int i = 0; i < fNParticles; i++) {
-    LOG(DEB) << "Particle " << i << ". " << fParticlePDG[i] << " "
-             << fParticleMom[i][0] << " " << fParticleMom[i][1] << " "
-             << fParticleMom[i][2] << " " << fParticleMom[i][3] << " "
-             << fParticleState[i] << std::endl;
-  }
-
-  if (fNParticles != npart) {
-    ERR(FTL) << "Dropped some particles when ordering the stack!" << std::endl;
-  }
-
-  return;
-}
-
-// REQUIRED FUNCTIONS FOR NUANCE
-#ifdef __NUANCE_ENABLED__
-//***************************************************
-void FitEvent::SetEventAddress(NuanceEvent** tempevent) {
-  //***************************************************
-  fType = kNUANCE;
-  nuance_event = *tempevent;
-}
-
-//***************************************************
-void FitEvent::NuanceKinematics() {
-  //***************************************************
-  ResetEvent();
-
-  fMode = GeneratorUtils::ConvertNuanceMode(nuance_event);
-  Mode = fMode;
-  fEventNo = 0.0;
-  fTotCrs = 1.0;
-  fTargetA = 0.0;
-  fTargetZ = 0.0;
-  fTargetH = 0;
-  fBound = 0.0;
-
-  // Fill particle Stack
-  fNParticles = 0;
-
-  // Check Particle Stack
-  UInt_t npart = 2 + nuance_event->n_leptons + nuance_event->n_hadrons;
-
-  if (npart > kMaxParticles) {
-    ERR(FTL) << "NUANCE has too many particles" << std::endl;
-    ERR(FTL) << "npart=" << npart << " kMax=" << kMaxParticles << std::endl;
-    throw;
-  }
-
-  // Fill Neutrino
-  fParticleState[0] = kInitialState;
-  fParticleMom[0][0] = nuance_event->p_neutrino[0];
-  fParticleMom[0][1] = nuance_event->p_neutrino[1];
-  fParticleMom[0][2] = nuance_event->p_neutrino[2];
-  fParticleMom[0][3] = nuance_event->p_neutrino[3];
-  fParticlePDG[0] = nuance_event->neutrino;
-
-  // Fill Target Nucleon
-  fParticleState[1] = kInitialState;
-  fParticleMom[1][0] = nuance_event->p_targ[0];
-  fParticleMom[1][1] = nuance_event->p_targ[1];
-  fParticleMom[1][2] = nuance_event->p_targ[2];
-  fParticleMom[1][3] = nuance_event->p_targ[3];
-  fParticlePDG[1] = nuance_event->target;
-  fNParticles = 2;
-
-  // Fill Outgoing Leptons
-  for (int i = 0; i < nuance_event->n_leptons; i++) {
-    fParticleState[fNParticles] = kFinalState;
-    fParticleMom[fNParticles][0] = nuance_event->p_lepton[i][0];
-    fParticleMom[fNParticles][1] = nuance_event->p_lepton[i][1];
-    fParticleMom[fNParticles][2] = nuance_event->p_lepton[i][2];
-    fParticleMom[fNParticles][3] = nuance_event->p_lepton[i][3];
-    fParticlePDG[fNParticles] = nuance_event->lepton[i];
-    fNParticles++;
-  }
-
-  // Fill Outgoing Hadrons
-  for (int i = 0; i < nuance_event->n_hadrons; i++) {
-    fParticleState[fNParticles] = kFinalState;
-    fParticleMom[fNParticles][0] = nuance_event->p_hadron[i][0];
-    fParticleMom[fNParticles][1] = nuance_event->p_hadron[i][1];
-    fParticleMom[fNParticles][2] = nuance_event->p_hadron[i][2];
-    fParticleMom[fNParticles][3] = nuance_event->p_hadron[i][3];
-    fParticlePDG[fNParticles] = nuance_event->hadron[i];
-    fNParticles++;
-  }
-}
-#endif
-
-/* Read/Write own event class */
-void FitEvent::SetBranchAddress(TChain* tn) {
-  fType = kINPUTFITEVENT;
-
-  tn->SetBranchAddress("Mode", &fMode);
-  tn->SetBranchAddress("Mode", &Mode);
-  tn->SetBranchAddress("EventNo", &fEventNo);
-  tn->SetBranchAddress("TotCrs", &fTotCrs);
-  tn->SetBranchAddress("TargetA", &fTargetA);
-  tn->SetBranchAddress("TargetH", &fTargetH);
-  tn->SetBranchAddress("Bound", &fBound);
-
-  tn->SetBranchAddress("InputWeight", &InputWeight);
-
-  tn->SetBranchAddress("NParticles", &fNParticles);
-  tn->SetBranchAddress("ParticleState", fParticleState);
-  tn->SetBranchAddress("ParticlePDG", fParticlePDG);
-  tn->SetBranchAddress("ParticleMom", fParticleMom);
-}
-
-void FitEvent::AddBranchesToTree(TTree* tn) {
-  tn->Branch("Mode", &fMode, "Mode/I");
-  tn->Branch("EventNo", &fEventNo, "EventNo/i");
-  tn->Branch("TotCrs", &fTotCrs, "TotCrs/D");
-  tn->Branch("TargetA", &fTargetA, "TargetA/I");
-  tn->Branch("TargetH", &fTargetH, "TargetH/I");
-  tn->Branch("Bound", &fBound, "Bound/O");
-
-  tn->Branch("InputWeight", &InputWeight, "InputWeight/D");
-
-  tn->Branch("NParticles", &fNParticles, "NParticles/I");
-  tn->Branch("ParticleState", fParticleState, "ParticleState[NParticles]/i");
-  tn->Branch("ParticlePDG", fParticlePDG, "ParticlePDG[NParticles]/I");
-  tn->Branch("ParticleMom", fParticleMom, "ParticleMom[NParticles][4]/D");
-
-  if (save_neut_status){
-    tn->Branch("ParticleNEUTStatus", fParticleNEUTStatus, "ParticleNEUTStatus[NParticles]/I");
-    tn->Branch("ParticleNEUTAlive", fParticleNEUTAlive, "ParticleNEUTAlive[NParticles]/I");
-  }
-
-}
-
-/* Event Access Functions */
-//***************************************************
-
-FitParticle* FitEvent::PartInfo(UInt_t i) {
-  // Check Valid
-  if (i > (UInt_t)fNParticles or i < 0) {
-    ERR(FTL) << "Requesting particle beyond stack!" << std::endl;
-    ERR(FTL) << "i = " << i << " N = " << fNParticles << std::endl;
-    ERR(FTL) << "Mode = " << fMode << std::endl;
-
-    throw;
-  }
-
-  // Check particle has been formed
-  if (!fParticleList[i]) {
-    fParticleList[i] = new FitParticle(fParticleMom[i][0], fParticleMom[i][1],
-                                       fParticleMom[i][2], fParticleMom[i][3],
-                                       fParticlePDG[i], fParticleState[i]);
-  }
-
-  return fParticleList[i];
-}
-
-int FitEvent::GetNeutrinoInPos(void) const {
-  for (UInt_t i = 0; i < NPart(); i++) {
-    if (fParticleState[i] != kInitialState) continue;
-
-    if (abs(fParticlePDG[i]) == 12 || abs(fParticlePDG[i]) == 14 ||
-        abs(fParticlePDG[i]) == 16) {
-      return i;
-    }
-  }
-  return -1;
-}
-
-int FitEvent::GetLeptonOutPos(void) const {
-  for (UInt_t i = 0; i < NPart(); i++) {
-    if (fParticleState[i] != kFinalState) continue;
-
-    if (abs(fParticlePDG[i]) == 11 || abs(fParticlePDG[i]) == 13 ||
-        abs(fParticlePDG[i]) == 15) {
-      return i;
-    }
-  }
-  return -1;
-}
-
-FitParticle* FitEvent::GetBeamPart(void) { return PartInfo(GetBeamPartPos()); }
-
-FitParticle* FitEvent::GetNeutrinoIn(void) {
-  return PartInfo(GetNeutrinoInPos());
-}
-
-FitParticle* FitEvent::GetLeptonOut(void) {
-  return PartInfo(GetLeptonOutPos());
-}
-
-bool FitEvent::HasParticle(int pdg, int state) {
-  bool found = false;
-  for (int i = 0; i < fNParticles; i++) {
-    if (state != -1 && fParticleState[i] != (uint)state) continue;
-    if (fParticlePDG[i] == pdg) found = true;
-  }
-
-  return found;
-}
-
-int FitEvent::NumParticle(int pdg, int state) {
-  int nfound = 0;
-  for (int i = 0; i < fNParticles; i++) {
-    // std::cout << "fParticlePDG[" << i << "] = " << fParticlePDG[i] <<
-    // std::endl;
-
-    if (state != -1 and fParticleState[i] != (uint)state) continue;
-    if (pdg == 0 or fParticlePDG[i] == pdg) nfound += 1;
-  }
-
-  return nfound;
-}
-
-int FitEvent::NumParticle(std::vector<int> pdg, int state) {
-  int nfound = 0;
-  for (int i = 0; i < fNParticles; i++) {
-    if (state != -1 and fParticleState[i] != (uint)state) continue;
-    if (std::find(pdg.begin(), pdg.end(), fParticlePDG[i]) != pdg.end())
-      nfound += 1;
-  }
-
-  return nfound;
-}
-
-int FitEvent::NumFSLeptons() {
-  int nLeptons = 0;
-
-  for (int i = 0; i < fNParticles; i++) {
-    if (fParticleState[i] != kFinalState) continue;
-    if (abs(fParticlePDG[i]) == 11 || abs(fParticlePDG[i]) == 13 ||
-        abs(fParticlePDG[i]) == 15)
-      nLeptons += 1;
-  }
-
-  return nLeptons;
-}
-
-int FitEvent::NumFSMesons() {
-  int nMesons = 0;
-
-  for (int i = 0; i < fNParticles; i++) {
-    if (fParticleState[i] != kFinalState) continue;
-    if (abs(fParticlePDG[i]) >= 111 && abs(fParticlePDG[i]) <= 557)
-      nMesons += 1;
-  }
-
-  return nMesons;
-}
-
-FitParticle* FitEvent::GetHMParticle(int pdg, int state) {
-  double maxmom = -9999999.9;
-  int maxind = -1;
-
-  for (int i = 0; i < fNParticles; i++) {
-    if (state != -1 and fParticleState[i] != (uint)state) continue;
-    if (pdg == 0 or fParticlePDG[i] == pdg) {
-      // Update Max Mom
-      double mom = sqrt(fParticleMom[i][0] * fParticleMom[i][0] +
-                        fParticleMom[i][1] * fParticleMom[i][1] +
-                        fParticleMom[i][2] * fParticleMom[i][2]);
-      if (fabs(mom) > maxmom) {
-        maxmom = fabs(mom);
-        maxind = i;
-      }
-    }
-  }
-
-  if (maxind == -1) {
-    return NULL;
-  }
-  return PartInfo(maxind);
-}
-
-FitParticle* FitEvent::GetHMParticle(std::vector<int> pdg, int state) {
-  double maxmom = -9999999.9;
-  int maxind = -1;
-
-  for (int i = 0; i < fNParticles; i++) {
-    if (state != -1 and fParticleState[i] != (uint)state) continue;
-    if (std::find(pdg.begin(), pdg.end(), fParticlePDG[i]) != pdg.end()) {
-      // Update Max Mom
-      double mom = sqrt(fParticleMom[i][0] * fParticleMom[i][0] +
-                        fParticleMom[i][1] * fParticleMom[i][1] +
-                        fParticleMom[i][2] * fParticleMom[i][2]);
-      if (fabs(mom) > maxmom) {
-        maxmom = fabs(mom);
-        maxind = i;
-      }
-    }
-  }
-
-  if (maxind == -1) {
-    return NULL;
-  }
-  return PartInfo(maxind);
-}
-
-void FitEvent::Print() {
-
-
-
-  LOG(EVT) << "FitEvent print" << std::endl;
-  LOG(EVT) << "Mode: " << fMode << std::endl;
-  LOG(EVT) << "Particles: " << fNParticles << std::endl;
-  LOG(EVT) << " -> Particle Stack " << std::endl;
-  for (int i = 0; i < fNParticles; i++) {
-    LOG(EVT) << " -> -> " << i << ". " << fParticlePDG[i] << " "
-             << fParticleState[i] << " "
-             << "  Mom(" << fParticleMom[i][0] << ", " << fParticleMom[i][1]
-             << ", " << fParticleMom[i][2] << ", " << fParticleMom[i][3] << ")."
-             << std::endl;
-  }
-  return;
-}
-
-void FitEvent::PrintChris(){
-
-  std::cout << "FitEvent print ---- " << std::endl;
-  for (int i = 0; i < fNParticles; i++){
-    std::cout << PartInfo(i)->fPID
-	      << " state " << fParticleState[i]
-	      << " status " <<fParticleNEUTStatus[i]
-	      << " alive " << fParticleNEUTAlive[i] << std::endl;
-  }
-  std::cout << " " << std::endl;
-}
diff --git a/src/FitBase/FitEvent.h b/src/FitBase/FitEvent.h
deleted file mode 100644
index 4526579..0000000
--- a/src/FitBase/FitEvent.h
+++ /dev/null
@@ -1,362 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef FITEVENT2_H_SEEN
-#define FITEVENT2_H_SEEN
-/*!
- *  \addtogroup FitBase
- *  @{
- */
-
-#include <algorithm>
-#include <iterator>
-#include <vector>
-#include "FitParticle.h"
-#include "TLorentzVector.h"
-#include "TSpline.h"
-#include "FitParameters.h"
-
-#ifdef __NEUT_ENABLED__
-#include "neutpart.h"
-#include "neutvect.h"
-#endif
-
-#ifdef __NUWRO_ENABLED__
-#include "event1.h"
-#endif
-
-#ifdef __GENIE_ENABLED__
-#include "EVGCore/EventRecord.h"
-#include "GHEP/GHepRecord.h"
-#include "Ntuple/NtpMCEventRecord.h"
-using namespace genie;
-#endif
-#include "BaseFitEvt.h"
-#include "FitLogger.h"
-#include "GeneratorUtils.h"
-#include "TArrayD.h"
-
-//! Converts NEUT/NuWro/GENIE events to a comman format straight from the tree
-class FitEvent : public BaseFitEvt {
- public:
-  // Config Options for this class
-  static const bool kRemoveFSIParticles = true;
-  static const bool kRemoveUndefParticles = true;
-
-  FitEvent() {
-    for (UInt_t i = 0; i < kMaxParticles; i++) {
-      fParticleList[i] = NULL;
-    }
-  };
-  ~FitEvent(){};
-
-  //! Run event convertor, calls relevent event generator kinematic functions.
-  void CalcKinematics(void);
-
-  //! Reset the event variables
-  void ResetEvent(void);
-
-/* Event Convertors */
-#ifdef __NEUT_ENABLED__
-  //! Constructor assigns event address to NeutVect memory.
-  FitEvent(NeutVect* event) { this->SetEventAddress(&event); };
-
-  //! Set event address to NeutVect memory
-  void SetEventAddress(NeutVect** tempevent);
-
-  //! Convert NeutVect to common format
-  void NeutKinematics(void);
-#endif
-
-#ifdef __NUWRO_ENABLED__
-  //! Constructor assigns event address to NuWro event class memory.
-  FitEvent(event* tempEvent) { this->SetEventAddress(&tempEvent); };
-
-  //! Set event address to NuWro event class memory
-  void SetEventAddress(event** tempevent);
-
-  //! Convert NuWro event class to common format
-  void NuwroKinematics(void);
-#endif
-
-#ifdef __GENIE_ENABLED__
-  //! Constructor assigns event address to GENIE event class memory.
-  FitEvent(NtpMCEventRecord* tempevent) { this->SetEventAddress(&tempevent); };
-
-  //! Set event address to GENIE event record memory
-  //! Gets GHepRecord from NTuple record.
-  void SetEventAddress(NtpMCEventRecord** tempevent);
-
-  //! Convert GENIE event class to common format
-  void GENIEKinematics(void);
-
-  //! Flag to remove nuclear components in GENIE
-  static const bool kRemoveGenieNuclear = true;
-#endif
-
-#ifdef __GiBUU_ENABLED__
-  //! Constructor assisgns event address to a GiBUU reader
-  void SetEventAddress(GiBUUStdHepReader* tempevent);
-
-  //! Convert GiBUUStdHep event class to common format
-  void GiBUUKinematics(void);
-
-  //! Flag to remove nuclear components in GiBUU
-  static const bool kRemoveGiBUUNuclear = true;
-#endif
-
-#ifdef __NUANCE_ENABLED__
-  //! Constructor assigns event address to a Nuance reader
-  void SetEventAddress(NuanceEvent** tempevent);
-
-  //! Convert Nuance event class to common format
-  void NuanceKinematics(void);
-#endif
-
-  /* Standard Event Functions */
-
-  void OrderStack();
-
-  //! Return Any FitParticle from event
-  FitParticle* PartInfo(UInt_t i);
-  inline UInt_t Npart(void) const { return NPart(); };
-  inline UInt_t NPart(void) const { return fNParticles; };
-
-  int Mode;  // Public access needed
-
-  inline int GetBeamPartPos(void) const { return 0; };
-  int GetNeutrinoInPos(void) const;
-  int GetLeptonOutPos(void) const;
-
-  FitParticle* GetBeamPart(void);
-  FitParticle* GetNeutrinoIn(void);
-  FitParticle* GetLeptonOut(void);
-
-  // Access functions
-  inline bool IsCC() { return (abs(fMode) <= 30); };
-  inline bool IsNC() { return (abs(fMode) > 30); };
-
-  // Utility functions to return number of a certain class of particles
-  int NumFSLeptons();
-  int NumFSMesons();
-
-  bool HasParticle(int pdg = 0, int state = -1);
-  int NumParticle(int pdg = 0, int state = -1);
-  int NumParticle(std::vector<int> pdg, int state = -1);
-
-  inline bool HasISParticle(int pdg) {
-    return HasParticle(pdg, kInitialState);
-  };
-  inline int NumISParticle(int pdg = 0) {
-    return NumParticle(pdg, kInitialState);
-  };
-  // inline int NumISParticle(std::vector<int> pdg) {
-  //   return NumParticle(pdg, kInitialState);
-  // };
-  inline bool HasISNuElectron(void) { return HasISParticle(12); };
-  inline bool HasISNuMuon(void) { return HasISParticle(14); };
-  inline bool HasISNuTau(void) { return HasISParticle(16); };
-  inline bool HasISElectron(void) { return HasISParticle(11); };
-  inline bool HasISMuon(void) { return HasISParticle(13); };
-  inline bool HasISTau(void) { return HasISParticle(15); };
-  inline bool HasISProton(void) { return HasISParticle(2212); };
-  inline bool HasISNeutron(void) { return HasISParticle(2112); };
-  inline bool HasISPiZero(void) { return HasISParticle(111); };
-  inline bool HasISPiPlus(void) { return HasISParticle(211); };
-  inline bool HasISPiMinus(void) { return HasISParticle(-211); };
-  inline bool HasISPhoton(void) { return HasISParticle(22); };
-
-  inline bool HasFSParticle(int pdg) { return HasParticle(pdg, kFinalState); };
-  inline int NumFSParticle(int pdg = 0) {
-    return NumParticle(pdg, kFinalState);
-  };
-  template <size_t N>
-  inline int NumFSParticle(int const (&pdgs)[N]) {
-    int rtn = 0;
-    for (size_t i = 0; i < N; ++i) {
-      rtn += NumParticle(pdgs[i], kFinalState);
-    }
-    return rtn;
-  };
-  template <size_t N>
-  inline int NumParticle(int const (&pdgs)[N]) {
-    int rtn = 0;
-    for (size_t i = 0; i < N; ++i) {
-      rtn += NumParticle(pdgs[i]);
-    }
-    return rtn;
-  };
-
-  // inline int NumFSParticle(std::vector<int> pdg) {
-  //   return NumParticle(pdg, kFinalState);
-  // };
-  inline bool HasFSNuElectron(void) { return HasFSParticle(12); };
-  inline bool HasFSNuMuon(void) { return HasFSParticle(14); };
-  inline bool HasFSNuTau(void) { return HasFSParticle(16); };
-  inline bool HasFSElectron(void) { return HasFSParticle(11); };
-  inline bool HasFSMuon(void) { return HasFSParticle(13); };
-  inline bool HasFSTau(void) { return HasFSParticle(15); };
-  inline bool HasFSProton(void) { return HasFSParticle(2212); };
-  inline bool HasFSNeutron(void) { return HasFSParticle(2112); };
-  inline bool HasFSPiZero(void) { return HasFSParticle(111); };
-  inline bool HasFSPiPlus(void) { return HasFSParticle(211); };
-  inline bool HasFSPiMinus(void) { return HasFSParticle(-211); };
-  inline bool HasFSPhoton(void) { return HasFSParticle(22); };
-
-  FitParticle* GetHMParticle(int pdg = 0, int state = -1);
-  FitParticle* GetHMParticle(std::vector<int> pdg, int state = -1);
-
-  template <size_t N>
-  inline FitParticle* GetHMParticle(int const (&pdgs)[N]) {
-    FitParticle* rtn = NULL;
-    for (size_t i = 0; i < N; ++i) {
-      FitParticle* p = GetHMParticle(pdgs[i]);
-      // If this one is good, and we don't have one.
-      if (p && !rtn) {
-        rtn = p;
-        continue;
-      }
-      // if this one is good and it has more 3mom than the other one.
-      // (Mag2 doesn't need sqrt so slightly faster for same comparison.)
-      if (p && (p->fP.Vect().Mag2() > rtn->fP.Vect().Mag2())) {
-        rtn = p;
-      }
-    }
-    return rtn;
-  };
-
-  inline FitParticle* GetHMISParticle(int pdg) {
-    return GetHMParticle(pdg, kInitialState);
-  };
-  template <size_t N>
-  inline FitParticle* GetHMISParticle(int const (&pdgs)[N]) {
-    FitParticle* rtn = NULL;
-    for (size_t i = 0; i < N; ++i) {
-      FitParticle* p = GetHMParticle(pdgs[i], kInitialState);
-      // If this one is good, and we don't have one.
-      if (p && !rtn) {
-        rtn = p;
-        continue;
-      }
-      // if this one is good and it has more 3mom than the other one.
-      // (Mag2 doesn't need sqrt so slightly faster for same comparison.)
-      if (p && (p->fP.Vect().Mag2() > rtn->fP.Vect().Mag2())) {
-        rtn = p;
-      }
-    }
-    return rtn;
-  };
-  // inline FitParticle* GetHMISParticle(std::vector<int> pdg) {
-  //   return GetHMParticle(pdg, kInitialState);
-  // };
-  inline FitParticle* GetHMISNuElectron(void) { return GetHMISParticle(12); };
-  inline FitParticle* GetHMISNuMuon(void) { return GetHMISParticle(14); };
-  inline FitParticle* GetHMISNuTau(void) { return GetHMISParticle(16); };
-  inline FitParticle* GetHMISElectron(void) { return GetHMISParticle(11); };
-  inline FitParticle* GetHMISMuon(void) { return GetHMISParticle(13); };
-  inline FitParticle* GetHMISTau(void) { return GetHMISParticle(15); };
-  inline FitParticle* GetHMISProton(void) { return GetHMISParticle(2212); };
-  inline FitParticle* GetHMISNeutron(void) { return GetHMISParticle(2112); };
-  inline FitParticle* GetHMISPiZero(void) { return GetHMISParticle(111); };
-  inline FitParticle* GetHMISPiPlus(void) { return GetHMISParticle(211); };
-  inline FitParticle* GetHMISPiMinus(void) { return GetHMISParticle(-211); };
-  inline FitParticle* GetHMISPhoton(void) { return GetHMISParticle(22); };
-
-  inline FitParticle* GetHMFSParticle(int pdg) {
-    return GetHMParticle(pdg, kFinalState);
-  };
-  template <size_t N>
-  inline FitParticle* GetHMFSParticle(int const (&pdgs)[N]) {
-    FitParticle* rtn = NULL;
-    for (size_t i = 0; i < N; ++i) {
-      FitParticle* p = GetHMParticle(pdgs[i], kFinalState);
-      // If this one is good, and we don't have one.
-      if (p && !rtn) {
-        rtn = p;
-        continue;
-      }
-      // if this one is good and it has more 3mom than the other one.
-      // (Mag2 doesn't need sqrt so slightly faster for same comparison.)
-      if (p && (p->fP.Vect().Mag2() > rtn->fP.Vect().Mag2())) {
-        rtn = p;
-      }
-    }
-    return rtn;
-  };
-  // inline FitParticle* GetHMFSParticle(std::vector<int> pdg) {
-  //   return GetHMParticle(pdg, kFinalState);
-  // };
-  inline FitParticle* GetHMFSNuElectron(void) { return GetHMFSParticle(12); };
-  inline FitParticle* GetHMFSNuMuon(void) { return GetHMFSParticle(14); };
-  inline FitParticle* GetHMFSNuTau(void) { return GetHMFSParticle(16); };
-  inline FitParticle* GetHMFSElectron(void) { return GetHMFSParticle(11); };
-  inline FitParticle* GetHMFSMuon(void) { return GetHMFSParticle(13); };
-  inline FitParticle* GetHMFSTau(void) { return GetHMFSParticle(15); };
-  inline FitParticle* GetHMFSProton(void) { return GetHMFSParticle(2212); };
-  inline FitParticle* GetHMFSNeutron(void) { return GetHMFSParticle(2112); };
-  inline FitParticle* GetHMFSPiZero(void) { return GetHMFSParticle(111); };
-  inline FitParticle* GetHMFSPiPlus(void) { return GetHMFSParticle(211); };
-  inline FitParticle* GetHMFSPiMinus(void) { return GetHMFSParticle(-211); };
-  inline FitParticle* GetHMFSPhoton(void) { return GetHMFSParticle(22); };
-
-  inline int GetMode(void) { return fMode; };
-  inline double Enu(void) { return PartInfo(0)->fP.E(); };
-  inline int PDGnu(void) { return PartInfo(0)->fPID; };
-
-  inline int GetTargetA(void) { return fTargetA; };
-  inline int GetTargetZ(void) { return fTargetZ; };
-  inline int GetTotCrs(void) { return fTotCrs; };
-
-  double weight;  // need for silly reason
-
-  /* Read/Write FitEvent Functions */
-  void SetBranchAddress(TChain* tn);
-  void AddBranchesToTree(TTree* tn);
-
-  void Print();
-  void PrintChris();
-
- protected:
-  // Event Information
-  int fMode;
-  UInt_t fEventNo;
-  double fTotCrs;
-  int fTargetA;
-  int fTargetZ;
-  int fTargetH;
-  bool fBound;
-  int fDistance;
-
-  // Reduced Particle Stack
-  const static UInt_t kMaxParticles = 400;
-  int fNParticles;
-  //  double  fParticlePos[kMaxParticles][4]; // not needed at the moment
-  double fParticleMom[kMaxParticles][4];
-  UInt_t fParticleState[kMaxParticles];
-  int fParticlePDG[kMaxParticles];
-  FitParticle* fParticleList[kMaxParticles];
-
-  bool save_neut_status;
-  int fParticleNEUTStatus[kMaxParticles];
-  int fParticleNEUTAlive[kMaxParticles];
-
-};
-
-/*! @} */
-#endif
diff --git a/src/FitBase/FitParticle.cxx b/src/FitBase/FitParticle.cxx
deleted file mode 100644
index 2de94b2..0000000
--- a/src/FitBase/FitParticle.cxx
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#include "FitParticle.h"
-
-// NEUT Constructor
-#ifdef __NEUT_ENABLED__
-FitParticle::FitParticle(NeutPart* part) {
-  // Set Momentum
-  fP = TLorentzVector(part->fP.X(), part->fP.Y(), part->fP.Z(), part->fP.T());
-
-  fPID = part->fPID;
-  fIsAlive = part->fIsAlive;
-  fNEUTStatusCode = part->fStatus;
-  fMass = part->fMass;
-};
-
-// NEUT FSI defined in neutclass/neutfsipart
-FitParticle::FitParticle(NeutFsiPart* part) {
-  // Set Momentum
-  fP = TLorentzVector(part->fDir.X(), part->fDir.Y(), part->fDir.Z(),
-                      part->fDir.T());
-
-  fPID = part->fPID;
-  // Set these to zero because they don't make sense in NEUT
-  fIsAlive = 0;
-  fNEUTStatusCode = 0;
-  fMass = fP.Mag();
-};
-#endif
-
-// NUWRO Constructor
-#ifdef __NUWRO_ENABLED__
-FitParticle::FitParticle(particle* nuwro_particle, Int_t state) {
-  // Set Momentum
-  this->fP = TLorentzVector(nuwro_particle->x, nuwro_particle->y,
-                            nuwro_particle->z, nuwro_particle->t);
-  fPID = nuwro_particle->pdg;
-
-  // Set status manually from switch
-  switch (state) {
-    case 0:
-      fIsAlive = 0;
-      fNEUTStatusCode = 1;
-      break;  // Initial State
-    case 1:
-      fIsAlive = 1;
-      fNEUTStatusCode = 0;
-      break;  // Final State
-    case 2:
-      fIsAlive = 0;
-      fNEUTStatusCode = 2;
-      break;  // Intermediate State
-    default:
-      fIsAlive = -1;
-      fNEUTStatusCode = 3;
-      break;  // Other?
-  }
-
-  fMass = fP.M();
-};
-#endif
-
-// GENIE Constructor
-#ifdef __GENIE_ENABLED__
-FitParticle::FitParticle(genie::GHepParticle* genie_particle) {
-  this->fP = TLorentzVector(
-      genie_particle->Px() * 1000.0, genie_particle->Py() * 1000.0,
-      genie_particle->Pz() * 1000.0, genie_particle->E() * 1000.0);
-
-  fPID = genie_particle->Pdg();
-
-  switch (genie_particle->Status()) {
-    case genie::kIStInitialState:
-      fIsAlive = 0;
-      fNEUTStatusCode = 1;
-      break;  // Initial State
-    case genie::kIStStableFinalState:
-      fIsAlive = 1;
-      fNEUTStatusCode = 0;
-      break;  // Final State
-    case genie::kIStIntermediateState:
-      fIsAlive = 0;
-      fNEUTStatusCode = 2;
-      break;  // Intermediate State
-    default:
-      fIsAlive = -1;
-      fNEUTStatusCode = 3;
-      break;
-  }
-
-  // Flag to remove nuclear part in genie
-  if (fPID > 3000) {
-    fIsAlive = -1;
-    fNEUTStatusCode = 2;
-  }
-
-  fMass = genie_particle->Mass() * 1000.0;
-
-  // Additional flag to remove off shell particles
-  if (fabs(fMass - fP.Mag()) > 0.001) {
-    fIsAlive = -1;
-    fNEUTStatusCode = 2;
-  }
-};
-
-#endif
-
-#ifdef __GiBUU_ENABLED__
-FitParticle::FitParticle(GiBUUStdHepReader* GiRead, Int_t p_it) {
-  fPID = GiRead->StdHepPdg[p_it];
-
-  fP = TLorentzVector(
-      GiRead->StdHepP4[p_it][0] * 1000.0, GiRead->StdHepP4[p_it][1] * 1000.0,
-      GiRead->StdHepP4[p_it][2] * 1000.0, GiRead->StdHepP4[p_it][3] * 1000.0);
-
-  fMass = fP.M();
-
-  // Flag to remove nuclear part
-  if (fPID > 100000) {
-    fIsAlive = -1;
-    fNEUTStatusCode = 2;
-  }
-
-  switch (GiRead->StdHepStatus[p_it]) {
-    case 0: {  // incoming
-      fIsAlive = 0;
-      fNEUTStatusCode = 1;
-      break;
-    }
-    case 1: {  // good final state
-      fIsAlive = 1;
-      fNEUTStatusCode = 0;
-      break;
-    }
-    case 11: {  // struck nucleon
-      fIsAlive = 0;
-      fNEUTStatusCode = 1;
-      break;
-    }
-  }
-}
-#endif
-
-FitParticle::FitParticle(UInt_t* i) {
-  (void)i;
-
-  // A NULL event has been passed
-  //  ERR(FTL)<<"NULL Event Passed to FitEvent.cxx"<<std::endl;
-
-  return;
-};
-
-// NUANCE Particle
-FitParticle::FitParticle(double x, double y, double z, double t, int pdg,
-                         Int_t state) {
-  // Set Momentum
-  this->fP = TLorentzVector(x, y, z, t);
-  fPID = pdg;
-  fStatus = state;
-
-  // Set status manually from switch
-  switch (state) {
-    case kInitialState:
-      fIsAlive = 0;
-      fNEUTStatusCode = 1;
-      break;  // Initial State
-    case kFinalState:
-      fIsAlive = 1;
-      fNEUTStatusCode = 0;
-      break;  // Final State
-    case kFSIState:
-      fIsAlive = 0;
-      fNEUTStatusCode = 2;
-      break;  // Intermediate State
-    default:
-      fIsAlive = -1;
-      fNEUTStatusCode = 3;
-      break;  // Other?
-  }
-
-  fMass = fP.Mag();
-};
diff --git a/src/FitBase/FitWeight.cxx b/src/FitBase/FitWeight.cxx
deleted file mode 100644
index 8dabbee..0000000
--- a/src/FitBase/FitWeight.cxx
+++ /dev/null
@@ -1,1486 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#include "FitWeight.h"
-
-//********************************************************************
-FitWeight::FitWeight(std::string name, std::string inputfile) {
-  //********************************************************************
-  // To be completed...
-  this->fName = name;
-  this->fNormEnum = 0;
-  this->fDialEnums.clear();
-  this->fDialNames.clear();
-  this->fDialValues.clear();
-
-  this->fIsUsingNeut = false;
-  this->fIsUsingNIWG = false;
-  this->fIsUsingNuwro = false;
-  this->fIsUsingGenie = false;
-  this->fIsUsingT2K = false;
-
-  this->fSetAbsTwk = FitPar::Config().GetParB("params.setabstwk");
-
-  fSplineHead = NULL;
-
-  this->fName = name;
-  fSilenceWeightCalc = false;
-  
-  // If file is a root file read it
-  if (inputfile.find(".root") != std::string::npos) {
-    // Open File
-
-    // Get Fit Result Tree
-
-    // Get Parameter Names and Types
-
-    // Add Parameter Results
-
-    // If file is a card file read it
-  } else {
-    // Parse Card Lines
-
-    // Parse Card Inputs
-
-    // Setup RW Dials
-  }
-}
-
-//********************************************************************
-FitWeight::FitWeight(std::string name) {
-  //********************************************************************
-
-  this->fNormEnum = 0;
-  this->fDialEnums.clear();
-  this->fDialNames.clear();
-  this->fDialValues.clear();
-
-  this->fIsUsingNeut = false;
-  this->fIsUsingNIWG = false;
-  this->fIsUsingNuwro = false;
-  this->fIsUsingGenie = false;
-  this->fIsUsingT2K = false;
-  fIsUsingModeNorm = false;
-
-  this->fSetAbsTwk = FitPar::Config().GetParB("params.setabstwk");
-
-  fSplineHead = NULL;
-
-  fSilenceWeightCalc = false;
-
-  this->fName = name;
-  LOG(FIT) << "Creating FitWeight norm enum = " << this->fNormEnum
-	   << std::endl;
-}
-
-//********************************************************************
-int FitWeight::GetDialEnum(std::string name, int type) {
-  //********************************************************************
-
-  if (type == -1) {
-    return fDialEnums[this->GetDialPos(name)];
-  }
-
-  int this_enum = FitBase::GetDialEnum(type, name);
-  return this_enum;
-}
-
-//********************************************************************
-int FitWeight::GetRWEnum(int this_enum) {
-  //********************************************************************
-  return (this_enum % 1000);
-}
-
-//********************************************************************
-unsigned int FitWeight::GetDialPos(int this_enum) {
-  //********************************************************************
-
-  std::vector<int>::iterator enIter = fDialEnums.begin();
-  unsigned int count = 0;
-
-  for (; enIter != fDialEnums.end(); enIter++) {
-    if (((int)(*enIter)) == this_enum) {
-      return count;
-    }
-    count++;
-  }
-
-  LOG(FTL) << "No Value saved for ENUM " << this_enum << std::endl;
-  exit(-1);
-
-  return -1;
-}
-
-//******************************************************************** 
-bool FitWeight::DialIncluded(std::string name){
-//********************************************************************
-
-  std::vector<std::string>::iterator naIter = fDialNames.begin();
-  bool found = false;
-  
-  for (; naIter != fDialNames.end(); naIter++) {
-    if (((std::string)(*naIter)) == name) {
-      found = true;
-      break;
-    }
-  }
-
-  return found;
-}
-
-//********************************************************************
-unsigned int FitWeight::GetDialPos(std::string name) {
-//********************************************************************
-
-  std::vector<std::string>::iterator naIter = fDialNames.begin();
-  unsigned int count = 0;
-
-  for (; naIter != fDialNames.end(); naIter++) {
-    if (((std::string)(*naIter)) == name) {
-      return count;
-    }
-    count++;
-  }
-
-  LOG(FTL) << "No Value saved for Dial Name " << name << std::endl;
-  exit(-1);
-
-  return -1;
-}
-
-//********************************************************************
-void FitWeight::IncludeDial(std::string name, int type, double startval) {
-//********************************************************************
-  
-  // Create pointer to current ROOT directory
-  TDirectory* olddir = gDirectory;
-  
-  // Get Dial Enumerations
-  int this_enum = this->GetDialEnum(name, type);
-  int rw_enum = this->GetRWEnum(this_enum);
-
-  LOG(FIT) << "Including dial " << name << " [type, rw_enum, fit_enum] = ["
-           << generator_event_type(type) << ", " << rw_enum << ", " << this_enum
-           << "] " << std::endl;
-
-  int id = int(this_enum - (this_enum % 1000)) / 1000;
-  if (id == kNORM) startval = 1.0;
-  
-  switch (id) {
-    // NEUT RW INCLUDE DIAL
-    case kNEUT:
-#ifdef __NEUT_ENABLED__
-      if (!fIsUsingNeut) this->SetupNeutRW();
-      this->fNeutRW->Systematics().Init(
-          static_cast<neut::rew::NSyst_t>(rw_enum));
-      if (this->fSetAbsTwk) NSystUncertainty::Instance()->SetUncertainty(
-	  static_cast<neut::rew::NSyst_t>(rw_enum), 1.0, 1.0);
-      break;
-#else
-      ERR(FTL) << "NEUT RW Not Enabled!" << endl;
-      throw;
-#endif
-
-    // NIWG RW INCLUDE DIAL
-    case kNIWG:
-#ifdef __NIWG_ENABLED__
-      if (!fIsUsingNIWG) this->SetupNIWGRW();
-      this->fNIWGRW->Systematics().Init(
-          static_cast<niwg::rew::NIWGSyst_t>(rw_enum));
-      if (this->fSetAbsTwk) niwg::rew::NIWGSystUncertainty::Instance()->SetUncertainty(
-	  static_cast<niwg::rew::NIWGSyst_t>(rw_enum), 1.0, 1.0);
-      break;
-#else
-      ERR(FTL) << "NIWG RW Not Enabled!" << endl;
-      throw;
-#endif
-
-    // NUWRO RW INCLUDE DIAL
-    case kNUWRO:
-#ifdef __NUWRO_REWEIGHT_ENABLED__
-      if (!fIsUsingNuwro) this->SetupNuwroRW();      
-      this->fNuwroRW->Systematics().Add(
-          static_cast<nuwro::rew::NuwroSyst_t>(rw_enum));
-      if (this->fSetAbsTwk) nuwro::rew::NuwroSystUncertainty::Instance()->SetUncertainty(
-      	  static_cast<nuwro::rew::NuwroSyst_t>(rw_enum), 1.0, 1.0);
-      break;
-#else
-      LOG(FTL) << "Trying to Include NuWro Dial is unsupported!" << std::endl;
-      throw;
-#endif
-
-    // GENIE RW INCLUDE DIAL
-    case kGENIE:
-#ifdef __GENIE_ENABLED__
-      if (!fIsUsingGenie) this->SetupGenieRW();
-      this->fGenieRW->Systematics().Init(
-          static_cast<genie::rew::GSyst_t>(rw_enum));
-      if (this->fSetAbsTwk) GSystUncertainty::Instance()->SetUncertainty(
-	  static_cast<genie::rew::GSyst_t>(rw_enum), 1.0, 1.0);
-      break;
-#else
-      ERR(FTL) << "Trying to Include GENIE Dial is unsupported!" << std::endl;
-      throw;
-#endif
-
-    // T2K RW INCLUDE DIAL
-    case kT2K:
-#ifdef __T2KREW_ENABLED__
-      if (!fIsUsingT2K) this->SetupT2KRW();
-      this->fT2KRW->Systematics().Include(static_cast<t2krew::T2KSyst_t>(rw_enum));
-      this->fT2KRW->Systematics().SetAbsTwk(static_cast<t2krew::T2KSyst_t>(rw_enum));
-      break;
-#else
-      ERR(FTL) << "Trying to Include T2K Dial is unsupported!" << std::endl;
-      throw;
-#endif
-
-    // SAMPLE NORM DIAL
-    case kNORM:
-      break;
-
-    case kMODENORM:
-      break;
-
-    default:
-      ERR(FTL) << " Trying to include dial of unkown type " << name
-               << " == " << type << endl;
-      break;
-  }
-
-  // Setup ENUMS
-  fDialEnums.push_back(this_enum);
-  fDialNames.push_back(name);
-  fDialValues.push_back(startval);
-
-  fDialFuncs.push_back(FitBase::GetRWConvFunction(GetDialType(this_enum), name));
-  
-  // Don't use the dial conversion if using absolute tweaks
-  if (this->fSetAbsTwk) fDialUnits.push_back("frac.");
-  else fDialUnits.push_back(FitBase::GetRWUnits(GetDialType(this_enum), name));
-
-  // Set Values
-  this->SetDialValue(this_enum, startval);
-
-  // Fix Bug by returning to starting directory for this function
-  olddir->cd();
-
-  return;
-}
-
-//********************************************************************
-void FitWeight::SetDialValue(std::string name, double val) {
-  //********************************************************************
-  int this_enum = this->GetDialEnum(name);
-  this->SetDialValue(this_enum, val);
-}
-
-//********************************************************************
-void FitWeight::SetDialValue(int this_enum, double val) {
-  //*********************************************************************
-
-  fIsDialChanged = true;
-  int rw_enum = GetRWEnum(this_enum);
-  unsigned int pos = GetDialPos(this_enum);
-  LOG(DEB) << "Setting dial value " << this_enum << " to " << val << std::endl;
-
-  // -- DIAL BLOCKS
-  int id = int(this_enum - (this_enum % 1000)) / 1000;
-
-  switch (id) {
-    case kNEUT: {
-#ifdef __NEUT_ENABLED__  // --- NEUT BLOCK
-      this->fNeutRW->Systematics().Set(static_cast<neut::rew::NSyst_t>(rw_enum),
-                                       val);
-      this->fIsNeutChanged = true;
-#else
-      LOG(FTL) << " NEUT DIAL ERROR " << std::endl;
-#endif
-      break;
-    }
-    case kNIWG: {
-#ifdef __NIWG_ENABLED__
-      this->fNIWGRW->Systematics().Set(
-          static_cast<niwg::rew::NIWGSyst_t>(rw_enum), val);
-      this->fIsNIWGChanged = true;
-#else
-      LOG(FTL) << " NIWG DIAL ERROR " << std::endl;
-#endif
-      break;
-    }
-    case kNUWRO: {
-#ifdef __NUWRO_REWEIGHT_ENABLED__
-      fNuwroRW->Systematics().SetSystVal(
-          static_cast<nuwro::rew::NuwroSyst_t>(rw_enum), val);
-      this->fIsNuwroChanged = true;
-#else
-      LOG(FTL) << " NUWRO DIAL ERROR " << std::endl;
-#endif
-      break;
-    }
-    case kGENIE: {
-#ifdef __GENIE_ENABLED__
-      fGenieRW->Systematics().Set(static_cast<genie::rew::GSyst_t>(rw_enum),
-                                  val);
-      this->fIsGenieChanged = true;
-#else
-      LOG(FTL) << " GENIE DIAL ERROR " << std::endl;
-#endif
-      break;
-    }
-    case kT2K: {
-#ifdef __T2KREW_ENABLED__
-      fT2KRW->Systematics().SetTwkDial(static_cast<t2krew::T2KSyst_t>(rw_enum),
-                                       val);
-      this->fIsT2KChanged = true;
-#else
-      LOG(FTL) << " T2K DIAL ERROR " << std::endl;
-#endif
-      break;
-    }
-    case kCUSTOM:
-    case kNORM: {
-      break;
-    }
-    case kMODENORM: {
-      this->fIsUsingModeNorm = true;
-      break;
-    }
-    default: {
-      LOG(FTL) << "Dial type error: " << generator_event_type(id) << std::endl;
-      throw;
-    }
-  }
-
-  fDialValues[pos] = val;
-  return;
-}
-
-//********************************************************************
-void FitWeight::Reconfigure(bool silent) {
-  //********************************************************************
-
-  fSilenceWeightCalc = FitPar::Config().GetParB("params.silentweighting");
-  this->fSetAbsTwk = FitPar::Config().GetParB("params.setabstwk");
-
-  
-  if ((fIsUsingNeut or fIsUsingNIWG) and fIsUsingT2K) {
-    ERR(WRN) << " Make sure no correlated or overlapping dials are being used "
-                "between T2KRW and NEUT/NIWG RW"
-             << std::endl;
-  }
-
-  if (!fIsDialChanged) return;
-
-  if (!silent and LOG_LEVEL(MIN)) this->PrintState();
-
-  StopTalking();
-#ifdef __NEUT_ENABLED__  // --- NEUT BLOCK
-  if (fIsNeutChanged and fIsUsingNeut){ fNeutRW->Reconfigure(); }
-#endif
-
-#ifdef __NIWG_ENABLED__  // --- NIWG BLOCK
-  if (fIsNIWGChanged and fIsUsingNIWG) fNIWGRW->Reconfigure();
-#endif
-
-#ifdef __NUWRO_REWEIGHT_ENABLED__  // --- NUWRO BLOCK
-  if (fIsNuwroChanged and fIsUsingNuwro) fNuwroRW->Reconfigure();
-#endif
-
-#ifdef __GENIE_ENABLED__
-  if (fIsGenieChanged and fIsUsingGenie) fGenieRW->Reconfigure();
-#endif
-
-#ifdef __T2KREW_ENABLED__
-  if (fIsT2KChanged and fIsUsingT2K) fT2KRW->Reconfigure();
-#endif
-  StartTalking();
-
-  fIsDialChanged = false;
-  fIsNeutChanged = false;
-  fIsNIWGChanged = false;
-  fIsNuwroChanged = false;
-  fIsGenieChanged = false;
-  fIsT2KChanged = false;
-
-  return;
-}
-
-//********************************************************************
-void FitWeight::PrintState() {
-  //********************************************************************
-
-  LOG(MIN) << "-----------------------" << std::endl;
-  LOG(MIN) << this->fName << " Cur. State:" << std::endl;
-
-  // Loop over the Dials and print some info
-  for (unsigned int i = 0; i < fDialNames.size(); i++) {
-
-    std::string name = fDialNames.at(i);
-    int this_enum = fDialEnums.at(i);
-    double val = fDialValues.at(i);
-    std::string type = GetDialType(this_enum);
-
-    if (FitPar::Config().GetParB("convert_dials")) {
-      
-      double val = fDialFuncs.at(i).Eval(fDialValues.at(i));
-
-      LOG(MIN) << "-> " << std::setw(2) << i << ". " << std::setw(10) << type + "_par. ";
-      LOG(MIN) << std::setw(40) << fDialNames.at(i) << std::setw(5) << " = " << val
-	       << " " << fDialUnits.at(i) << std::endl;
-      
-    } else {
-      (void)val;
-      LOG(MIN) << "-> " << std::setw(2) << i << ". " << std::setw(10) << type + "_par. " << std::endl;
-      LOG(MIN) << std::setw(40) << std::left << fDialNames.at(i) << std::setw(5)
-	       << " = " << fDialValues.at(i) << " " << fDialUnits.at(i) << std::endl;
-    }
-  }
-
-  LOG(MIN) << "-----------------------" << std::endl;
-}
-
-//********************************************************************
-std::string FitWeight::GetDialType(int this_enum) {
-  //********************************************************************
-
-  int id = int(this_enum - (this_enum % 1000)) / 1000;
-  switch (id) {
-    case kNEUT: {
-      return "neut";
-    }
-    case kNIWG: {
-      return "niwg";
-    }
-    case kGENIE: {
-      return "genie";
-    }
-    case kT2K: {
-      return "t2k";
-    }
-    case kCUSTOM: {
-      return "custom";
-    }
-    case kNORM: {
-      return "norm";
-    }
-    case kMODENORM: {
-      return "modenorm";
-    }
-    default: { return "unknown"; }
-  }
-}
-
-//********************************************************************
-double FitWeight::CalcWeight(BaseFitEvt* evt) {
-//********************************************************************
-
-  // Optional cout suppression
-  if (fSilenceWeightCalc){
-    StopTalking();
-  }
-
-  double rw_weight = 1.0;
-
-  // SPLINE WEIGHTS
-  if (evt->fType == kEVTSPLINE) {
-    rw_weight = this->CalcSplineWeight(evt);
-    evt->Weight = rw_weight;
-    return rw_weight;
-  };
-
-  // GENERATOR WEIGHTS
-  if (fIsDialChanged) this->Reconfigure();
-  rw_weight = 1.0;
-
-  switch (evt->fType) {
-#ifdef __NEUT_ENABLED__  // --- NEUT BLOCK
-    case kNEUT:
-      if (fIsUsingNeut) {
-        GeneratorUtils::FillNeutCommons(evt->fNeutVect);
-        rw_weight *= fNeutRW->CalcWeight();
-      }
-
-#ifdef __NIWG_ENABLED__  // --- NIWG BLOCK
-      if (fIsUsingNIWG) {
-        niwg::rew::NIWGEvent* niwg_event =
-            GeneratorUtils::GetNIWGEvent(evt->fNeutVect);
-        rw_weight *= fNIWGRW->CalcWeight(*niwg_event);
-        delete niwg_event;
-      }
-#endif
-
-#ifdef __T2KREW_ENABLED__
-      if (fIsUsingT2K) {
-        rw_weight *= fT2KRW->CalcWeight(evt->fNeutVect);
-      }
-#endif
-
-      break;
-#endif
-
-#ifdef __NUWRO_REWEIGHT_ENABLED__
-    case kNUWRO:
-      if (fIsUsingNuwro) {
-        rw_weight *= fNuwroRW->CalcWeight(evt->fNuwroEvent);
-      }
-      break;
-#endif
-
-#ifdef __GENIE_ENABLED__
-    case kGENIE:
-      if (fIsUsingGenie) {
-        rw_weight *= fGenieRW->CalcWeight(*(evt->genie_event->event));
-      }
-#endif
-
-    default:
-      break;
-  }
-
-  if (fIsUsingModeNorm) {
-    for (size_t de_it = 0; de_it < fDialEnums.size(); ++de_it) {
-      int this_enum = fDialEnums[de_it];
-      if ((int(this_enum - (this_enum % 1000)) / 1000) != kMODENORM) {
-        continue;
-      }
-      if (evt->Mode == (GetRWEnum(this_enum) - 60)) {
-        rw_weight *= fDialValues[de_it];
-      }
-    }
-  }
-
-  evt->Weight = rw_weight;
-
-  // Optional cout suppression
-  if (fSilenceWeightCalc) StartTalking();
-  return rw_weight;
-}
-
-//********************************************************************
-#ifdef __NEUT_ENABLED__
-void FitWeight::SetupNeutRW() {
-  //********************************************************************
-
-  LOG(FIT) << "Setting up NEUT RW" << endl;
-  fIsUsingNeut = true;
-  fIsNeutChanged = true;
-
-  // Create RW Engine
-  StopTalking();
-  fNeutRW = new neut::rew::NReWeight();
-
-  // get list of vetoed calc engines (just for debug really)
-  std::string rw_engine_list =
-      FitPar::Config().GetParS("FitWeight.fNeutRW_veto");
-  bool xsec_ccqe = rw_engine_list.find("xsec_ccqe") == std::string::npos;
-  bool xsec_res = rw_engine_list.find("xsec_res") == std::string::npos;
-  bool xsec_ccres = rw_engine_list.find("xsec_ccres") == std::string::npos;
-  bool xsec_coh = rw_engine_list.find("xsec_coh") == std::string::npos;
-  bool xsec_dis = rw_engine_list.find("xsec_dis") == std::string::npos;
-  bool xsec_ncel = rw_engine_list.find("xsec_ncel") == std::string::npos;
-  bool xsec_nc = rw_engine_list.find("xsec_nc") == std::string::npos;
-  bool xsec_ncres = rw_engine_list.find("xsec_ncres") == std::string::npos;
-  bool nucl_casc = rw_engine_list.find("nucl_casc") == std::string::npos;
-  bool nucl_piless = rw_engine_list.find("nucl_piless") == std::string::npos;
-
-  // Activate each calc engine
-  if (xsec_ccqe)
-    fNeutRW->AdoptWghtCalc("xsec_ccqe", new neut::rew::NReWeightNuXSecCCQE);
-  if (xsec_res)
-    fNeutRW->AdoptWghtCalc("xsec_res", new neut::rew::NReWeightNuXSecRES);
-  if (xsec_ccres)
-    fNeutRW->AdoptWghtCalc("xsec_ccres", new neut::rew::NReWeightNuXSecCCRES);
-  if (xsec_coh)
-    fNeutRW->AdoptWghtCalc("xsec_coh", new neut::rew::NReWeightNuXSecCOH);
-  if (xsec_dis)
-    fNeutRW->AdoptWghtCalc("xsec_dis", new neut::rew::NReWeightNuXSecDIS);
-  if (xsec_ncel)
-    fNeutRW->AdoptWghtCalc("xsec_ncel", new neut::rew::NReWeightNuXSecNCEL);
-  if (xsec_nc)
-    fNeutRW->AdoptWghtCalc("xsec_nc", new neut::rew::NReWeightNuXSecNC);
-  if (xsec_ncres)
-    fNeutRW->AdoptWghtCalc("xsec_ncres", new neut::rew::NReWeightNuXSecNCRES);
-  if (nucl_casc)
-    fNeutRW->AdoptWghtCalc("nucl_casc", new neut::rew::NReWeightCasc);
-  if (nucl_piless)
-    fNeutRW->AdoptWghtCalc("nucl_piless", new neut::rew::NReWeightNuclPiless);
-  fNeutRW->Reconfigure();
-  StartTalking();
-}
-#endif
-
-//********************************************************************
-#ifdef __NIWG_ENABLED__
-void FitWeight::SetupNIWGRW() {
-//********************************************************************
-
-// EXTRA CHECK if NEUT is also enabled, just incase it was
-// missed at build time.
-#ifndef __NEUT_ENABLED__
-  ERR(FTL) << "Can't run NIWG event calculation without NEUT also enabled"
-           << std::endl;
-  ERR(FTL) << "Check your build configuration!" << std::endl;
-  exit(-1);
-#endif
-
-  // Now Setup the rw engine
-  LOG(FIT) << "Setting up NIWG RW" << std::endl;
-  fIsUsingNIWG = true;
-  fIsNIWGChanged = true;
-
-  // Create RW Engine
-  StopTalking();
-  fNIWGRW = new niwg::rew::NIWGReWeight();
-
-  // Get List of Veto Calcs (For Debugging)
-  std::string rw_engine_list =
-      FitPar::Config().GetParS("FitWeight.fNIWGRW_veto");
-  bool niwg_2012a = rw_engine_list.find("niwg_2012a") == std::string::npos;
-  bool niwg_2014a = rw_engine_list.find("niwg_2014a") == std::string::npos;
-  bool niwg_pimult = rw_engine_list.find("niwg_pimult") == std::string::npos;
-  bool niwg_mec = rw_engine_list.find("niwg_mec") == std::string::npos;
-  bool niwg_rpa = rw_engine_list.find("niwg_rpa") == std::string::npos;
-  bool niwg_eff_rpa = rw_engine_list.find("niwg_eff_rpa") == std::string::npos;
-  bool niwg_proton =
-      rw_engine_list.find("niwg_protonFSIbug") == std::string::npos;
-  bool niwg_hadron =
-      rw_engine_list.find("niwg_HadronMultSwitch") == std::string::npos;
-
-  // Add the RW Calcs
-  if (niwg_2012a)
-    fNIWGRW->AdoptWghtCalc("niwg_2012a", new niwg::rew::NIWGReWeight2012a);
-  if (niwg_2014a)
-    fNIWGRW->AdoptWghtCalc("niwg_2014a", new niwg::rew::NIWGReWeight2014a);
-  if (niwg_pimult)
-    fNIWGRW->AdoptWghtCalc("niwg_pimult", new niwg::rew::NIWGReWeightPiMult);
-  if (niwg_mec)
-    fNIWGRW->AdoptWghtCalc("niwg_mec", new niwg::rew::NIWGReWeightMEC);
-  if (niwg_rpa)
-    fNIWGRW->AdoptWghtCalc("niwg_rpa", new niwg::rew::NIWGReWeightRPA);
-  if (niwg_eff_rpa)
-    fNIWGRW->AdoptWghtCalc("niwg_eff_rpa",
-                           new niwg::rew::NIWGReWeightEffectiveRPA);
-  if (niwg_proton)
-    fNIWGRW->AdoptWghtCalc("niwg_protonFSIbug",
-                           new niwg::rew::NIWGReWeightProtonFSIbug);
-  if (niwg_hadron)
-    fNIWGRW->AdoptWghtCalc("niwg_HadronMultSwitch",
-                           new niwg::rew::NIWGReWeightHadronMultSwitch);
-
-  fNIWGRW->Reconfigure();
-  StartTalking();
-}
-#endif
-
-//********************************************************************
-#ifdef __NUWRO_REWEIGHT_ENABLED__
-void FitWeight::SetupNuwroRW() {
-  //********************************************************************
-
-  LOG(FIT) << "Setting up NuWro RW" << std::endl;
-
-  fIsUsingNuwro = true;
-  fIsNuwroChanged = true;
-
-  // Create the engine
-  fNuwroRW = new nuwro::rew::NuwroReWeight();
-
-  // Get List of Veto Calcs (For Debugging)
-  std::string rw_engine_list =
-      FitPar::Config().GetParS("FitWeight.fNuwroRW_veto");
-  bool xsec_qel = rw_engine_list.find("nuwro_QEL") == std::string::npos;
-  bool xsec_flag = rw_engine_list.find("nuwro_FlagNorm") == std::string::npos;
-  //bool xsec_res = rw_engine_list.find("nuwro_RES") == std::string::npos;
-
-  // Add the RW Calcs
-  if (xsec_qel)
-    fNuwroRW->AdoptWghtCalc("nuwro_QEL", new nuwro::rew::NuwroReWeight_QEL);
-  if (xsec_flag)
-    fNuwroRW->AdoptWghtCalc("nuwro_FlagNorm",
-                            new nuwro::rew::NuwroReWeight_FlagNorm);
-  // if (xsec_res)  fNuwroRW->AdoptWghtCalc( "nuwro_RES",  new
-  // nuwro::rew::NuwroReWeight_SPP );
-
-  fNuwroRW->Reconfigure();
-}
-#endif
-
-#ifdef __T2KREW_ENABLED__
-//********************************************************************
-void FitWeight::SetupT2KRW() {
-  //********************************************************************
-
-  LOG(FIT) << "Setting up T2K RW" << std::endl;
-  fIsUsingT2K = true;
-  fIsT2KChanged = true;
-
-  // Create Main RW Engine
-  fT2KRW = new t2krew::T2KReWeight();
-
-  // Setup Sub RW Engines (Only activated for neut and niwg)
-  fT2KNeutRW = new t2krew::T2KNeutReWeight();
-  fT2KNIWGRW = new t2krew::T2KNIWGReWeight();
-
-  fT2KRW->AdoptWghtEngine("fNeutRW", fT2KNeutRW);
-  fT2KRW->AdoptWghtEngine("fNIWGRW", fT2KNIWGRW);
-
-  fT2KRW->Reconfigure();
-}
-#endif
-
-#ifdef __GENIE_ENABLED__
-//********************************************************************
-void FitWeight::SetupGenieRW() {
-  //********************************************************************
-
-  LOG(FIT) << "Setting up GENIE RW" << std::endl;
-  fIsUsingGenie = true;
-  fIsGenieChanged = true;
-
-  // Create Engine
-  //  GHepRecord::SetPrintLevel(-2);
-  StopTalking(); // Really stop it from talking to me
-  fGenieRW = new genie::rew::GReWeight();
-
-  // Get List of Vetos (Just for debugging)
-  std::string rw_engine_list =
-      FitPar::Config().GetParS("FitWeight.fGenieRW_veto");
-  bool xsec_ncel = rw_engine_list.find("xsec_ncel") == std::string::npos;
-  bool xsec_ccqe = rw_engine_list.find("xsec_ccqe") == std::string::npos;
-  bool xsec_coh = rw_engine_list.find("xsec_coh") == std::string::npos;
-  bool xsec_nnres = rw_engine_list.find("xsec_nonresbkg") == std::string::npos;
-  bool xsec_nudis = rw_engine_list.find("nuclear_dis") == std::string::npos;
-  bool xsec_resdec =
-      rw_engine_list.find("hadro_res_decay") == std::string::npos;
-  bool xsec_fzone = rw_engine_list.find("hadro_intranuke") == std::string::npos;
-  bool xsec_intra = rw_engine_list.find("hadro_fzone") == std::string::npos;
-  bool xsec_agky = rw_engine_list.find("hadro_agky") == std::string::npos;
-  bool xsec_qevec = rw_engine_list.find("xsec_ccqe_vec") == std::string::npos;
-  bool xsec_dis = rw_engine_list.find("xsec_dis") == std::string::npos;
-  bool xsec_nc = rw_engine_list.find("xsec_nc") == std::string::npos;
-  bool xsec_ccres = rw_engine_list.find("xsec_ccres") == std::string::npos;
-  bool xsec_ncres = rw_engine_list.find("xsec_ncres") == std::string::npos;
-  bool xsec_nucqe = rw_engine_list.find("nuclear_qe") == std::string::npos;
-
-  // Now actually add the RW Calcs
-  if (xsec_ncel)
-    fGenieRW->AdoptWghtCalc("xsec_ncel", new genie::rew::GReWeightNuXSecNCEL);
-  if (xsec_ccqe)
-    fGenieRW->AdoptWghtCalc("xsec_ccqe", new genie::rew::GReWeightNuXSecCCQE);
-  if (xsec_coh)
-    fGenieRW->AdoptWghtCalc("xsec_coh", new genie::rew::GReWeightNuXSecCOH);
-  if (xsec_nnres)
-    fGenieRW->AdoptWghtCalc("xsec_nonresbkg",
-                            new genie::rew::GReWeightNonResonanceBkg);
-  if (xsec_nudis)
-    fGenieRW->AdoptWghtCalc("nuclear_dis", new genie::rew::GReWeightDISNuclMod);
-  if (xsec_resdec)
-    fGenieRW->AdoptWghtCalc("hadro_res_decay",
-                            new genie::rew::GReWeightResonanceDecay);
-  if (xsec_fzone)
-    fGenieRW->AdoptWghtCalc("hadro_fzone", new genie::rew::GReWeightFZone);
-  if (xsec_intra)
-    fGenieRW->AdoptWghtCalc("hadro_intranuke", new genie::rew::GReWeightINuke);
-  if (xsec_agky)
-    fGenieRW->AdoptWghtCalc("hadro_agky", new genie::rew::GReWeightAGKY);
-  if (xsec_qevec)
-    fGenieRW->AdoptWghtCalc("xsec_ccqe_vec",
-                            new genie::rew::GReWeightNuXSecCCQEvec);
-  if (xsec_dis)
-    fGenieRW->AdoptWghtCalc("xsec_dis", new genie::rew::GReWeightNuXSecDIS);
-  if (xsec_nc)
-    fGenieRW->AdoptWghtCalc("xsec_nc", new genie::rew::GReWeightNuXSecNC);
-  if (xsec_ccres)
-    fGenieRW->AdoptWghtCalc("xsec_ccres", new genie::rew::GReWeightNuXSecCCRES);
-  if (xsec_ncres)
-    fGenieRW->AdoptWghtCalc("xsec_ncres", new genie::rew::GReWeightNuXSecNCRES);
-  if (xsec_nucqe)
-    fGenieRW->AdoptWghtCalc("nuclear_qe", new genie::rew::GReWeightFGM);
-
-
-  GReWeightNuXSecCCQE * rwccqe =
-    dynamic_cast<GReWeightNuXSecCCQE *> (fGenieRW->WghtCalc("xsec_ccqe"));
-  rwccqe->SetMode(GReWeightNuXSecCCQE::kModeMa);
-  
-  // Default to include shape and normalization changes for CCRES (can be changed downstream if desired)      
-  GReWeightNuXSecCCRES * rwccres =
-    dynamic_cast<GReWeightNuXSecCCRES *> (fGenieRW->WghtCalc("xsec_ccres"));
-  rwccres->SetMode(GReWeightNuXSecCCRES::kModeMaMv);
-  
-  // Default to include shape and normalization changes for NCRES (can be changed downstream if desired)      
-  GReWeightNuXSecNCRES * rwncres =
-    dynamic_cast<GReWeightNuXSecNCRES *> (fGenieRW->WghtCalc("xsec_ncres"));
-  rwncres->SetMode(GReWeightNuXSecNCRES::kModeMaMv);
-  
-  // Default to include shape and normalization changes for DIS (can be changed downstream if desired)        
-  GReWeightNuXSecDIS * rwdis =
-    dynamic_cast<GReWeightNuXSecDIS *> (fGenieRW->WghtCalc("xsec_dis"));
-  rwdis->SetMode(GReWeightNuXSecDIS::kModeABCV12u);
-
-  fGenieRW->Reconfigure();
-  StopTalking(); // Talk again
-
-}
-#endif
-
-//********************************************************************
-double FitWeight::GetDialValue(std::string name, std::string option) {
-  //********************************************************************
-
-  int this_enum = this->GetDialEnum(name);
-  int this_pos = this->GetDialPos(this_enum);
-  double val = this->GetDialValue(this_enum);
-
-  if (!option.compare("ABS"))
-    return fDialFuncs[this_pos].Eval(val);
-  else if (!option.compare("FRC"))
-    return fDialFuncs[this_pos].Eval(val) / fDialFuncs[this_pos].Eval(0.0);
-  else
-    return val;
-}
-
-//********************************************************************
-double FitWeight::GetDialValue(int this_enum) {
-  //********************************************************************
-  unsigned int pos = this->GetDialPos(this_enum);
-  return fDialValues.at(pos);
-}
-
-//********************************************************************
-void FitWeight::UpdateWeightEngine(const double* x) {
-  //********************************************************************
-  this->SetAllDials(x, fDialEnums.size());
-  return;
-}
-
-//********************************************************************
-bool FitWeight::HasRWDialChanged(const double* x) {
-  //********************************************************************
-
-  for (unsigned int i = 0; i < fDialValues.size(); i++) {
-    int rw_enum = fDialEnums.at(i);
-
-    int id = int(rw_enum - (rw_enum % 1000)) / 1000;
-    if (id == kNORM) continue;
-
-    if (x[i] != fDialValues.at(i)) return true;
-  }
-
-  return false;
-}
-
-//********************************************************************
-void FitWeight::SetAllDials(const double* x, int npt) {
-  //********************************************************************
-  for (int i = 0; i < npt; i++) {
-    int this_enum = fDialEnums.at(i);
-    this->SetDialValue(this_enum, x[i]);
-  }
-  return;
-};
-
-//********************************************************************
-void FitWeight::GetAllDials(double* x, int npt) {
-  //********************************************************************
-
-  for (int i = 0; i < npt; i++) {
-    int this_enum = fDialEnums.at(i);
-    x[i] = this->GetDialValue(this_enum);
-  }
-
-  return;
-};
-
-//********************************************************************
-double FitWeight::GetSampleNorm(std::string samplename) {
-  //********************************************************************
-  std::string norm_dial = samplename + "_norm";
-
-  // Loop through and see if we have one
-  std::vector<std::string>::iterator naIter = fDialNames.begin();
-  bool found_dial = false;
-  for (; naIter != fDialNames.end(); naIter++) {
-    if (((std::string)(*naIter)) == norm_dial) {
-      found_dial = true;
-      break;
-    }
-  }
-
-  if (!found_dial && !samplename.empty()) {
-    LOG(FIT) << " Late initialisation of norm: " << norm_dial << std::endl;
-    this->IncludeDial(norm_dial, kNORM, 1.0);
-    this->Reconfigure();
-    return 1.0;
-
-  } else {
-    return this->GetDialValue(norm_dial);
-  }
-}
-
-//********************************************************************
-double FitWeight::GetSampleLikelihoodWeight(std::string samplename) {
-//********************************************************************
-  std::string norm_dial = samplename + "_weight";
-
-  // Loop through and see if we have one
-  std::vector<std::string>::iterator naIter = fDialNames.begin();
-  bool found_dial = false;
-  for (; naIter != fDialNames.end(); naIter++) {
-    if (((std::string)(*naIter)) == norm_dial) {
-      found_dial = true;
-      break;
-    }
-  }
-
-  if (!found_dial && !samplename.empty()) {
-    return 1.0;
-  } else {
-    return this->GetDialValue(norm_dial);
-  }  
-}
-
-//********************************************************************
-std::vector<std::string> FitWeight::GetDialNames() {
-  //********************************************************************
-  return fDialNames;
-}
-
-//********************************************************************
-std::vector<int> FitWeight::GetDialEnums() {
-  //********************************************************************
-  return fDialEnums;
-}
-
-//********************************************************************
-std::vector<double> FitWeight::GetDialValues() {
-  //********************************************************************
-  return fDialValues;
-}
-
-//********************************************************************
-void FitWeight::SetupEventCoeff(BaseFitEvt* event) {
-//********************************************************************
-  if (!fSplineHead) fSplineHead = new FitSplineHead();
-  fSplineHead->SetupEventWeights(event);
-}
-
-//********************************************************************
-void FitWeight::GenSplines(BaseFitEvt* event, bool save_graph) {
-  //********************************************************************
-
-  double nom = this->CalcWeight(event);
-  event->dial_coeff[0] = (nom);
-
-  // Get Current Dial Values and save to reset
-  std::list<FitSpline*>::iterator spl_iter = fSplineHead->SplineObjects.begin();
-  for (; spl_iter != fSplineHead->SplineObjects.end(); spl_iter++) {
-    FitSpline* spl = (*spl_iter);
-    int dim = spl->ndim;
-
-    // ND Splines
-    if (dim == 1)
-      this->Fit1DSplineCoeff(event, spl, nom, save_graph);
-    else if (dim == 2)
-      this->Fit2DSplineCoeff(event, spl, nom, save_graph);
-    else if (dim >= 3)
-      this->FitNDSplineCoeff(event, spl, nom, save_graph);
-  }
-  
-  return;
-}
-
-//********************************************************************
-void FitWeight::Fit2DSplineCoeff(BaseFitEvt* event, FitSpline* spl, double nom,
-                                 bool save_graph) {
-  //********************************************************************
-
-  int enum_x = spl->var_enums[0];
-  int enum_y = spl->var_enums[1];
-
-  double cur_x = this->GetDialValue(enum_x);
-  double cur_y = this->GetDialValue(enum_y);
-  //  int npar = spl->npar;
-
-  std::vector<double> knots_x = spl->x_vals[0];
-  std::vector<double> knots_y = spl->x_vals[1];
-  int n_knots_x = knots_x.size();
-  int n_knots_y = knots_y.size();
-
-  double val_x = 0.0;
-  double val_y = 0.0;
-  int count = 0;
-  double weightval = 0.0;
-  bool hasresponse = false;
-
-  TGraph2D gr_2D_scan = TGraph2D(n_knots_x * n_knots_y);
-
-  // Loop over grid
-  for (std::vector<double>::iterator iter_x = knots_x.begin();
-       iter_x != knots_x.end(); iter_x++) {
-    // X RW Value
-    val_x = (*iter_x);
-    this->SetDialValue(enum_x, val_x);
-    this->Reconfigure(true);
-
-    for (std::vector<double>::iterator iter_y = knots_y.begin();
-         iter_y != knots_y.end(); iter_y++) {
-      // Y RW Value
-      val_y = (*iter_y);
-      this->SetDialValue(enum_y, val_y);
-
-      weightval = this->CalcWeight(event) / nom;
-      if (weightval != 1.0) hasresponse = true;
-
-      gr_2D_scan.SetPoint(count, val_x, val_y, weightval);
-      count++;
-    }
-  }
-
-  // Save GRAPH
-  if (hasresponse and save_graph) {
-    gr_2D_scan.SetName(
-        Form("SplineFit_%s_%s", spl->id.c_str(), spl->form.c_str()));
-    std::vector<std::string> titles =
-        GeneralUtils::ParseToStr(spl->id, ",");
-    gr_2D_scan.SetTitle(Form("SplineFit_%s_%s;%s;%s;Weight Response",
-                             spl->id.c_str(), spl->form.c_str(),
-                             titles[0].c_str(), titles[1].c_str()));
-
-    gr_2D_scan.Write();
-  }
-
-  SetDialValue(enum_x, cur_x);
-  SetDialValue(enum_y, cur_y);
-
-  return;
-}
-
-//********************************************************************
-void FitWeight::Fit1DSplineCoeff(BaseFitEvt* event, FitSpline* spl, double nom,
-                                 bool save_graph) {
-  //********************************************************************
-
-  int this_enum = spl->var_enums[0];
-  double current = this->GetDialValue(this_enum);
-  int npar = spl->npar;
-  std::vector<double> knots = spl->x_vals[0];
-  int n_knots = knots.size();
-  double val = 0.0;
-
-  double* allweights;
-  double* allvals;
-  allweights = new double[n_knots];
-  allvals = new double[n_knots];
-
-  int count = 0;
-  double weightval = 0.0;
-
-  bool hasresponse = false;
-
-  for (std::vector<double>::iterator iter = knots.begin(); iter != knots.end();
-       iter++) {
-    val = (*iter);
-
-    SetDialValue(this_enum, val);
-    Reconfigure(true);
-    
-    weightval = this->CalcWeight(event) / nom;
-    if (weightval != 1.0) hasresponse = true;
-    
-    allweights[count] = weightval;
-    allvals[count++] = val;
-  }
-  
-  if (!hasresponse) {
-    event->dial_coeff[1] = -999.9;
-  }
-
-  TGraph* gr = new TGraph(n_knots, &knots[0], allweights);
-
-  TF1* f1 = NULL;
-  if (hasresponse){
-    f1 =  new TF1("f1", spl, -1.0 + knots[0], 1.0 + knots[knots.size() - 1], npar);
-    if (save_graph) f1->SetNpx(400);
-  }
-
-  // Check for TSpline3
-  if (hasresponse){
-    if (spl->needs_fit) {
-      gr->Fit(f1, "WQM");
-      for (int i = 0; i < npar; i++) {
-	event->dial_coeff[i + spl->offset] = (f1->GetParameter(i));
-      }
-    } else {
-      std::vector<double> dialcoeff = spl->GetSplineCoeff(allweights);
-      for (int i = 0; i < npar; i++) {
-	event->dial_coeff[i + spl->offset] = (dialcoeff[i]);
-	f1->FixParameter(i, dialcoeff[i]);
-      }
-      //gr->Fit(f1, "WQM");
-    }
-  } else {
-    for (int i = 0; i < npar; i++) {
-      event->dial_coeff[i + spl->offset] = -999.99;
-    }
-  }
-    
-  if (save_graph and hasresponse) {
-    TSpline3* spl3 =
-        new TSpline3(Form("Spline3_dial%i_%s_%s;%s;Weight Response", this_enum,
-                          spl->id.c_str(), spl->form.c_str(), spl->id.c_str()),
-                     &knots[0], allweights, n_knots);
-    TCanvas* c3 = new TCanvas("c3", "c3", 800, 600);
-    c3->cd();
-    spl3->SetLineColor(kBlue);
-    spl3->Draw("C");
-
-    gr->SetTitle(Form("SplineFit_dial%i_%s_%s;%s;Weight Response", this_enum,
-                      spl->id.c_str(), spl->form.c_str(), spl->id.c_str()));
-    gr->SetMarkerStyle(22);
-    gr->SetName(Form("SplineFit_dial%i_%s_%s", this_enum, spl->id.c_str(),
-                     spl->form.c_str()));
-    gr->Write();
-
-    gr->Draw("SAME P");
-    if (f1) f1->Draw("SAME C");
-    c3->Update();
-    c3->Write(Form("Spline3_dial%i_%s_%s;%s;Weight Response", this_enum,
-                   spl->id.c_str(), spl->form.c_str(), spl->id.c_str()));
-    delete c3;
-    delete spl3;
-  }
-
-  delete gr;
-  delete f1;
-  delete allweights;
-
-
-  SetDialValue(this_enum, current);
-  Reconfigure(true);
-}
-
-//********************************************************************
-void FitWeight::ReadSplineHead(FitSplineHead* splhead) {
-  //********************************************************************
-  fSplineHead = splhead;
-  fSplineHead->Reconfigure(this->fDialEnums, this->fDialValues);
-}
-
-//********************************************************************
-void FitWeight::SetupSpline(std::string dialname, std::string splinename,
-                            std::string points_def) {
-//********************************************************************
-
-  LOG(DEB) << "Setting up spline " << fSplineHead << endl;
-  // Create spline head if none setup
-  if (!fSplineHead) fSplineHead = new FitSplineHead();
-
-  // Parse Enum Mapping
-  std::vector<std::string> parsed_dials =
-      GeneralUtils::ParseToStr(dialname, ",");
-  std::vector<int> list_enums;
-  for (UInt_t i = 0; i < parsed_dials.size(); i++) {
-    list_enums.push_back(this->GetDialEnum(parsed_dials.at(i)));
-  }
-
-  // Add new spline
-  LOG(DEB) << "Added spline" << endl;
-  FitSpline* spl = new FitSpline(dialname, splinename, list_enums, points_def);
-  fSplineHead->AddSpline(spl);
-
-  return;
-}
-
-//********************************************************************
-void FitWeight::ResetSplines() {
-  //********************************************************************
-  delete fSplineHead;
-  fSplineHead = NULL;
-}
-
-//********************************************************************
-double FitWeight::CalcSplineWeight(BaseFitEvt* evt) {
-  //********************************************************************
-  double rw_weight = fSplineHead->CalcWeight(evt->dial_coeff);
-  return rw_weight;
-}
-
-//********************************************************************
-bool FitWeight::HasDialChanged() {
-  //********************************************************************
-  return fIsDialChanged;
-};
-
-// Global Conversion Functions
-// ---------------------------
-//********************************************************************
-TF1 FitBase::GetRWConvFunction(std::string type, std::string name) {
-//********************************************************************
-
-  std::string dialfunc = "x";
-  std::string parType = type;
-  double low = -10000.0;
-  double high = 10000.0;
-  if (parType.find("parameter") == std::string::npos) parType += "_parameter";
-
-  string line;
-  ifstream card(
-      (GeneralUtils::GetTopLevelDir() + "/parameters/dial_conversion.card").c_str(),
-      ifstream::in);
-
-  while (std::getline(card >> std::ws, line, '\n')) {
-    
-    std::vector<std::string> inputlist = GeneralUtils::ParseToStr(line, " ");
-
-    // Check the line length
-    if (inputlist.size() < 4) continue;
-
-    // Check whether this is a comment
-    if (inputlist[0].c_str()[0] == '#') continue;
-    
-    // Check whether this is the correct parameter type
-    if (inputlist[0].compare(parType) != 0) continue;
-    
-    // Check the parameter name
-    if (inputlist[1].compare(name) != 0) continue;
-       
-    // inputlist[2] should be the units... ignore for now
-
-    dialfunc = inputlist[3];
-    
-    // High and low are optional, check whether they exist
-    if (inputlist.size() > 4) low  = GeneralUtils::StrToDbl(inputlist[4]);
-    if (inputlist.size() > 5) high = GeneralUtils::StrToDbl(inputlist[5]);
-
-  }
-  
-  TF1 convfunc = TF1((name + "_convfunc").c_str(), dialfunc.c_str(), low, high);
-  return convfunc;
-}
-
-//********************************************************************
-std::string FitBase::GetRWUnits(std::string type, std::string name) {
-  //********************************************************************
-
-  std::string unit = "sig.";
-  std::string parType = type;
-
-  if (parType.find("parameter") == std::string::npos) {
-    parType += "_parameter";
-  }
-  
-  std::string line;
-  std::ifstream card((GeneralUtils::GetTopLevelDir() + "/parameters/dial_conversion.card").c_str(), ifstream::in);
-
-  while (std::getline(card >> std::ws, line, '\n')) {
-
-    std::vector<std::string> inputlist = GeneralUtils::ParseToStr(line, " ");
-
-    // Check the line length
-    if (inputlist.size() < 3) continue;
-    
-    // Check whether this is a comment
-    if (inputlist[0].c_str()[0] == '#') continue;
-
-    // Check whether this is the correct parameter type
-    if (inputlist[0].compare(parType) != 0) continue;
-
-    // Check the parameter name
-    if (inputlist[1].compare(name) != 0) continue;
-
-    unit = inputlist[2];
-    break;
-  }
-
-  return unit;
-}
-
-//********************************************************************
-double FitBase::RWAbsToSigma(std::string type, std::string name, double val) {
-  //********************************************************************
-  TF1 f1 = GetRWConvFunction(type, name);
-  double conv_val = f1.GetX(val);
-  if (fabs(conv_val) < 1E-10) conv_val = 0.0;
-  return conv_val;
-}
-
-//********************************************************************
-double FitBase::RWSigmaToAbs(std::string type, std::string name, double val) {
-  //********************************************************************
-  TF1 f1 = GetRWConvFunction(type, name);
-  double conv_val = f1.Eval(val);
-  return conv_val;
-}
-
-//********************************************************************
-double FitBase::RWFracToSigma(std::string type, std::string name, double val) {
-  //********************************************************************
-  TF1 f1 = GetRWConvFunction(type, name);
-  double conv_val = f1.GetX((val * f1.Eval(0.0)));
-  if (fabs(conv_val) < 1E-10) conv_val = 0.0;
-  return conv_val;
-}
-
-//********************************************************************
-double FitBase::RWSigmaToFrac(std::string type, std::string name, double val) {
-  //********************************************************************
-  TF1 f1 = GetRWConvFunction(type, name);
-  double conv_val = f1.Eval(val) / f1.Eval(0.0);
-  return conv_val;
-}
-
-
-
-int FitBase::ConvDialType(std::string type){
-
-  if      (!type.compare("neut_parameter")) return kNEUT;
-  else if (!type.compare("niwg_parameter")) return kNIWG;
-  else if (!type.compare("nuwro_parameter")) return kNUWRO;
-  else if (!type.compare("t2k_parameter")) return kT2K;
-  else if (!type.compare("genie_parameter")) return kGENIE;
-  else if (!type.compare("norm_parameter")) return kNORM;
-  else if (!type.compare("modenorm_parameter")) return kMODENORM;
-  else return kUNKNOWN;
-  
-}
-
-std::string FitBase::ConvDialType(int type){
-
-  switch(type){
-  case kNEUT:  { return "neut_parameter";  }
-  case kNIWG:  { return "niwg_parameter";  }
-  case kNUWRO: { return "nuwro_parameter"; }
-  case kT2K:   { return "t2k_parameter";   }
-  case kGENIE: { return "genie_parameter"; }
-  case kNORM:  { return "norm_parameter";  }
-  case kMODENORM: { return "modenorm_parameter"; }
-  default: return "unknown_parameter"; 
-  }
-  
-}
-
-int FitBase::GetDialEnum(std::string type, std::string name){
-  return FitBase::GetDialEnum( FitBase::ConvDialType(type), name );
-}
-
-int FitBase::GetDialEnum(int type, std::string name){
-
-  int offset = type * 1000;
-  int this_enum = -1; //Not Found
-
-  // Select Types
-  switch (type) {
-    
-  // NEUT DIAL TYPE
-  case kNEUT: {
-#ifdef __NEUT_ENABLED__  
-    int neut_enum = (int)neut::rew::NSyst::FromString(name);
-    if (neut_enum != 0){ this_enum = neut_enum + offset; }
-#else
-    this_enum = -2; //Not enabled
-#endif
-    break;
-  }
-    
-  // NIWG DIAL TYPE
-  case kNIWG: {
-#ifdef __NIWG_ENABLED__  
-    int niwg_enum = (int)niwg::rew::NIWGSyst::FromString(name);
-    if (niwg_enum != 0){ this_enum = niwg_enum + offset; }
-#else
-    this_enum = -2;
-#endif
-    break;
-  }
-
-  // NUWRO DIAL TYPE
-  case kNUWRO: {
-#ifdef __NUWRO_REWEIGHT_ENABLED__  
-    int nuwro_enum = (int)nuwro::rew::NuwroSyst::FromString(name);
-    if (nuwro_enum > 0){ this_enum = nuwro_enum + offset; }
-#else
-    this_enum = -2;
-#endif
-  }
-
-  // GENIE DIAL TYPE
-    case kGENIE: {
-#ifdef __GENIE_ENABLED__
-      int genie_enum = (int)genie::rew::GSyst::FromString(name);
-      if (genie_enum > 0){ this_enum = genie_enum + offset; }
-#else
-      this_enum = -2;
-#endif
-      break;
-    }
-
-    case kCUSTOM: {
-      int custom_enum = 0;  // PLACEHOLDER
-      this_enum = custom_enum + offset;
-      break;
-    }
-      
-      // T2K DIAL TYPE
-  case kT2K: {
-#ifdef __T2KREW_ENABLED__
-    int t2k_enum = (int)t2krew::T2KSyst::FromString(name);
-    if (t2k_enum > 0){ this_enum = t2k_enum + offset; }
-#else
-    this_enum = -2;
-#endif  
-    break;
-  }
- 
-  case kNORM: {
-    this_enum = offset + 1;
-    break;
-  }
-
-  case kMODENORM: {
-    size_t us_pos = name.find_first_of('_');
-    std::string numstr = name.substr(us_pos + 1);
-    int mode_num = std::atoi(numstr.c_str());
-    LOG(FTL) << "Getting mode num " << mode_num << endl;
-    if (!mode_num) {
-      ERR(FTL) << "Attempting to parse dial name: \"" << name
-	       << "\" as a mode norm dial but failed." << endl;
-      throw;
-    }
-    this_enum = 60 + mode_num + offset;
-    break;
-  }
-   
-
- 
-  }
-
-  // If Not Enabled
-  if (this_enum == -2){
-    ERR(FTL) << "RW Engine not supported for " << FitBase::ConvDialType(type) << endl;
-    ERR(FTL) << "Check dial " << name << endl;
-  }
-
-  // If Not Found
-  if (this_enum == -1){
-    ERR(FTL) << "Dial " << name << " not found." << endl;
-  }
-
-  return this_enum;
-}
diff --git a/src/FitBase/FitWeight.h b/src/FitBase/FitWeight.h
deleted file mode 100644
index 128d87a..0000000
--- a/src/FitBase/FitWeight.h
+++ /dev/null
@@ -1,282 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef __FIT_WEIGHT_H_SEEN__
-#define __FIT_WEIGHT_H_SEEN__
-
-#include <math.h>
-#include <stdlib.h>
-#include <time.h>
-#include <deque>
-#include <iomanip>
-#include <iostream>
-#include <map>
-#include <numeric>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "FitEvent.h"
-#include "TF1.h"
-#include "TObject.h"
-using namespace std;
-
-#ifdef __T2KREW_ENABLED__
-#include "T2KGenieReWeight.h"
-#include "T2KNIWGReWeight.h"
-#include "T2KNIWGUtils.h"
-#include "T2KNeutReWeight.h"
-#include "T2KNeutUtils.h"
-#include "T2KReWeight.h"
-using namespace t2krew;
-#endif
-
-#ifdef __NIWG_ENABLED__
-#include "NIWGReWeight.h"
-#include "NIWGReWeight1piAngle.h"
-#include "NIWGReWeight2010a.h"
-#include "NIWGReWeight2012a.h"
-#include "NIWGReWeight2014a.h"
-#include "NIWGReWeightDeltaMass.h"
-#include "NIWGReWeightEffectiveRPA.h"
-#include "NIWGReWeightHadronMultSwitch.h"
-#include "NIWGReWeightMEC.h"
-#include "NIWGReWeightPiMult.h"
-#include "NIWGReWeightProtonFSIbug.h"
-#include "NIWGReWeightRPA.h"
-#include "NIWGReWeightSpectralFunc.h"
-#include "NIWGReWeightSplineEnu.h"
-#include "NIWGSyst.h"
-#include "NIWGSystUncertainty.h"
-#endif
-
-#ifdef __NEUT_ENABLED__
-#include "NReWeight.h"
-#include "NReWeightCasc.h"
-#include "NReWeightNuXSecCCQE.h"
-#include "NReWeightNuXSecCCRES.h"
-#include "NReWeightNuXSecCOH.h"
-#include "NReWeightNuXSecDIS.h"
-#include "NReWeightNuXSecNC.h"
-#include "NReWeightNuXSecNCEL.h"
-#include "NReWeightNuXSecNCRES.h"
-#include "NReWeightNuXSecRES.h"
-#include "NReWeightNuclPiless.h"
-#include "NSyst.h"
-#include "NSystUncertainty.h"
-#include "neutpart.h"
-#include "neutvect.h"
-#endif
-
-#ifdef __NUWRO_ENABLED__
-#include "event1.h"
-#endif
-
-#ifdef __NUWRO_REWEIGHT_ENABLED__
-#include "NuwroReWeight.h"
-#include "NuwroReWeight_FlagNorm.h"
-#include "NuwroReWeight_QEL.h"
-#include "NuwroReWeight_SPP.h"
-#include "NuwroSyst.h"
-#include "NuwroSystUncertainty.h"
-#endif
-
-#ifdef __GENIE_ENABLED__
-#include "EVGCore/EventRecord.h"
-#include "EVGCore/EventRecord.h"
-#include "GHEP/GHepRecord.h"
-#include "GSyst.h"
-#include "GSystUncertainty.h"
-#include "Ntuple/NtpMCEventRecord.h"
-#include "ReWeight/GReWeight.h"
-#include "ReWeight/GReWeightAGKY.h"
-#include "ReWeight/GReWeightDISNuclMod.h"
-#include "ReWeight/GReWeightFGM.h"
-#include "ReWeight/GReWeightFZone.h"
-#include "ReWeight/GReWeightINuke.h"
-#include "ReWeight/GReWeightNonResonanceBkg.h"
-#include "ReWeight/GReWeightNuXSecCCQE.h"
-#include "ReWeight/GReWeightNuXSecCCQEvec.h"
-#include "ReWeight/GReWeightNuXSecCCRES.h"
-#include "ReWeight/GReWeightNuXSecCOH.h"
-#include "ReWeight/GReWeightNuXSecDIS.h"
-#include "ReWeight/GReWeightNuXSecNC.h"
-#include "ReWeight/GReWeightNuXSecNCEL.h"
-#include "ReWeight/GReWeightNuXSecNCRES.h"
-#include "ReWeight/GReWeightResonanceDecay.h"
-using namespace genie;
-using namespace genie::rew;
-#endif
-
-#include "FitSplineHead.h"
-#include "GeneratorUtils.h"
-#include "TCanvas.h"
-#include "TGraph2D.h"
-
-//******************************************
-class FitWeight {
-  //******************************************
-
- public:
-  FitWeight(std::string name, std::string inputfile);  // Open a fit result
-                                                          // file and grab the
-                                                          // ttree and setup
-                                                          // like that.
-  FitWeight(std::string name = "FitWeight");
-  ~FitWeight(){};
-
-  int GetDialEnum(std::string name, int type = -1);
-  int GetRWEnum(int dial_enum);
-
-  void IncludeDial(std::string name, int type, double startval = 0.0);
-
-  void SetDialValue(std::string name, double val);
-  void SetDialValue(int dial, double val);
-
-  double GetDialValue(std::string name, std::string option = "");
-  double GetDialValue(int dial);
-
-  unsigned int GetDialPos(std::string name);
-  unsigned int GetDialPos(int this_enum);
-
-  std::string GetDialType(int this_enum);
-
-  bool HasDialChanged();
-
-  void UpdateWeightEngine(const double* x);
-  void SetAllDials(const double* x, int npt);
-  void GetAllDials(double* x, int npt);
-  bool DialIncluded(std::string name);
-    
-  std::vector<std::string> GetDialNames();
-  std::vector<int> GetDialEnums();
-  std::vector<double> GetDialValues();
-
-  double GetSampleNorm(std::string samplename);
-
-  double CalcWeight(BaseFitEvt* evt);
-  double GetSampleLikelihoodWeight(std::string samplename);
-  
-  void PrintState();
-
-  void Reconfigure(bool silent = false);
-
-// GENERATOR SPECIFIC RW OBJECTS
-
-#ifdef __NEUT_ENABLED__  // --- NEUT BLOCK
-  void SetupNeutRW();
-  neut::rew::NReWeight* fNeutRW;
-#endif
-
-#ifdef __NIWG_ENABLED__  // --- NIWG BLOCK
-  void SetupNIWGRW();
-  niwg::rew::NIWGReWeight* fNIWGRW;
-#endif
-
-#ifdef __NUWRO_REWEIGHT_ENABLED__  // --- NUWRO BLOCK
-  void SetupNuwroRW();
-  nuwro::rew::NuwroReWeight* fNuwroRW;
-#endif
-
-#ifdef __T2KREW_ENABLED__  // --- T2KRW BLOCK
-  void SetupT2KRW();
-  t2krew::T2KReWeight* fT2KRW;  //!< T2K RW Object
-  t2krew::T2KNeutReWeight* fT2KNeutRW;
-  t2krew::T2KNIWGReWeight* fT2KNIWGRW;
-#endif
-
-#ifdef __GENIE_ENABLED__  // --- GENIE BLOCK
-  void SetupGenieRW();
-  genie::rew::GReWeight* fGenieRW;  //!< Genie RW Object
-#endif
-
-  // SPLINE FUNCTIONS ------------
-  inline FitSplineHead* GetSplineHeader() { return fSplineHead; };
-  void SetupEventCoeff(BaseFitEvt* event);
-  void SetupSpline(std::string dialname, std::string splinename,
-                   std::string pointsdef);
-  double CalcSplineWeight(BaseFitEvt* evt);
-  void ReadSplineHead(FitSplineHead* splhead);
-  void ResetSplines();
-  void GenSplines(BaseFitEvt* evt, bool save_graph = false);
-
-  void Fit1DSplineCoeff(BaseFitEvt* event, FitSpline* spl, double nom,
-                        bool save_graph);
-  void Fit2DSplineCoeff(BaseFitEvt* event, FitSpline* spl, double nom,
-                        bool save_graph);
-  void FitNDSplineCoeff(BaseFitEvt* event, FitSpline* spl, double norm,
-                        bool save_graph) {
-    (void)event;
-    (void)spl;
-    (void)norm;
-    (void)save_graph;
-  };
-
-  bool HasRWDialChanged(const double* x);
-
- private:
-  int fNormEnum;
-
-  vector<std::string> fDialNames;
-  vector<int>  fDialEnums;
-  vector<double> fDialValues;
-  vector<TF1> fDialFuncs;
-  vector<std::string> fDialUnits;
-
-  std::string fName;
-
-  bool fIsUsingNeut;
-  bool fIsUsingGenie;
-  bool fIsUsingNIWG;
-  bool fIsUsingT2K;
-  bool fIsUsingNuwro;
-  bool fIsUsingModeNorm;
-
-  bool fIsDialChanged;
-  bool fIsNeutChanged;
-  bool fIsGenieChanged;
-  bool fIsNIWGChanged;
-  bool fIsNuwroChanged;
-  bool fIsT2KChanged;
-
-  bool fSilenceWeightCalc;
-  
-  bool fSetAbsTwk;
-
-  FitSplineHead* fSplineHead;
-};
-
-// GLOBAL FUNCTIONS FOR PAR CONV ----
-namespace FitBase {
-
-TF1 GetRWConvFunction(std::string type, std::string name);
-std::string GetRWUnits(std::string type, std::string name);
-
-double RWSigmaToFrac(std::string type, std::string name, double val);
-double RWSigmaToAbs(std::string type, std::string name, double val);
-double RWAbsToSigma(std::string type, std::string name, double val);
-double RWFracToSigma(std::string type, std::string name, double val);
-
- int ConvDialType(std::string type);
- std::string ConvDialType(int type);
- int GetDialEnum(std::string type, std::string name);
- int GetDialEnum(int type, std::string name);
-}
-
-#endif
diff --git a/src/FitBase/GeneratorUtils.cxx b/src/FitBase/GeneratorUtils.cxx
deleted file mode 100644
index 920fc02..0000000
--- a/src/FitBase/GeneratorUtils.cxx
+++ /dev/null
@@ -1,1183 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#include <iostream>
-
-#include "FitLogger.h"
-#include "GeneratorUtils.h"
-
-namespace GeneratorUtils {
-
-const std::string NEUT_TreeName = "neuttree";
-const std::string NuWro_TreeName = "treeout";
-const std::string GENIE_TreeName = "gtree";
-const std::string GiBUU_TreeName = "giRooTracker";
-}
-
-#ifdef __NEUT_ENABLED__
-void GeneratorUtils::FillNeutCommons(NeutVect* nvect) {
-  // WARNING: This has only been implemented for a neuttree and not GENIE
-  // This should be kept in sync with T2KNIWGUtils::GetNIWGEvent(TTree)
-
-  // NEUT version info.  Can't get it to compile properly with this yet
-  // neutversion_.corev  =   nvect->COREVer;
-  // neutversion_.nucev  =   nvect->NUCEVer;
-  // neutversion_.nuccv  =   nvect->NUCCVer;
-
-  // Documentation: See nework.h
-  nework_.modene = nvect->Mode;
-  nework_.numne = nvect->Npart();
-
-  nemdls_.mdlqeaf = nvect->QEVForm;
-  nemdls_.mdlqe = nvect->QEModel;
-  nemdls_.mdlspi = nvect->SPIModel;
-  nemdls_.mdldis = nvect->DISModel;
-  nemdls_.mdlcoh = nvect->COHModel;
-  neutcoh_.necohepi = nvect->COHModel;
-
-  nemdls_.xmaqe = nvect->QEMA;
-  nemdls_.xmvqe = nvect->QEMV;
-  nemdls_.kapp = nvect->KAPPA;
-
-  // nemdls_.sccfv = SCCFVdef;
-  // nemdls_.sccfa = SCCFAdef;
-  // nemdls_.fpqe = FPQEdef;
-
-  nemdls_.xmaspi = nvect->SPIMA;
-  nemdls_.xmvspi = nvect->SPIMV;
-  nemdls_.xmares = nvect->RESMA;
-  nemdls_.xmvres = nvect->RESMV;
-
-  neut1pi_.xmanffres = nvect->SPIMA;
-  neut1pi_.xmvnffres = nvect->SPIMV;
-  neut1pi_.xmarsres = nvect->RESMA;
-  neut1pi_.xmvrsres = nvect->RESMV;
-  neut1pi_.neiff = nvect->SPIForm;
-  neut1pi_.nenrtype = nvect->SPINRType;
-  neut1pi_.rneca5i = nvect->SPICA5I;
-  neut1pi_.rnebgscl = nvect->SPIBGScale;
-
-  nemdls_.xmacoh = nvect->COHMA;
-  nemdls_.rad0nu = nvect->COHR0;
-  // nemdls_.fa1coh = nvect->COHA1err;
-  // nemdls_.fb1coh = nvect->COHb1err;
-
-  // neutdis_.nepdf = NEPDFdef;
-  // neutdis_.nebodek = NEBODEKdef;
-
-  neutcard_.nefrmflg = nvect->FrmFlg;
-  neutcard_.nepauflg = nvect->PauFlg;
-  neutcard_.nenefo16 = nvect->NefO16;
-  neutcard_.nemodflg = nvect->ModFlg;
-  // neutcard_.nenefmodl = 1;
-  // neutcard_.nenefmodh = 1;
-  // neutcard_.nenefkinh = 1;
-  // neutpiabs_.neabspiemit = 1;
-
-  nenupr_.iformlen = nvect->FormLen;
-
-  neutpiless_.ipilessdcy = nvect->IPilessDcy;
-  neutpiless_.rpilessdcy = nvect->RPilessDcy;
-
-  neutpiless_.ipilessdcy = nvect->IPilessDcy;
-  neutpiless_.rpilessdcy = nvect->RPilessDcy;
-
-  neffpr_.fefqe = nvect->NuceffFactorPIQE;
-  neffpr_.fefqeh = nvect->NuceffFactorPIQEH;
-  neffpr_.fefinel = nvect->NuceffFactorPIInel;
-  neffpr_.fefabs = nvect->NuceffFactorPIAbs;
-  neffpr_.fefcx = nvect->NuceffFactorPICX;
-  neffpr_.fefcxh = nvect->NuceffFactorPICXH;
-
-  neffpr_.fefcoh = nvect->NuceffFactorPICoh;
-  neffpr_.fefqehf = nvect->NuceffFactorPIQEHKin;
-  neffpr_.fefcxhf = nvect->NuceffFactorPICXKin;
-  neffpr_.fefcohf = nvect->NuceffFactorPIQELKin;
-
-  for (int i = 0; i < nework_.numne; i++) {
-    nework_.ipne[i] = nvect->PartInfo(i)->fPID;
-    nework_.pne[i][0] =
-        (float)nvect->PartInfo(i)->fP.X() / 1000;  // VC(NE)WORK in M(G)eV
-    nework_.pne[i][1] =
-        (float)nvect->PartInfo(i)->fP.Y() / 1000;  // VC(NE)WORK in M(G)eV
-    nework_.pne[i][2] =
-        (float)nvect->PartInfo(i)->fP.Z() / 1000;  // VC(NE)WORK in M(G)eV
-  }
-  // fsihist.h
-
-  // neutroot fills a dummy object for events with no FSI to prevent memory leak
-  // when
-  // reading the TTree, so check for it here
-
-  if ((int)nvect->NfsiVert() ==
-      1) {  // An event with FSI must have at least two vertices
-    //    if (nvect->NfsiPart()!=1 || nvect->Fsiprob!=-1)
-    //      ERR(WRN) << "T2KNeutUtils::fill_neut_commons(TTree) NfsiPart!=1 or
-    //      Fsiprob!=-1 when NfsiVert==1" << endl;
-
-    fsihist_.nvert = 0;
-    fsihist_.nvcvert = 0;
-    fsihist_.fsiprob = 1;
-  } else {  // Real FSI event
-    fsihist_.nvert = (int)nvect->NfsiVert();
-    for (int ivert = 0; ivert < fsihist_.nvert; ivert++) {
-      fsihist_.iflgvert[ivert] = nvect->FsiVertInfo(ivert)->fVertID;
-      fsihist_.posvert[ivert][0] = (float)nvect->FsiVertInfo(ivert)->fPos.X();
-      fsihist_.posvert[ivert][1] = (float)nvect->FsiVertInfo(ivert)->fPos.Y();
-      fsihist_.posvert[ivert][2] = (float)nvect->FsiVertInfo(ivert)->fPos.Z();
-    }
-
-    fsihist_.nvcvert = nvect->NfsiPart();
-    for (int ip = 0; ip < fsihist_.nvcvert; ip++) {
-      fsihist_.abspvert[ip] = (float)nvect->FsiPartInfo(ip)->fMomLab;
-      fsihist_.abstpvert[ip] = (float)nvect->FsiPartInfo(ip)->fMomNuc;
-      fsihist_.ipvert[ip] = nvect->FsiPartInfo(ip)->fPID;
-      fsihist_.iverti[ip] = nvect->FsiPartInfo(ip)->fVertStart;
-      fsihist_.ivertf[ip] = nvect->FsiPartInfo(ip)->fVertEnd;
-      fsihist_.dirvert[ip][0] = (float)nvect->FsiPartInfo(ip)->fDir.X();
-      fsihist_.dirvert[ip][1] = (float)nvect->FsiPartInfo(ip)->fDir.Y();
-      fsihist_.dirvert[ip][2] = (float)nvect->FsiPartInfo(ip)->fDir.Z();
-    }
-    fsihist_.fsiprob = nvect->Fsiprob;
-  }
-
-  neutcrscom_.crsx = nvect->Crsx;
-  neutcrscom_.crsy = nvect->Crsy;
-  neutcrscom_.crsz = nvect->Crsz;
-  neutcrscom_.crsphi = nvect->Crsphi;
-  neutcrscom_.crsq2 = nvect->Crsq2;
-
-  neuttarget_.numbndn = nvect->TargetA - nvect->TargetZ;
-  neuttarget_.numbndp = nvect->TargetZ;
-  neuttarget_.numfrep = nvect->TargetH;
-  neuttarget_.numatom = nvect->TargetA;
-  posinnuc_.ibound = nvect->Ibound;
-
-  // put empty nucleon FSI history (since it is not saved in the NeutVect
-  // format)
-  // Comment out as NEUT does not have the necessary proton FSI information yet
-  //  nucleonfsihist_.nfnvert = 0;
-  //  nucleonfsihist_.nfnstep = 0;
-}
-#endif
-
-#ifdef __NIWG_ENABLED__
-niwg::rew::NIWGEvent* GeneratorUtils::GetNIWGEvent(NeutVect* nvect) {
-  niwg::rew::NIWGEvent* fDummyNIWGEvent = NULL;
-
-  fDummyNIWGEvent = new niwg::rew::NIWGEvent();
-  fDummyNIWGEvent->detid = 1;  // MiniBooNE (apply CCQE LowE variations)
-  fDummyNIWGEvent->neutmode = nvect->Mode;
-  fDummyNIWGEvent->targetA = nvect->TargetA;
-  fDummyNIWGEvent->recenu_ccqe_sk = -1;
-  if (nvect->Ibound == 0)
-    fDummyNIWGEvent->targetA = 1;  // RT: identifies as H, rather than O16
-
-  // Fill initial particle stack
-  for (int ip = 0; ip < nvect->Npart(); ++ip) {
-    niwg::rew::NIWGPartStack fDummyPartStack;
-
-    fDummyPartStack.p = (nvect->PartInfo(ip)->fP) * 0.001;  // Convert to GeV
-
-    fDummyPartStack.pdg = nvect->PartInfo(ip)->fPID;
-    fDummyPartStack.chase = nvect->PartInfo(ip)->fIsAlive;
-    fDummyPartStack.parent =
-        nvect->ParentIdx(ip) -
-        1;  // WARNING: this needs to be tested with a NeutRoot file
-
-    fDummyNIWGEvent->part_stack.push_back(fDummyPartStack);
-  }
-  fDummyNIWGEvent->CalcKinematics();
-
-  return fDummyNIWGEvent;
-}
-#endif  // neut enabled
-
-#ifdef __NUWRO_ENABLED__
-
-int nof(event* e, int pdg) {
-  int c = 0;
-  for (size_t i = 0; i < e->out.size(); i++)
-    if (e->out[i].pdg == pdg) c++;
-  return c;
-}
-
-//***************************************************
-int GeneratorUtils::ConvertNuwroMode(event* e)
-//***************************************************
-{
-  Int_t proton_pdg, neutron_pdg, pion_pdg, pion_plus_pdg, pion_minus_pdg,
-      lambda_pdg, eta_pdg, kaon_pdg, kaon_plus_pdg;
-  proton_pdg = 2212;
-  eta_pdg = 221;
-  neutron_pdg = 2112;
-  pion_pdg = 111;
-  pion_plus_pdg = 211;
-  pion_minus_pdg = -211;
-  // O_16_pdg = 100069;   // oznacznie z Neuta
-  lambda_pdg = 3122;
-  kaon_pdg = 311;
-  kaon_plus_pdg = 321;
-
-  if (e->flag.qel)  // kwiazielastyczne oddziaływanie
-  {
-    if (e->flag.anty)  // jeśli jest to oddziaływanie z antyneutrinem
-    {
-      if (e->flag.cc)
-        return -1;
-      else {
-        if (nof(e, proton_pdg))
-          return -51;
-        else if (nof(e, neutron_pdg))
-          return -52;  // sprawdzam dodatkowo ?
-      }
-    } else  // oddziaływanie z neutrinem
-    {
-      if (e->flag.cc)
-        return 1;
-      else {
-        if (nof(e, proton_pdg))
-          return 51;
-        else if (nof(e, neutron_pdg))
-          return 52;
-      }
-    }
-  }
-
-  if (e->flag.mec) {
-    if (e->flag.anty)
-      return -2;
-    else
-      return 2;
-  }
-
-  if (e->flag.res)  // rezonansowa produkcja: pojedynczy pion, pojed.eta, kaon,
-                    // multipiony
-  {
-    Int_t liczba_pionow, liczba_kaonow;
-
-    liczba_pionow =
-        nof(e, pion_pdg) + nof(e, pion_plus_pdg) + nof(e, pion_minus_pdg);
-    liczba_kaonow = nof(e, kaon_pdg) + nof(e, kaon_pdg);
-
-    if (liczba_pionow > 1 || liczba_pionow == 0)  // multipiony
-    {
-      if (e->flag.anty) {
-        if (e->flag.cc)
-          return -21;
-        else
-          return -41;
-      } else {
-        if (e->flag.cc)
-          return 21;
-        else
-          return 41;
-      }
-    }
-
-    if (liczba_pionow == 1) {
-      if (e->flag.anty)  // jeśli jest to oddziaływanie z antyneutrinem
-      {
-        if (e->flag.cc) {
-          if (nof(e, neutron_pdg) && nof(e, pion_minus_pdg)) return -11;
-          if (nof(e, neutron_pdg) && nof(e, pion_pdg)) return -12;
-          if (nof(e, proton_pdg) && nof(e, pion_minus_pdg)) return -13;
-        } else {
-          if (nof(e, proton_pdg)) {
-            if (nof(e, pion_minus_pdg))
-              return -33;
-            else if (nof(e, pion_pdg))
-              return -32;
-          } else if (nof(e, neutron_pdg)) {
-            if (nof(e, pion_plus_pdg))
-              return -34;
-            else if (nof(e, pion_pdg))
-              return -31;
-          }
-        }
-      } else  // oddziaływanie z neutrinem
-      {
-        if (e->flag.cc) {
-          if (nof(e, proton_pdg) && nof(e, pion_plus_pdg)) return 11;
-          if (nof(e, proton_pdg) && nof(e, pion_pdg)) return 12;
-          if (nof(e, neutron_pdg) && nof(e, pion_plus_pdg)) return 13;
-        } else {
-          if (nof(e, proton_pdg)) {
-            if (nof(e, pion_minus_pdg))
-              return 33;
-            else if (nof(e, pion_pdg))
-              return 32;
-          } else if (nof(e, neutron_pdg)) {
-            if (nof(e, pion_plus_pdg))
-              return 34;
-            else if (nof(e, pion_pdg))
-              return 31;
-          }
-        }
-      }
-    }
-
-    if (nof(e, eta_pdg))  // produkcja rezonansowa ety
-    {
-      if (e->flag.anty)  // jeśli jest to oddziaływanie z antyneutrinem
-      {
-        if (e->flag.cc)
-          return -22;
-        else {
-          if (nof(e, neutron_pdg))
-            return -42;
-          else if (nof(e, proton_pdg))
-            return -43;  // sprawdzam dodatkowo ?
-        }
-      } else  // oddziaływanie z neutrinem
-      {
-        if (e->flag.cc)
-          return 22;
-        else {
-          if (nof(e, neutron_pdg))
-            return 42;
-          else if (nof(e, proton_pdg))
-            return 43;
-        }
-      }
-    }
-
-    if (nof(e, lambda_pdg) == 1 &&
-        liczba_kaonow == 1)  // produkcja rezonansowa kaonu
-    {
-      if (e->flag.anty)  // jeśli jest to oddziaływanie z antyneutrinem
-      {
-        if (e->flag.cc && nof(e, kaon_pdg))
-          return -23;
-        else {
-          if (nof(e, kaon_pdg))
-            return -44;
-          else if (nof(e, kaon_plus_pdg))
-            return -45;
-        }
-      } else  // oddziaływanie z neutrinem
-      {
-        if (e->flag.cc && nof(e, kaon_plus_pdg))
-          return 23;
-        else {
-          if (nof(e, kaon_pdg))
-            return 44;
-          else if (nof(e, kaon_plus_pdg))
-            return 45;
-        }
-      }
-    }
-  }
-
-  if (e->flag.coh)  // koherentne  oddziaływanie tylko na O(16)
-  {
-    Int_t _target;
-    _target = e->par.nucleus_p + e->par.nucleus_n;  // liczba masowa  O(16)
-
-    if (_target == 16) {
-      if (e->flag.anty)  // jeśli jest to oddziaływanie z antyneutrinem
-      {
-        if (e->flag.cc && nof(e, pion_minus_pdg))
-          return -16;
-        else if (nof(e, pion_pdg))
-          return -36;
-      } else  // oddziaływanie z neutrinem
-      {
-        if (e->flag.cc && nof(e, pion_plus_pdg))
-          return 16;
-        else if (nof(e, pion_pdg))
-          return 36;
-      }
-    }
-  }
-
-  // gleboko nieelastyczne rozpraszanie
-  if (e->flag.dis) {
-    if (e->flag.anty) {
-      if (e->flag.cc)
-        return -26;
-      else
-        return -46;
-    } else {
-      if (e->flag.cc)
-        return 26;
-      else
-        return 46;
-    }
-  }
-
-  return 9999;
-}
-
-#endif
-
-#ifdef __NUANCE_ENABLED__
-int GeneratorUtils::ConvertNuanceMode(NuanceEvent* evt) {
-  int ch = evt->channel;
-  int sg = 1;
-  if (evt->neutrino < 0) sg = -1;
-
-  switch (ch) {
-    //  1 NUANCE CCQE -> NEUT CCQE 1
-    case 1:
-      return sg * 1;
-    //  2 NUANCE NCEL -> NEUT NCEL 51,52 -> Set from whether target is p or n
-    case 2:
-      if (evt->target == 2212)
-        return sg * 51;
-      else
-        return sg * 52;
-
-    // 3 NUANCE CCPIP -> NEUT CCPIP 11
-    case 3:
-      return sg * 11;
-    // 4 NUANCE CCPI0 -> NEUT CCPI0 = 12
-    case 4:
-      return sg * 12;
-    // 5 NUANCE CCPIPn -> NEUT CCPIPn 13
-    case 5:
-      return sg * 13;
-    // 6 NUANCE NCpPI0 -> NEUT NCpPI0  32
-    case 6:
-      return sg * 32;
-    // 7 NUANCE NCpPI+ -> NEUT NCpPI+  34
-    case 7:
-      return sg * 34;
-    // 8 NUANCE NCnPI0 -> NEUT NCnPI0  31
-    case 8:
-      return sg * 31;
-    // 9  NUANCE NCnPIM -> NEUT NCnPIM  33
-    case 9:
-      return sg * 33;
-    // 10 NUANCE CCPIP -> NEUT CCPIP -11
-    case 10:
-      return sg * 11;
-    // 11 NUANCE CCPI0 -> NEUT CCPI0 -12
-    case 11:
-      return sg * 12;
-    // 12 NUANCE CCPIPn -> NEUT CCPIPn 13
-    case 12:
-      return sg * 13;
-    // 13 NUANCE NCpPI0 -> NEUT NCnPI0 -32
-    case 13:
-      return sg * 32;
-    // 14 NUANCE NCpPI+ -> NEUT NCpPI+ -34
-    case 14:
-      return sg * 34;
-    // 15 NUANCE NCnPI0 -> NEUT NCnPI0 -31
-    case 15:
-      return sg * 31;
-    // 16 NUANCE NCnPIM -> NEUT NCnPIM -33
-    case 16:
-      return sg * 33;
-    // 17 NUANCE -> NEUT 21 CC MULTIPI
-    case 17:
-      return sg * 21;
-    // 18 NUANCE -> NEUT 21 CC MULTIPI
-    case 18:
-      return sg * 21;
-    // 19 NUANCE -> NEUT 21 CC MULTIPI
-    case 19:
-      return sg * 21;
-    // 20 NUANCE -> NEUT 21  CC MULTIPI
-    case 20:
-      return sg * 21;
-    // 21 NUANCE -> NEUT 21  CC MULTIPI
-    case 21:
-      return sg * 21;
-    // 22 NUANCE -> NEUT 41 NC MULTIPI
-    case 22:
-      return sg * 41;
-    // 23 NUANCE -> NEUT 41 NC MULTIPI
-    case 23:
-      return sg * 41;
-    // 24 NUANCE -> NEUT 41 NC MULTIPI
-    case 24:
-      return sg * 41;
-    // 25 NUANCE -> NEUT 41 NC MULTIPI
-    case 25:
-      return sg * 41;
-    // 26 NUANCE -> NEUT 41 NC MULTIPI
-    case 26:
-      return sg * 41;
-    // 27 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 27:
-      return sg * 41;
-    // 28 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
-    case 28:
-      return sg * 21;
-    // 29 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
-    case 29:
-      return sg * 21;
-    // 30 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
-    case 30:
-      return sg * 21;
-    // 31 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
-    case 31:
-      return sg * 21;
-    // 32 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
-    case 32:
-      return sg * 21;
-    // 33 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 33:
-      return sg * 41;
-    // 34 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 34:
-      return sg * 41;
-    // 35 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 35:
-      return sg * 41;
-    // 36 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 36:
-      return sg * 41;
-    // 37 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 37:
-      return sg * 41;
-    // 38 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
-    case 38:
-      return sg * 41;
-
-    // 39 NUANCE -> NEUT 22
-    case 39:
-      return sg * 22;
-    // 40 NUANCE -> NEUT 22
-    case 40:
-      return sg * 22;
-    // 41 NUANCE -> NEUT 22
-    case 41:
-      return sg * 22;
-    // 42 NUANCE -> NEUT 43
-    case 42:
-      return sg * 43;
-    // 43 NUANCE -> NEUT 43
-    case 43:
-      return sg * 43;
-    // 44 NUANCE -> NUET 42
-    case 44:
-      return sg * 42;
-    // 45 NUANCE -> NEUT -42
-    case 45:
-      return sg * 42;
-    // 46 NUANCE -> NEUT -22
-    case 46:
-      return sg * 22;
-    // 47 NUANCE -> NEUT -22
-    case 47:
-      return sg * 22;
-    // 48 NUANCE -> NEUT -22
-    case 48:
-      return sg * 22;
-    // 49 NUANCE -> NEUT -43
-    case 49:
-      return sg * 43;
-    // 50 NUANCE -> NEUT -43
-    case 50:
-      return sg * 43;
-    // 51 NUANCE -> NEUT -42
-    case 51:
-      return sg * 42;
-    // 52 NUANCE -> NEUT -42
-    case 52:
-      return sg * 42;
-
-    // 53 NUANCE -> NEUT 23 CC 1K
-    case 53:
-      return sg * 23;
-    // 54 NUANCE -> NEUT 23 CC 1K
-    case 54:
-      return sg * 23;
-    // 55 NUANCE -> NEUT 23 CC 1K
-    case 55:
-      return sg * 23;
-    // 56 NUANCE -> NEUT 45 NC 1K
-    case 56:
-      return sg * 45;
-    // 57 NUANCE -> NEUT 44 NC 1K
-    case 57:
-      return sg * 44;
-    // 58 NUANCE -> NEUT 44 NC 1K
-    case 58:
-      return sg * 44;
-    // 59 NUANCE -> NEUT 44 NC 1K
-    case 59:
-      return sg * 44;
-    // 60 NUANCE -> NEUT -23 CC 1K
-    case 60:
-      return sg * 23;
-    // 61 NUANCE -> NEUT -23 CC 1K
-    case 61:
-      return sg * 23;
-    // 62 NUANCE -> NEUT -23 CC 1K
-    case 62:
-      return sg * 23;
-    // 63 NUANCE -> NEUT -23 CC 1K
-    case 63:
-      return sg * 23;
-    // 64 NUANCE -> NEUT -44 NC 1K
-    case 64:
-      return sg * 44;
-    // 65 NUANCE -> NEUT -44 NC 1K
-    case 65:
-      return sg * 44;
-    // 66 NUANCE -> NEUT -45 NC 1K
-    case 66:
-      return sg * 45;
-    // 67  NUANCE -> NEUT 22  CC1eta
-    case 67:
-      return sg * 22;
-    // 68 NUANCE -> NEUT 43 NC p eta
-    case 68:
-      return sg * 43;
-    // 69 NUANCE -> NEUT 43 NC n eta
-    case 69:
-      return sg * 43;
-    // 70 NUANCE -> NEUT -22 CC1eta
-    case 70:
-      return sg * 22;
-    // 71 NUANCE -> NEUT -43 NC p eta
-    case 71:
-      return sg * 43;
-    // 72 NUANCE -> NEUT 42 NC n eta
-    case 72:
-      return sg * 42;
-
-    // 73 NUANCE -> NEUT 21 CC Multi Pi
-    case 73:
-      return sg * 21;
-    // 74 NUANCE -> NEUT 41 NC Multi Pi
-    case 74:
-      return sg * 41;
-    // 75 NUANCE -> NEUT 41 NC Multi Pi
-    case 75:
-      return sg * 41;
-    // 76 NUANCE -> NEUT -21 CC Multi Pi
-    case 76:
-      return sg * 21;
-    // 77 NUANCE -> NEUT -41 NC Multi Pi
-    case 77:
-      return sg * 41;
-    // 78 NUANCE -> NEUT -41 NC Multi Pi
-    case 78:
-      return sg * 41;
-    //  79  NUANCE -> NEUT 21 CC Multi Pi
-    case 79:
-      return sg * 21;
-    // 80 NUANCE -> NEUT 21 CC Multi Pi
-    case 80:
-      return sg * 21;
-    // 81 NUANCE -> NEUT 41 NC Multi Pi
-    case 81:
-      return sg * 41;
-    // 82 NUANCE -> NEUT 41 NC Multi Pi
-    case 82:
-      return sg * 41;
-    // 83 NUANCE -> NEUT 41 NC Multi Pi
-    case 83:
-      return sg * 41;
-    // 84 NUANCE -> NEUT 41 NC Multi Pi
-    case 84:
-      return sg * 84;
-    // 85 NUANCE -> NEUT -21 CC Multi Pi
-    case 85:
-      return sg * 21;
-    // 86 NUANCE -> NEUT -21  CC Multi Pi
-    case 86:
-      return sg * 21;
-    // 87 NUANCE -> NEUT -41 CC Multi Pi
-    case 87:
-      return sg * 41;
-    // 88 NUANCE -> NEUT -41
-    case 88:
-      return sg * 41;
-    // 89 NUANCE -> NEUT -41
-    case 89:
-      return sg * 41;
-    // 90 NUANCE -> NEUT -41
-    case 90:
-      return sg * 41;
-
-    // 91 NUANCE -> NEUT 26  CC DIS
-    case 91:
-      return sg * 26;
-    // 92 NUANCE -> NEUT 46  NC DIS
-    case 92:
-      return sg * 46;
-    // 93 NUANCE -> NEUT 17 1#gamma from #Delta
-    case 93:
-      return sg * 17;
-    // 94 NUANCE -> NEUT 39 1#gamma from #Delta
-    case 94:
-      return sg * 39;
-    // 95 -> UNKOWN NEUT MODE
-    case 95:
-      return sg * 0;
-    // 96 NUANCE -> NEUT 36 NC COH
-    case 96:
-      return sg * 36;
-    // 97 NUANCE -> NEUT 16
-    case 97:
-      return sg * 16;
-    // 98 -> UNKNOWN NEUT MODE
-    case 98:
-      return sg * 0;
-    // 99 -> UNKNOWN NEUT MODE
-    case 99:
-      return sg * 0;
-    default:
-      ERR(FTL) << "Unknown Nuance Channel ID = " << ch << std::endl;
-      throw("Exiting.");
-      return 0;
-  }
-  return 0;
-}
-#endif
-
-/*
-// Notes copied from NuanceChannels.pdf
-1 NUANCE CCQE -> NEUT CCQE 1
-CC, numu n --> mu- p
-Cabibbo-allowed quasi-elastic scattering from nucleons
-2 NUANCE NCEL -> NEUT NCEL 51,52 -> Set from whether target is p or n
-NC, numu N --> num N, (N=n,p)
-(quasi)-elastic scattering from nucleons
-3 NUANCE CCPIP -> NEUT CCPIP 11
-CC, numu p --> mu- p pi+
-resonant single pion production
-4 NUANCE CCPI0 -> NEUT CCPI0 = 12
-CC, numu n --> mu- p pi0
-resonant single pion production
-5 NUANCE CCPIPn -> NEUT CCPIPn 13
-CC, numu n --> mu- n pi+
-resonant single pion production
-6 NUANCE NCpPI0 -> NEUT NCpPI0  32
-NC, numu p --> numu p pi0
-resonant single pion production
-7 NUANCE NCpPI+ -> NEUT NCpPI+  34
-NC, numu p --> numu n pi+
-resonant single pion production
-8 NUANCE NCnPI0 -> NEUT NCnPI0  31
-NC, numu n --> numu n pi0
-resonant single pion production
-9  NUANCE NCnPIM -> NEUT NCnPIM  33
-NC, numu n --> numu p pi-
-resonant single pion production
-10 NUANCE CCPIP -> NEUT CCPIP -11
-CC, numubar p --> mu- p pi+
-resonant single pion production
-11 NUANCE CCPI0 -> NEUT CCPI0 -12
-CC, numubar n --> mu- p pi0
-resonant single pion production
-12 NUANCE CCPIPn -> NEUT CCPIPn -13
-CC, numubar n --> mu- n pi+
-resonant single pion production
-13 NUANCE NCpPI0 -> NEUT NCnPI0 -32
-NC, numubar p --> numubar p pi0
-resonant single pion production
-14 NUANCE NCpPI+ -> NEUT NCpPI+ -34
-NC, numubar p --> numubar n pi+
-resonant single pion production
-15 NUANCE NCnPI0 -> NEUT NCnPI0 -31
-NC, numubar n --> numubar n pi0
-resonant single pion production
-16 NUANCE NCnPIM -> NEUT NCnPIM -33
-NC, numubar n --> numubar p pi-
-resonant single pion production
-
-
-17 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numu p --> mu- Delta+ pi+
-resonant processes involving more than a single pion
-18 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numu p --> mu- Delta++ pi0
-resonant processes involving more than a single pion
-19 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numu n --> mu- Delta+ pi0
-resonant processes involving more than a single pion
-20 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numu n --> mu- Delta0 pi+
-resonant processes involving more than a single pion
-21 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numu n --> mu- Delta++ pi-
-resonant processes involving more than a single pion
-
-22 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numu p+ --> numu Delta+ pi0
-resonant processes involving more than a single pion
-23 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC,numu p --> numu Delta0 pi+
-resonant processes involving more than a single pion
-24 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numu p --> numu Delta++ pi-
-resonant processes involving more than a single pion
-25 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numu n --> numu Delta+ pi-
-resonant processes involving more than a single pion
-26 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numu n --> numu Delta0 pi0
-resonant processes involving more than a single pion
-
-27 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar n --> numubar Delta- pi+
-resonant processes involving more than a single pion
-28 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numubar p --> mu- Delta+ pi+
-resonant processes involving more than a single pion
-29 UANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numubar p --> mu- Delta++ pi0
-resonant processes involving more than a single pion
-30 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numubar n --> mu- Delta+ pi0
-resonant processes involving more than a single pion
-31 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numubar n --> mu- Delta0 pi+
-resonant processes involving more than a single pion
-32 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N'
-multi-#pi
-CC, numubar n --> mu- Delta++ pi-
-resonant processes involving more than a single pion
-33 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar p+ --> numubar Delta+ pi0
-resonant processes involving more than a single pion
-34 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC,numubar p --> numubar Delta0 pi+
-resonant processes involving more than a single pion
-35 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar p --> numubar Delta++ pi-
-resonant processes involving more than a single pion
-36 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar n --> numubar Delta+ pi-
-resonant processes involving more than a single pion
-37 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar n --> numubar Delta0 pi0
-resonant processes involving more than a single pion
-38 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N
-multi-#pi"
-NC, numubar n --> numubar Delta- pi+
-resonant processes involving more than a single pion
-
-
-// RHO Production lumped in with eta production
-22 CCeta
-43 NCeta on p
-42 NCeta on n
-
-39 NUANCE -> NEUT 22
-CC, numu p --> mu- p rho+(770)
-resonant processes involving more than a single pion
-40 NUANCE -> NEUT 22
-CC, numu n --> mu- p rho0(770)
-resonant processes involving more than a single pion
-41 NUANCE -> NEUT 22
-CC, numu n --> mu- n rho+(770)
-resonant processes involving more than a single pion
-42 NUANCE -> NEUT 43
-NC, numu p --> numu p rho0(770)
-resonant processes involving more than a single pion
-43 NUANCE -> NEUT 43
-NC, numu p --> numu n rho+(770)
-resonant processes involving more than a single pion
-44 NUANCE -> NUET 42
-NC, numu n --> numu n rho0(770)
-resonant processes involving more than a single pion
-45 NUANCE -> NEUT -42
-NC, numubar n --> numubar p rho-(770)
-resonant processes involving more than a single pion
-46 NUANCE -> NEUT -22
-CC, numubar p --> mu- p rho+(770)
-resonant processes involving more than a single pion
-47 NUANCE -> NEUT -22
-CC, numubar n --> mu- p rho0(770)
-resonant processes involving more than a single pion
-48 NUANCE -> NEUT -22
-CC, numubar n --> mu- n rho+(770)
-resonant processes involving more than a single pion
-49 NUANCE -> NEUT -43
-NC, numubar p --> numubar p rho0(770)
-resonant processes involving more than a single pion
-50 NUANCE -> NEUT -43
-NC, numubar p --> numubar n rho+(770)
-resonant processes involving more than a single pion
-51 NUANCE -> NEUT -42
-NC, numubar n --> numubar n rho0(770)
-resonant processes involving more than a single pion
-52 NUANCE -> NEUT -42
-NC, numubar n --> numubar p rho-(770)
-resonant processes involving more than a single pion
-
-
-53 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numu p --> mu- Sigma+ K+
-resonant processes involving more than a single pion
-54 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numu n --> mu- Sigma0 K+
-resonant processes involving more than a single pion
-55 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numu n --> mu- Sigma+ K0
-resonant processes involving more than a single pion
-56 NUANCE -> NEUT 45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
-NC, numu p --> numu Sigma0 K+
-resonant processes involving more than a single pion
-57 NUANCE -> NEUT 44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
-NC, numu p --> numu Sigma+ K0
-resonant processes involving more than a single pion
-58 NUANCE -> NEUT 44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
-NC, numu n --> numu Sigma0 K0
-resonant processes involving more than a single pion
-59 NUANCE -> NEUT 45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
-NC, numu n --> numu Sigma- K+
-resonant processes involving more than a single pion
-60 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numubar p --> mu- Sigma+ K+
-resonant processes involving more than a single pion
-61 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numubar n --> mu- Sigma0 K+
-resonant processes involving more than a single pion
-62 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
-CC, numubar n --> mu- Sigma+ K0
-resonant processes involving more than a single pion
-63 NUANCE -> NEUT -45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
-NC, numubar p --> numubar Sigma0 K+
-resonant processes involving more than a single pion
-64 NUANCE -> NEUT -44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
-NC, numubar p --> numubar Sigma+ K0
-resonant processes involving more than a single pion
-65 NUANCE -> NEUT -44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
-NC, numubar n --> numubar Sigma0 K0
-resonant processes involving more than a single pion
-66 NUANCE -> NEUT -45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
-NC, numubar n --> numubar Sigma- K+
-resonant processes involving more than a single pion
-
-67  NUANCE -> NEUT 22
-ModeStack[22]->SetTitle("CC1#eta^{0} on n");
-CC, numu n --> mu- p eta
-resonant processes involving more than a single pion
-68 NUANCE -> NEUT 43
-NC, numu p --> numu p eta
-resonant processes involving more than a single pion
-69 NUANCE -> NEUT 42
-NC, numu n --> numu n eta
-resonant processes involving more than a single pion
-70 NUANCE -> NEUT -22
-ModeStack[22]->SetTitle("CC1#eta^{0} on n");
-CC, numubar n --> mu- p eta
-resonant processes involving more than a single pion
-71 NUANCE -> NEUT -43
-ModeStack[43]->SetTitle("NC1#eta^{0} on p");
-NC, numubar p --> numubar p eta
-resonant processes involving more than a single pion
-72 NUANCE -> NEUT -42
-ModeStack[42]->SetTitle("NC1#eta^{0} on n");
-NC, numubar n --> numubar n eta
-resonant processes involving more than a single pion
-
-73 NUANCE -> NEUT 21
-ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-CC, numu n --> mu- K+ Lambda
-resonant processes involving more than a single pion
-74 NUANCE -> NEUT 41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numu p --> numu K+ Lambda
-resonant processes involving more than a single pion
-75 NUANCE -> NEUT 41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numu n --> numu K0 Lambda
-resonant processes involving more than a single pion
-76 NUANCE -> NEUT -21
-ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-CC, numubar n --> mu- K+ Lambda
-resonant processes involving more than a single pion
-77 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar p --> numubar K+ Lambda
-resonant processes involving more than a single pion
-78 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar n --> numubar K0 Lambda
-resonant processes involving more than a single pion
-
-CC Multipi  ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC Multipi  ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-79  NUANCE -> NEUT 21
-CC, numu n --> mu- p pi+ pi-
-two pion production
-80 NUANCE -> NEUT 21
-CC, numu n --> mu- p pi0 pi0
-two pion production
-81 NUANCE -> NEUT 41
-NC, numu p --> numu p pi+ pi-
-two pion production
-82 NUANCE -> NEUT 41
-NC, numu p --> numu p pi0 pi0
-two pion production
-83 NUANCE -> NEUT 41
-NC, numu n --> numu n pi+ pi-
-two pion production
-84 NUANCE -> NEUT 41
-NC, numu n --> numu n pi0 pi0
-two pion production
-85 NUANCE -> NEUT -21
-CC, numubar n --> mu- p pi+ pi-
-two pion production
-86 NUANCE -> NEUT -21
-CC, numubar n --> mu- p pi0 pi0
-two pion production
-87 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar p --> numubar p pi+ pi-
-two pion production
-88 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar p --> numubar p pi0 pi0
-two pion production
-89 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar n --> numubar n pi+ pi-
-two pion production
-90 NUANCE -> NEUT -41
-ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-NC, numubar n --> numubar n pi0 pi0
-two pion production
-
-
-91 NUANCE -> NEUT 26
-ModeStack[26]->SetTitle("DIS (W > 2.0)");
-CC, numu N --> mu- X (where N=n,p)
-deep inelastic scattering (nu or nubar)
-92 NUANCE -> NEUT 46
-ModeStack[46]->SetTitle("DIS (W > 2.0)");
-NC, numu N --> numu X (where N=n,p)
-deep inelastic scattering (nu or nubar)
-
-93 NUANCE -> NEUT 17 1#gamma from #Delta: #nu_{l} n #rightarrow l^{-} p #gamma
-CC, numu n --> mu- p gamma
-Delta radiative decay, Delta --> N gamma (only in NUANCE versions v3 and and
-higher)
-94 NUANCE -> NEUT 39 1#gamma from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma
-neutModeID[15] = 38;  neutModeName[15] = "ncngam"; neutModeTitle[15] = "1#gamma
-from #Delta: #nu_{l} n #rightarrow #nu_{l} n #gamma";
-neutModeID[16] = 39;  neutModeName[16] = "ncpgam"; neutModeTitle[16] = "1#gamma
-from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma";
-NC, numu N --> numu N gamma
-Delta radiative decay, Delta --> N gamma (only in NUANCE versions v3 and and
-higher)
-
-95 -> UNKOWN NEUT MODE
-CC, numubar p --> mu+ Lambda, numubar n -- > mu+ Sigma-, numubar p --> mu+
-Sigma0
-Cabibbo-suppressed QE hyperon production from nucleons
-
-96 NUANCE -> NEUT 36
-neutModeID[14] = 36;  neutModeName[14] = "nccoh";  neutModeTitle[14] = "NC
-coherent-#pi: #nu_{l} ^{16}O #rightarrow #nu_{l} ^{16}O #pi^{0}";
-NC, numu A --> numu pi0 A
-coherent or diffractive pi0 production
-97 NUANCE -> NEUT 16
-neutModeID[4] = 16;   neutModeName[4] = "cccoh";   neutModeTitle[4] = "CC
-coherent-#pi: #nu_{l} ^{16}O #rightarrow l^{-} ^{16}O #pi^{+}";
-CC, numu A --> mu- pi+ A (or numubar A -->
-coherent or diffractive pi0 production
-
-98 -> UNKNOWN NEUT MODE
-NC, numu e- --> numu e- (or numubar e- -->
-neutrino + electron elastic scattering
-99 -> UNKNOWN NEUT MODE
-CC, numu e- --> mu- nue
-neutrino + electron inverse muon decay
-
-NEUT Modes:
-// CC Modes
- neutModeID[0] = 1;    neutModeName[0] = "ccqe";    neutModeTitle[0] = "CCQE:
-#nu_{l} n #rightarrow l^{-} p";
- neutModeID[1] = 11;   neutModeName[1] = "ccppip";  neutModeTitle[1] = "CC 1#pi:
-#nu_{l} p #rightarrow l^{-} p #pi^{+}";
- neutModeID[2] = 12;   neutModeName[2] = "ccppi0";  neutModeTitle[2] = "CC 1#pi:
-#nu_{l} n #rightarrow l^{-} p #pi^{0}";
- neutModeID[3] = 13;   neutModeName[3] = "ccnpip";  neutModeTitle[3] = "CC 1#pi:
-#nu_{l} n #rightarrow l^{-} n #pi^{+}";
- neutModeID[4] = 16;   neutModeName[4] = "cccoh";   neutModeTitle[4] = "CC
-coherent-#pi: #nu_{l} ^{16}O #rightarrow l^{-} ^{16}O #pi^{+}";
- neutModeID[5] = 17;   neutModeName[5] = "ccgam";   neutModeTitle[5] = "1#gamma
-from #Delta: #nu_{l} n #rightarrow l^{-} p #gamma";
- neutModeID[6] = 21;   neutModeName[6] = "ccmpi";   neutModeTitle[6] = "CC (1.3
-< W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi";
- neutModeID[7] = 22;   neutModeName[7] = "cceta";   neutModeTitle[7] = "CC
-1#eta: #nu_{l} n #rightarrow l^{-} p #eta";
- neutModeID[8] = 23;   neutModeName[8] = "cck";     neutModeTitle[8] = "CC 1K:
-#nu_{l} n #rightarrow l^{-} #Lambda K^{+}";
- neutModeID[9] = 26;   neutModeName[9] = "ccdis";   neutModeTitle[9] = "CC DIS
-(2 GeV < W): #nu_{l} N #rightarrow l^{-} N' mesons";
-
-neutModeID[10] = 31;  neutModeName[10] = "ncnpi0"; neutModeTitle[10] = "NC 1#pi:
-#nu_{l} n #rightarrow #nu_{l} n #pi^{0}";
-neutModeID[11] = 32;  neutModeName[11] = "ncppi0"; neutModeTitle[11] = "NC 1#pi:
-#nu_{l} p #rightarrow #nu_{l} p #pi^{0}";
-neutModeID[12] = 33;  neutModeName[12] = "ncppim"; neutModeTitle[12] = "NC 1#pi:
-#nu_{l} n #rightarrow #nu_{l} p #pi^{-}";
-neutModeID[13] = 34;  neutModeName[13] = "ncnpip"; neutModeTitle[13] = "NC 1#pi:
-#nu_{l} p #rightarrow #nu_{l} n #pi^{+}";
-
-neutModeID[14] = 36;  neutModeName[14] = "nccoh";  neutModeTitle[14] = "NC
-coherent-#pi: #nu_{l} ^{16}O #rightarrow #nu_{l} ^{16}O #pi^{0}";
-neutModeID[15] = 38;  neutModeName[15] = "ncngam"; neutModeTitle[15] = "1#gamma
-from #Delta: #nu_{l} n #rightarrow #nu_{l} n #gamma";
-neutModeID[16] = 39;  neutModeName[16] = "ncpgam"; neutModeTitle[16] = "1#gamma
-from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma";
-
-neutModeID[17] = 41;  neutModeName[17] = "ncmpi";  neutModeTitle[17] = "NC (1.3
-< W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi";
-
-neutModeID[18] = 42;  neutModeName[18] = "ncneta"; neutModeTitle[18] = "NC
-1#eta: #nu_{l} n #rightarrow #nu_{l} n #eta";
-neutModeID[19] = 43;  neutModeName[19] = "ncpeta"; neutModeTitle[19] = "NC
-1#eta: #nu_{l} p #rightarrow #nu_{l} p #eta";
-
-neutModeID[20] = 44;  neutModeName[20] = "nck0";   neutModeTitle[20] = "NC 1K:
-#nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}";
-neutModeID[21] = 45;  neutModeName[21] = "nckp";   neutModeTitle[21] = "NC 1K:
-#nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}";
-
-neutModeID[22] = 46;  neutModeName[22] = "ncdis";  neutModeTitle[22] = "NC DIS
-(2 GeV < W): #nu_{l} N #rightarrow #nu_{l} N' mesons";
-
-neutModeID[23] = 51;  neutModeName[23] = "ncqep";  neutModeTitle[23] = "NC
-elastic: #nu_{l} p #rightarrow #nu_{l} p";
-neutModeID[24] = 52;  neutModeName[24] = "ncqen";  neutModeTitle[24] = "NC
-elastic: #nu_{l} n #rightarrow #nu_{l} n";
-*/
diff --git a/src/FitBase/GeneratorUtils.h b/src/FitBase/GeneratorUtils.h
deleted file mode 100644
index 083fc9a..0000000
--- a/src/FitBase/GeneratorUtils.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef GENERATOR_UTILS_H
-#define GENERATOR_UTILS_H
-
-#ifdef __NEUT_ENABLED__
-#include "nefillverC.h"
-#include "necardC.h"
-#include "neutmodelC.h"
-#include "neutparamsC.h"
-#include "neworkC.h"
-#include "fsihistC.h"
-//Comment out as NEUT does not have the necessary proton FSI information yet
-#include "nucleonfsihistC.h"
-#include "neutcrsC.h"
-#include "neutvect.h"
-#include "neutpart.h"
-#include "neutfsipart.h"
-#include "neutfsivert.h"
-#include "neutnucfsivert.h"
-#include "neutnucfsistep.h"
-#include "neutrootTreeSingleton.h"
-#include "NModeDefn.h"
-
-#include "NSyst.h"
-#include "NFortFns.h" // Contains all the NEUT common blocks
-#endif
-
-#ifdef __NIWG_ENABLED__
-#include "NIWGEvent.h"
-#include "NIWGSyst.h"
-#endif
-
-#ifdef __NUWRO_ENABLED__
-#include "event1.h"
-#endif
-
-#include "NuanceEvent.h"
-
-namespace GeneratorUtils {
-
-  extern const std::string NEUT_TreeName;
-#ifdef __NEUT_ENABLED__
-  void FillNeutCommons(NeutVect* nvect);
-#endif
-
-#ifdef __NIWG_ENABLED__
-  niwg::rew::NIWGEvent* GetNIWGEvent(NeutVect* nvect);
-#endif
-
-  extern const std::string NuWro_TreeName;
-#ifdef __NUWRO_ENABLED__
-  int ConvertNuwroMode (event * e);
-#endif
-
-#ifdef __NUANCE_ENABLED__
-  int ConvertNuanceMode(NuanceEvent * evt);
-#endif
-
-  extern const std::string GENIE_TreeName;
-  extern const std::string GiBUU_TreeName;
-};
-#endif
diff --git a/src/FitBase/InputHandler.cxx b/src/FitBase/InputHandler.cxx
deleted file mode 100644
index dfc38f0..0000000
--- a/src/FitBase/InputHandler.cxx
+++ /dev/null
@@ -1,1413 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-#include "InputHandler.h"
-#include <csignal>
-
-//****************************************************************************
-InputHandler::InputHandler(std::string const& handle,
-                           InputUtils::InputType inpType,
-                           std::string const& inputs) {
-  //****************************************************************************
-
-  LOG(SAM) << "Creating InputHandler for " << handle << "..." << std::endl;
-  LOG(SAM) << " -> [" << inputs << "]" << std::endl;
-
-  // Initial Setup
-  fMaxEvents = FitPar::Config().GetParI("input.maxevents");
-  fIsExplicitJointInput = (inpType == InputUtils::kJOINT_Input);
-  fIsJointInput = fIsExplicitJointInput || InputUtils::IsJointInput(inputs);
-  fInputType = inpType;
-  fEvent = new FitEvent();
-  fSignalEvent = new BaseFitEvt();
-  fInput = inputs;
-  fInputFile = InputUtils::ExpandInputDirectories(inputs);
-  fName = handle;
-
-  LOG(SAM) << " -> Type  = " << fInputType
-           << (fIsJointInput ? " (Composite)" : "") << std::endl;
-  LOG(SAM) << " -> Input = " << fInputFile << std::endl;
-
-  // Automatically check what sort of event file it is
-  if (fIsJointInput) {
-    ReadJointFile();
-  } else {
-    fInputRootFile = new TFile(fInputFile.c_str(), "READ");
-    switch (fInputType) {
-      // Setup the handler for each type
-      case InputUtils::kNEUT_Input: {
-        ReadNeutFile();
-        break;
-      }
-      case InputUtils::kNUWRO_Input: {
-        ReadNuWroFile();
-        break;
-      }
-      case InputUtils::kGENIE_Input: {
-        ReadGenieFile();
-        break;
-      }
-      case InputUtils::kGiBUU_Input: {
-        ReadGiBUUFile();
-        break;
-      }
-      case InputUtils::kHIST_Input: {
-        ReadHistogramFile();
-        break;
-      }
-      case InputUtils::kBNSPLN_Input: {
-        ReadBinSplineFile();
-        break;
-      }
-      case InputUtils::kEVSPLN_Input: {
-        ReadEventSplineFile();
-        break;
-      }
-      case InputUtils::kNUANCE_Input: {
-        ReadNuanceFile();
-        break;
-      }
-      case InputUtils::kEMPTY_Input: {
-        ReadEmptyEvents();  // For Validation
-        break;
-      }
-      case InputUtils::kFEVENT_Input: {
-        ReadFitEvents();
-        break;
-      }
-      default: {
-        LOG(FTL) << " -> ERROR: Invalid Event File Type" << std::endl;
-        fInputRootFile->ls();
-        throw;
-      }
-    }
-  }
-
-  // Setup MaxEvents After setup of ttree
-  if (fMaxEvents > 1 && fMaxEvents < fNEvents) {
-    LOG(SAM) << " -> Reading only " << fMaxEvents << " events from total."
-             << std::endl;
-    fNEvents = fMaxEvents;
-  }
-
-  fFluxList.push_back(fFluxHist);
-  fEventList.push_back(this->fEventHist);
-  fXSecList.push_back(this->fXSecHist);
-
-  LOG(SAM) << " -> Finished handler initialisation." << std::endl;
-  return;
-};
-
-//********************************************************************
-bool InputHandler::CanIGoFast() {
-  //********************************************************************
-
-  if (fEventType == 6) {
-    return true;
-  }
-  return false;
-}
-
-//********************************************************************
-void InputHandler::ReadFitEvents() {
-  //********************************************************************
-
-  fEventType = kINPUTFITEVENT;
-
-  fFluxHist = (TH1D*)fInputRootFile->Get("nuisance_fluxhist");
-  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                          (fName + "; E_{#nu} (GeV)").c_str());
-
-  fEventHist = (TH1D*)fInputRootFile->Get("nuisance_eventhist");
-  fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                           (fName + "; E_{#nu} (GeV); Event Rate").c_str());
-
-  fXSecHist = (TH1D*)fEventHist->Clone();
-  fXSecHist->Divide(fFluxHist);
-  fXSecHist->SetNameTitle(
-      (fName + "_XSEC").c_str(),
-      (fName + "_XSEC;E_{#nu} (GeV); XSec (1#times10^{-38} cm^{2})").c_str());
-
-  tn = new TChain("nuisance_events", "");
-  tn->Add(Form("%s/nuisance_events", fInputFile.c_str()));
-
-  // Assign nvect
-  fNEvents = tn->GetEntries();
-  fEvent->SetBranchAddress(tn);
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read FEvent file" << std::endl;
-
-  return;
-}
-
-//********************************************************************
-void InputHandler::ReadEmptyEvents() {
-  //********************************************************************
-
-  fEventType = kEMPTY;
-
-  // Set flux histograms to empty
-  fFluxHist = new TH1D((fName + "_FLUX").c_str(),
-                       (fName + "_FLUX;E_{#nu};Flux").c_str(), 1, 0.0, 1.0);
-  fFluxHist->SetBinContent(1, 1);
-
-  // Set Event Hist to empty
-  fEventHist = new TH1D((fName + "_EVT").c_str(),
-                        (fName + "_EVT;E_{#nu};Flux").c_str(), 1, 0.0, 1.0);
-  fEventHist->SetBinContent(1, 1);
-
-  // Set XSec hist to empty
-  fXSecHist = new TH1D((fName + "_XSEC").c_str(),
-                       (fName + "_XSEC;E_{#nu};XSec").c_str(), 1, 0.0, 1.0);
-  fXSecHist->SetBinContent(1, 1);
-
-  fNEvents = 0;
-}
-
-//********************************************************************
-void InputHandler::ReadEventSplineFile() {
-  //********************************************************************
-
-  LOG(SAM) << " -> Setting up SPLINE inputs" << std::endl;
-
-  // Event Type 7 SPLINES
-  fEventType = 6;
-
-  fFluxHist = (TH1D*)fInputRootFile->Get("FitFluxHist");
-  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                          (fName + "; E_{#nu} (GeV)").c_str());
-
-  fEventHist = (TH1D*)fInputRootFile->Get("FitEventHist");
-  fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                           (fName + "; E_{#nu} (GeV); Event Rate").c_str());
-
-  fXSecHist = (TH1D*)fEventHist->Clone();
-  fXSecHist->Divide(fFluxHist);
-  fXSecHist->SetNameTitle(
-      (fName + "_XSEC").c_str(),
-      (fName + "_XSEC;E_{#nu} (GeV); XSec (1#times10^{-38} cm^{2})").c_str());
-
-  tn = new TChain("FitEvents", "");
-  tn->Add(Form("%s/FitEvents", fInputFile.c_str()));
-
-  // Setup Spline Stuff
-  fSplineHead = new FitSplineHead(fInputRootFile, "FitSplineHead");
-
-  // Assign nvect
-  fNEvents = tn->GetEntries();
-  fEvent->SetBranchAddress(tn);
-  fEvent->SetSplineCoeffAddress(tn);
-  fEvent->SetType(kEVTSPLINE);
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read FEvent file" << std::endl;
-
-  // Load Dial Coeffs into vector
-  tn->GetEntry(0);
-  int ncoeff = fEvent->GetNCoeff();
-  fSplineArray = new double*[fNEvents];
-  for (int i = 0; i < fNEvents; i++) {
-    tn->GetEntry(i);
-
-    // Copy Splines over
-    fSplineArray[i] = new double[ncoeff];
-    for (int j = 0; j < fEvent->GetNCoeff(); j++) {
-      fSplineArray[i][j] = fEvent->GetCoeff(j);
-    }
-  }
-
-  LOG(DEB) << "Loaded all spline coeffs" << endl;
-
-  // Set input.maxevents CALC Here before we load in splines
-  if (fMaxEvents > 1 and fMaxEvents < fNEvents) {
-    LOG(SAM) << " -> Reading only " << fMaxEvents
-             << " events from total spline events." << std::endl;
-    fNEvents = fMaxEvents;
-  }
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read SPLINE file" << std::endl;
-  if (LOG_LEVEL(SAM)) PrintStartInput();
-
-  int cnt = 1;
-  std::list<FitSpline*>::iterator spl_iter =
-      this->fSplineHead->SplineObjects.begin();
-  for (; spl_iter != this->fSplineHead->SplineObjects.end(); spl_iter++) {
-    FitSpline* spl = (*spl_iter);
-
-    LOG(SAM) << " -> Spline " << cnt << ". " << spl->id << " " << spl->form
-             << " "
-             << "NDIM(" << spl->ndim << ") "
-             << "NPAR(" << spl->npar << ") "
-             << "PTS(" << spl->points << ") " << std::endl;
-    cnt++;
-  }
-}
-
-//********************************************************************
-FitSplineHead* InputHandler::GetSplineHead() {
-  //********************************************************************
-  return fSplineHead;
-}
-
-//********************************************************************
-void InputHandler::SetupCache() {
-  //********************************************************************
-  tn->SetCacheSize(FitPar::Config().GetParI("cachesize"));
-  tn->AddBranchToCache("*", kTRUE);
-  tn->StopCacheLearningPhase();
-}
-
-//********************************************************************
-void InputHandler::ReadJointFile() {
-  //********************************************************************
-
-  std::vector<std::string> inputs;
-
-  if (fIsExplicitJointInput) {  // Included for backwards compatibility.
-    std::string line;
-    std::ifstream card(fInputFile.c_str(), ifstream::in);
-
-    LOG(FIT) << "Parsing input card: \'" << fInputFile << "\'" << endl;
-    while (std::getline(card >> std::ws, line, '\n')) {
-      if (line.empty()) {
-        continue;
-      }
-
-      std::vector<std::string> file_descriptor =
-          GeneralUtils::ParseToStr(line, ":");
-
-      if (file_descriptor.size() != 2) {
-        ERR(FTL) << "Found JOINT card file line: \"" << line
-                 << "\", expected \"INPUTTYPE:File.root\"." << std::endl;
-        throw;
-      }
-      InputUtils::InputType inpType =
-          InputUtils::ParseInputType(file_descriptor[0]);
-
-      if (!inputs.size()) {
-        fInputType = inpType;
-        LOG(SAM) << " -> InputHandler type: " << fInputType << std::endl;
-      } else if (inpType != fInputType) {
-        ERR(FTL) << "First input type in JOINT card was: " << fInputType
-                 << " but found: " << inpType
-                 << ", all files in a JOINT must be the same." << std::endl;
-        throw;
-      }
-
-      LOG(SAM) << "\t -> Found input file: " << file_descriptor[1] << std::endl;
-      inputs.push_back(file_descriptor[1]);
-    }
-  } else {
-    LOG(SAM) << " -> Parsing list of inputs for composite input." << std::endl;
-
-    inputs = GeneralUtils::ParseToStr(fInputFile, ",");
-    inputs.front() = inputs.front().substr(1);
-    inputs.back() = inputs.back().substr(0, inputs.back().size() - 1);
-
-    for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
-      LOG(SAM) << "\t -> Found input file: " << inputs[inp_it] << std::endl;
-    }
-  }
-
-  // Loop over input and get the flux files
-  // Using a temporary input handler to do this, which is a bit dodge.
-  int count_low = 0;
-  int temp_EventType = kUNKNOWN;
-  for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
-    LOG(SAM) << "Creating temporary handler to read file: " << inputs.at(inp_it)
-             << endl;
-
-    // Create Temporary InputHandlers inside
-    InputHandler temp_input(std::string(Form("temp_input_%li", inp_it)),
-                            fInputType, inputs.at(inp_it));
-
-    if (temp_EventType != temp_input.GetType() and inp_it > 0) {
-      ERR(FTL) << "Can't use joint events with mismatched trees!" << std::endl;
-      ERR(FTL) << "This should not have happened. Please report this as a bug "
-                  "along with your input card file."
-               << std::endl;
-      throw;
-    }
-
-    LOG(FIT) << "Getting objects from " << temp_input.fInputFile << endl;
-    temp_EventType = temp_input.GetType();
-
-    TH1D* temp_flux = (TH1D*)temp_input.GetFluxHistogram()->Clone();
-    TH1D* temp_evts = (TH1D*)temp_input.GetEventHistogram()->Clone();
-    TH1D* temp_xsec = (TH1D*)temp_input.GetXSecHistogram()->Clone();
-    int temp_events = temp_input.GetNEvents();
-
-    temp_flux->SetName(
-        (fName + "_" + temp_input.GetInputStateString() + "_FLUX").c_str());
-    temp_evts->SetName(
-        (fName + "_" + temp_input.GetInputStateString() + "_EVT").c_str());
-    temp_xsec->SetName(
-        (fName + "_" + temp_input.GetInputStateString() + "_XSEC").c_str());
-
-    fFluxList.push_back(temp_flux);
-    fEventList.push_back(temp_evts);
-    fXSecList.push_back(temp_xsec);
-
-    fJointIndexLow.push_back(count_low);
-    fJointIndexHigh.push_back(count_low + temp_events);
-    fJointIndexHist.push_back((TH1D*)temp_evts->Clone());
-
-    count_low += temp_events;
-    LOG(FIT) << "Temp input has " << temp_events << " events." << endl;
-
-    if (inp_it == 0) {
-      fFluxHist = (TH1D*)temp_flux->Clone();
-      fEventHist = (TH1D*)temp_evts->Clone();
-    } else {
-      fFluxHist->Add(temp_flux);
-      fEventHist->Add(temp_evts);
-    }
-    LOG(SAM) << "Added Input File " << inputs.at(inp_it) << std::endl
-             << " which contained " << temp_events << " events." << std::endl;
-  }
-
-  // Now have all correctly normalised histograms all we need to do is setup the
-  // TChains
-
-  // Input Assumes all the same type
-  std::string tree_name = "";
-  if (temp_EventType == kNEUT) {
-    tree_name = "neuttree";
-  } else if (temp_EventType == kNUWRO) {
-    tree_name = "treeout";
-  } else if (temp_EventType == kGENIE) {
-    tree_name = "gtree";
-  }
-
-  // Add up the TChains
-  tn = new TChain(tree_name.c_str());
-  for (UInt_t i = 0; i < inputs.size(); i++) {
-    // PARSE INPUT
-    LOG(DEB) << "Adding new tchain " << inputs.at(i) << std::endl;
-    tn->Add(inputs.at(i).c_str());
-  }
-
-  // Setup Events
-  fNEvents = tn->GetEntries();
-  if (temp_EventType == kNEUT) {
-#ifdef __NEUT_ENABLED__
-    fEventType = kNEUT;
-    fNeutVect = NULL;
-    tn->SetBranchAddress("vectorbranch", &fNeutVect);
-    fEvent->SetEventAddress(&fNeutVect);
-#endif
-  } else if (temp_EventType == kNUWRO) {
-#ifdef __NUWRO_ENABLED__
-    fEventType = kNUWRO;
-    fNuwroEvent = NULL;
-    tn->SetBranchAddress("e", &fNuwroEvent);
-    fEvent->SetEventAddress(&fNuwroEvent);
-#endif
-  } else if (temp_EventType == kGENIE) {
-#ifdef __GENIE_ENABLED__
-    fEventType = kGENIE;
-    fGenieGHep = NULL;
-    fGenieNtpl = NULL;
-    tn->SetBranchAddress("gmcrec", &fGenieNtpl);
-    fEvent->SetEventAddress(&fGenieNtpl);
-#endif
-  }
-
-  // Normalise event histogram PDFS for weights
-  for (UInt_t i = 0; i < inputs.size(); i++) {
-    TH1D* temp_hist = (TH1D*)fJointIndexHist.at(i)->Clone();
-    fJointIndexScale.push_back(
-        double(fNEvents) / fEventHist->Integral("width") *
-        fJointIndexHist.at(i)->Integral("width") /
-        double(fJointIndexHigh.at(i) - fJointIndexLow.at(i)));
-
-    temp_hist->Scale(double(fNEvents) / fEventHist->Integral("width"));
-    temp_hist->Scale(fJointIndexHist.at(i)->Integral("width") /
-                     double(fJointIndexHigh.at(i)));
-
-    fJointIndexHist.at(i) = temp_hist;
-  }
-
-  fEventHist->SetNameTitle((fName + "_EVT").c_str(), (fName + "_EVT").c_str());
-  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(), (fName + "_FLUX").c_str());
-
-  fXSecHist = (TH1D*)fEventHist->Clone();
-  fXSecHist->Divide(fFluxHist);
-  fXSecHist->SetNameTitle((fName + "_XSEC").c_str(), (fName + "_XSEC").c_str());
-
-  return;
-}
-
-//********************************************************************
-void InputHandler::ReadNeutFile() {
-//********************************************************************
-
-#ifdef __NEUT_ENABLED__
-
-  LOG(SAM) << " -> Setting up NEUT inputs" << std::endl;
-
-  // Event Type 0 Neut
-  fEventType = kNEUT;
-
-  // Get flux histograms NEUT supplies
-  fFluxHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "flux")).c_str());
-  if (!fFluxHist) {
-    ERR(FTL) << "No Flux Hist in NEUT ROOT file." << std::endl;
-    throw;
-  }
-  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                          (fName + "; E_{#nu} (GeV)").c_str());
-
-  fEventHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "evtrt")).c_str());
-  if (!fEventHist) {
-    ERR(FTL) << "No Event Hist in NEUT ROOT file." << std::endl;
-    throw;
-  }
-
-  fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                           (fName + "; E_{#nu} (GeV); Event Rate").c_str());
-
-  fXSecHist = (TH1D*)fEventHist->Clone();
-  fXSecHist->Divide(fFluxHist);
-  fXSecHist->SetNameTitle(
-      (fName + "_XSEC").c_str(),
-      (fName + "_XSEC;E_{#nu} (GeV); XSec (1#times10^{-38} cm^{2})").c_str());
-
-  // Read in the file once only
-  tn = new TChain("neuttree", "");
-  tn->Add(Form("%s/neuttree", fInputFile.c_str()));
-
-  // Assign nvect
-  fNEvents = tn->GetEntries();
-  fNeutVect = NULL;
-  tn->SetBranchAddress("vectorbranch", &fNeutVect);
-
-  // Make the custom event read in nvect when calling CalcKinematics
-  fEvent->SetEventAddress(&fNeutVect);
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read NEUT file" << std::endl;
-  if (LOG_LEVEL(SAM)) {
-    PrintStartInput();
-  }
-
-#else
-  ERR(FTL) << "ERROR: Invalid Event File Provided" << std::endl;
-  ERR(FTL) << "NEUT Input Not Enabled." << std::endl;
-  ERR(FTL) << "Rebuild with --enable-neut or check FitBuild.h!" << std::endl;
-  exit(-1);
-#endif
-
-  return;
-}
-
-//********************************************************************
-void InputHandler::ReadNuWroFile() {
-//********************************************************************
-
-#ifdef __NUWRO_ENABLED__
-
-  LOG(SAM) << " -> Setting up Nuwro inputs" << std::endl;
-
-  // Event Type 1 == NuWro
-  fEventType = kNUWRO;
-
-  // Setup the TChain for nuwro event tree
-  tn = new TChain("treeout");
-  tn->AddFile(fInputFile.c_str());
-
-  // Get entries and fNuwroEvent
-  fNEvents = tn->GetEntries();
-  fNuwroEvent = NULL;
-  tn->SetBranchAddress("e", &fNuwroEvent);
-  fEvent->SetEventAddress(&fNuwroEvent);
-
-  // Check if we have saved an xsec histogram before
-  fFluxHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "FluxHist")).c_str());
-  fEventHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "EvtHist")).c_str());
-
-  // Check if we are forcing plot generation (takes time)
-  bool regenFlux = FitPar::Config().GetParB("input.regen_nuwro_plots");
-  if (regenFlux)
-    LOG(SAM)
-        << " -> Forcing NuWro XSec/Flux plots to be generated at the start. "
-        << std::endl;
-
-  // Already generated flux and event histograms
-  if (fFluxHist and fEventHist and !regenFlux) {
-    fXSecHist = (TH1D*)fInputRootFile->Get(
-        (PlotUtils::GetObjectWithName(fInputRootFile, "xsec")).c_str());
-
-    fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                            (fName + "_FLUX").c_str());
-    fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                             (fName + "_EVT").c_str());
-    fXSecHist->SetNameTitle((fName + "_XSEC").c_str(),
-                            (fName + "_XSEC").c_str());
-
-    // Need to regenerate if not found
-  } else {
-    LOG(SAM)
-        << " -> No NuWro XSec or Flux Histograms found, need to regenerate!"
-        << std::endl;
-
-    // Can grab flux histogram from the pars
-    tn->GetEntry(0);
-
-    int beamtype = fNuwroEvent->par.beam_type;
-
-    if (beamtype == 0) {
-      std::string fluxstring = fNuwroEvent->par.beam_energy;
-      std::vector<double> fluxvals = GeneralUtils::ParseToDbl(fluxstring, " ");
-      int pdg = fNuwroEvent->par.beam_particle;
-      double Elow = double(fluxvals[0]) / 1000.0;
-      double Ehigh = double(fluxvals[1]) / 1000.0;
-
-      LOG(SAM) << " - Adding new nuwro flux "
-               << "pdg: " << pdg << "Elow: " << Elow << "Ehigh: " << Ehigh
-               << std::endl;
-
-      fFluxHist =
-          new TH1D("fluxplot", "fluxplot", fluxvals.size() - 2, Elow, Ehigh);
-      for (UInt_t j = 2; j < fluxvals.size(); j++) {
-        LOG(DEB) << "Flux bin:" << j << " = " << fluxvals[j] << endl;
-        fFluxHist->SetBinContent(j - 1, fluxvals[j]);
-      }
-    } else if (beamtype == 1) {
-      std::string fluxstring = fNuwroEvent->par.beam_content;
-
-      std::vector<std::string> fluxlines =
-          GeneralUtils::ParseToStr(fluxstring, "\n");
-      for (UInt_t i = 0; i < fluxlines.size(); i++) {
-        std::vector<double> fluxvals =
-            GeneralUtils::ParseToDbl(fluxlines[i], " ");
-
-        int pdg = int(fluxvals[0]);
-        double pctg = double(fluxvals[1]) / 100.0;
-        double Elow = double(fluxvals[2]) / 1000.0;
-        double Ehigh = double(fluxvals[3]) / 1000.0;
-
-        LOG(DEB) << " - Adding new nuwro flux "
-                 << "pdg: " << pdg << "pctg: " << pctg << "Elow: " << Elow
-                 << "Ehigh: " << Ehigh << std::endl;
-
-        TH1D* fluxplot =
-            new TH1D("fluxplot", "fluxplot", fluxvals.size() - 4, Elow, Ehigh);
-        for (UInt_t j = 4; j < fluxvals.size(); j++) {
-          fluxplot->SetBinContent(j + 1, fluxvals[j]);
-        }
-
-        if (fFluxHist)
-          fFluxHist->Add(fluxplot);
-        else
-          fFluxHist = (TH1D*)fluxplot->Clone();
-      }
-    }
-
-    fFluxHist->SetNameTitle("nuwro_flux", "nuwro_flux;E_{#nu} (GeV); Flux");
-
-    fEventHist = (TH1D*)fFluxHist->Clone();
-    fEventHist->Reset();
-    fEventHist->SetNameTitle("nuwro_evt", "nuwro_evt");
-
-    fXSecHist = (TH1D*)fFluxHist->Clone();
-    fXSecHist->Reset();
-    fXSecHist->SetNameTitle("nuwro_xsec", "nuwro_xsec");
-
-    // Start Processing
-    LOG(SAM) << " -> Processing NuWro Input Flux for " << fNEvents
-             << " events (This can take a while...) " << std::endl;
-
-    double Enu = 0.0;
-    double TotXSec = 0.0;
-    double totaleventmode = 0.0;
-    double totalevents = 0.0;
-
-    // --- loop
-    for (int i = 0; i < fNEvents; i++) {
-      tn->GetEntry(i);
-
-      if (i % 100000 == 0) LOG(SAM) << " i " << i << std::endl;
-      // Get Variables
-      Enu = fNuwroEvent->in[0].t / 1000.0;
-      TotXSec = fNuwroEvent->weight;
-
-      // Fill a flux and xsec histogram
-      fEventHist->Fill(Enu);
-      fXSecHist->Fill(Enu, TotXSec);
-
-      // Keep Tally
-      totaleventmode += TotXSec;
-      totalevents++;
-    }
-
-    LOG(SAM) << " -> Flux Processing Loop Finished." << std::endl;
-
-    if (fEventHist->Integral() == 0.0) {
-      ERR(FTL) << "NO EVENTS FOUND IN RANGE! " << std::endl;
-      exit(-1);
-    }
-
-    // Sort out plot scaling
-    double AvgXSec = (totaleventmode * 1.0E38 / (totalevents + 0.));
-    LOG(SAM) << " -> Average XSec = " << AvgXSec << std::endl;
-
-    fEventHist->Scale(1.0 / fEventHist->Integral());  // Convert to PDF
-    fEventHist->Scale(fFluxHist->Integral() *
-                      AvgXSec);  // Convert to Proper Event Rate
-
-    fXSecHist->Add(fEventHist);    // Get Event Rate Plot
-    fXSecHist->Divide(fFluxHist);  // Make XSec Plot
-
-    // fEventHist = (TH1D*)fFluxHist->Clone();
-    // fEventHist->Multiply(fXSecHist);
-
-    // Clear over/underflows incase they mess with integrals later.
-    fFluxHist->SetBinContent(0, 0.0);
-    fFluxHist->SetBinContent(fFluxHist->GetNbinsX() + 2, 0.0);
-
-    fEventHist->SetBinContent(0, 0.0);
-    fEventHist->SetBinContent(fEventHist->GetNbinsX() + 2, 0.0);
-
-    LOG(SAM)
-        << " -> Finished making NuWro event plots. Saving them for next time..."
-        << std::endl;
-
-    TFile* temp_save_file = new TFile(fInputFile.c_str(), "UPDATE");
-    temp_save_file->cd();
-
-    fFluxHist->Write("FluxHist", TObject::kOverwrite);
-    fEventHist->Write("EventHist", TObject::kOverwrite);
-    fXSecHist->Write("XSecHist", TObject::kOverwrite);
-    temp_save_file->ls();
-
-    temp_save_file->Close();
-    delete temp_save_file;
-
-    fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                            (fName + "_FLUX").c_str());
-    fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                             (fName + "_EVT").c_str());
-    fXSecHist->SetNameTitle((fName + "_XSEC").c_str(),
-                            (fName + "_XSEC").c_str());
-  }  // end regenerate histos
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read NUWRO file" << std::endl;
-  if (LOG_LEVEL(SAM)) PrintStartInput();
-
-#else
-  ERR(FTL) << "ERROR: Invalid Event File Provided" << std::endl;
-  ERR(FTL) << "NuWro Input Not Enabled." << std::endl;
-  ERR(FTL) << "Rebuild with --enable-nuwro or check FitBuild.h!" << std::endl;
-  exit(-1);
-#endif
-
-  return;
-}
-
-//********************************************************************
-void InputHandler::ReadGenieFile() {
-//********************************************************************
-
-#ifdef __GENIE_ENABLED__
-
-  // Event Type 5 GENIE
-  fEventType = kGENIE;
-
-  // Open Root File
-  LOG(SAM) << "Reading event file " << fInputFile << std::endl;
-
-  // Get flux histograms NEUT supplies
-  fFluxHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "nuisance_flux")).c_str());
-
-  if (!fFluxHist) {
-    ERR(FTL) << "GENIE FILE doesn't contain flux/xsec info" << std::endl;
-    ERR(FTL) << "Run app/PrepareGENIE first" << std::endl;
-    throw;
-  }
-
-  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(),
-                          (fName + "; E_{#nu} (GeV)").c_str());
-
-  fEventHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "nuisance_events"))
-          .c_str());
-  fEventHist->SetNameTitle((fName + "_EVT").c_str(),
-                           (fName + "; E_{#nu} (GeV); Event Rate").c_str());
-
-  fXSecHist = (TH1D*)fInputRootFile->Get(
-      (PlotUtils::GetObjectWithName(fInputRootFile, "nuisance_xsec")).c_str());
-  fXSecHist->SetNameTitle((fName + "_XSEC").c_str(),
-                          (fName + "; E_{#nu} (GeV); Event Rate").c_str());
-
-  // Setup the TChain for GENIE event tree
-  tn = new TChain("gtree");
-  tn->AddFile(fInputFile.c_str());
-
-  fNEvents = tn->GetEntries();
-  StopTalking();
-  fGenieGHep = NULL;
-  fGenieNtpl = NULL;
-  //  NtpMCEventRecord * fGenieNtpl = 0; tree->SetBranchAddress(gmrec,
-  //  &fGenieNtpl);
-  tn->SetBranchAddress("gmcrec", &fGenieNtpl);
-
-  // Make the custom event read in nvect when calling CalcKinematics
-  fEvent->SetEventAddress(&fGenieNtpl);
-
-  // Set Titles
-  fEventHist->SetNameTitle(
-      (fName + "_EVT").c_str(),
-      (fName + "_EVT;E_{#nu} (GeV); Events (1#times10^{-38})").c_str());
-
-  fXSecHist->SetNameTitle(
-      (fName + "_XSEC").c_str(),
-      (fName + "_XSEC;E_{#nu} (GeV); XSec (1#times10^{-38} cm^{2})").c_str());
-  StartTalking();
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read GENIE file" << std::endl;
-  if (LOG_LEVEL(SAM)) PrintStartInput();
-
-#else
-  ERR(FTL) << "ERROR: Invalid Event File Provided" << std::endl;
-  ERR(FTL) << "GENIE Input Not Enabled." << std::endl;
-  ERR(FTL) << "Rebuild with --enable-genie or check FitBuild.h!" << std::endl;
-  exit(-1);
-#endif
-
-  return;
-}
-
-//********************************************************************
-void InputHandler::ReadGiBUUFile() {
-//********************************************************************
-#ifdef __GiBUU_ENABLED__
-  fEventType = kGiBUU;
-
-  // Open Root File
-  LOG(SAM) << "Opening event file " << fInputFile << std::endl;
-  TFile* rootFile = new TFile(fInputFile.c_str(), "READ");
-  // Get flux histograms NEUT supplies
-  TH1D* numuFlux = dynamic_cast<TH1D*>(rootFile->Get("numu_flux"));
-  TH1D* numubFlux = dynamic_cast<TH1D*>(rootFile->Get("numub_flux"));
-  TH1D* nueFlux = dynamic_cast<TH1D*>(rootFile->Get("nue_flux"));
-  TH1D* nuebFlux = dynamic_cast<TH1D*>(rootFile->Get("nueb_flux"));
-
-  // Replace local pointers with NULL dir'd clones.
-  if (numuFlux) {
-    numuFlux = static_cast<TH1D*>(numuFlux->Clone());
-    numuFlux->Scale(1.0 / numuFlux->Integral("width"));
-    std::cout << "GiBUU Flux: numuFlux, Width integral = "
-              << numuFlux->Integral("width") << std::endl;
-    numuFlux->SetDirectory(NULL);
-    numuFlux->SetNameTitle(
-        (fName + "_numu_FLUX").c_str(),
-        (fName + "; E_{#nu} (GeV); #Phi_{#nu} (A.U.)").c_str());
-    fFluxList.push_back(numuFlux);
-  }
-  if (numubFlux) {
-    numubFlux = static_cast<TH1D*>(numubFlux->Clone());
-    numubFlux->Scale(1.0 / numubFlux->Integral("width"));
-    std::cout << "GiBUU Flux: numubFlux, Width integral = "
-              << numubFlux->Integral("width") << std::endl;
-    numubFlux->SetDirectory(NULL);
-    numubFlux->SetNameTitle(
-        (fName + "_numub_FLUX").c_str(),
-        (fName + "; E_{#nu} (GeV); #Phi_{#bar{#nu}} (A.U.)").c_str());
-    fFluxList.push_back(numubFlux);
-  }
-  if (nueFlux) {
-    nueFlux = static_cast<TH1D*>(nueFlux->Clone());
-    nueFlux->Scale(1.0 / nueFlux->Integral("width"));
-    std::cout << "GiBUU Flux: nueFlux, Width integral = "
-              << nueFlux->Integral("width") << std::endl;
-    nueFlux->SetDirectory(NULL);
-    nueFlux->SetNameTitle(
-        (fName + "_nue_FLUX").c_str(),
-        (fName + "; E_{#nu} (GeV); #Phi_{#nu} (A.U.)").c_str());
-    fFluxList.push_back(nueFlux);
-  }
-  if (nuebFlux) {
-    nuebFlux = static_cast<TH1D*>(nuebFlux->Clone());
-    nuebFlux->Scale(1.0 / nuebFlux->Integral("width"));
-    std::cout << "GiBUU Flux: nuebFlux, Width integral = "
-              << nuebFlux->Integral("width") << std::endl;
-    nuebFlux->SetDirectory(NULL);
-    nuebFlux->SetNameTitle(
-        (fName + "_nueb_FLUX").c_str(),
-        (fName + "; E_{#nu} (GeV); #Phi_{#bar{#nu}} (A.U.)").c_str());
-    fFluxList.push_back(nuebFlux);
-  }
-  rootFile->Close();
-
-  tn = new TChain("giRooTracker");
-  tn->AddFile(fInputFile.c_str());
-
-  GiBUUStdHepReader* giRead = new GiBUUStdHepReader();
-  giRead->SetBranchAddresses(tn);
-  fEvent->SetEventAddress(giRead);
-
-  bool IsNuBarDominant = false;
-  size_t Found_nu = 0;
-  size_t Found_nuMask = ((numuFlux ? 1 : 0) + (numubFlux ? 2 : 0) +
-                         (nueFlux ? 4 : 0) + (nuebFlux ? 8 : 0));
-
-  static const char* specNames[] = {"numu", "numubar", "nue", "nuebar"};
-  size_t nExpected = (Found_nuMask & (1 << 0)) + (Found_nuMask & (1 << 1)) +
-                     (Found_nuMask & (1 << 2)) + (Found_nuMask & (1 << 3));
-  size_t nFound = 0;
-  std::string expectStr = "";
-  for (size_t sn_it = 0; sn_it < 4; ++sn_it) {
-    if (Found_nuMask & (1 << sn_it)) {
-      if (!nFound) {
-        expectStr = "(";
-      }
-      expectStr += specNames[sn_it];
-      nFound++;
-      if (nFound == nExpected) {
-        expectStr += ")";
-      } else {
-        expectStr += ", ";
-      }
-    }
-  }
-
-  LOG(SAM) << "Looking for dominant vector species in GiBUU file ("
-           << fInputFile << ") expecting to find: " << expectStr << std::endl;
-
-  size_t maskHW = GeneralUtils::GetHammingWeight(Found_nuMask);
-  if (maskHW > 2) {
-    LOG(SAM) << "We are looking for more than two species... this will have to "
-                "loop through a large portion of the vector. Please be patient."
-             << std::endl;
-  }
-
-  double SpeciesWeights[] = {0, 0, 0, 0};
-  Long64_t nevt = 0;
-  fNEvents = tn->GetEntries();
-  fFluxHist = NULL;
-  while ((Found_nu != Found_nuMask) && (nevt < fNEvents)) {
-    if ((maskHW == 2) && fFluxHist) {  // If we have found the dominant one can
-                                       // now guess the other
-      size_t OtherBit = GeneralUtils::GetFirstOnBit(Found_nuMask - Found_nu);
-      SpeciesWeights[OtherBit] = 1 - giRead->SpeciesWght;
-      Found_nu += (1 << OtherBit);
-
-      LOG(SAM) << "\tGuessing other species weight as we are only expecting "
-                  "two species. Other species weight: "
-               << SpeciesWeights[OtherBit] << std::endl;
-      continue;
-    }
-
-    tn->GetEntry(nevt++);
-    fEvent->CalcKinematics();
-    FitParticle* isnu = fEvent->GetHMISParticle(PhysConst::pdg_neutrinos);
-    if (!isnu) {
-      continue;
-    }
-    switch (isnu->fPID) {
-      case 12: {
-        if ((Found_nu & 4)) {
-          continue;
-        }
-        Found_nu += 4;
-        SpeciesWeights[2] = giRead->SpeciesWght;
-        LOG(SAM) << "\tGiBUU File: " << fInputFile << " -- ev: " << nevt
-                 << " has IS nu (" << isnu->fPID
-                 << "), species weight: " << giRead->SpeciesWght << std::endl;
-        if ((giRead->SpeciesWght < 0.5) &&
-            (maskHW > 1)) {  // If we only care about a single species, then
-                             // species-weight might not be filled.
-          continue;
-        }
-        fFluxHist = nueFlux;
-        LOG(SAM) << "\tInput file: " << fInputFile
-                 << " determined to be nue dominated vector." << std::endl;
-        break;
-      }
-      case -12: {
-        if ((Found_nu & 8)) {
-          continue;
-        }
-        Found_nu += 8;
-        SpeciesWeights[3] = giRead->SpeciesWght;
-        LOG(SAM) << "\tGiBUU File: " << fInputFile << " -- ev: " << nevt
-                 << " has IS nu (" << isnu->fPID
-                 << "), species weight: " << giRead->SpeciesWght << std::endl;
-        if ((giRead->SpeciesWght < 0.5) &&
-            (maskHW > 1)) {  // If we only care about a single species, then
-                             // species-weight might not be filled.
-          continue;
-        }
-        IsNuBarDominant = true;
-        fFluxHist = nuebFlux;
-        LOG(SAM) << "\tInput file: " << fInputFile
-                 << " determined to be nuebar dominated vector." << std::endl;
-        break;
-      }
-      case 14: {
-        if ((Found_nu & 1)) {
-          continue;
-        }
-        Found_nu += 1;
-        SpeciesWeights[0] = giRead->SpeciesWght;
-        LOG(SAM) << "\tGiBUU File: " << fInputFile << " -- ev: " << nevt
-                 << " has IS nu (" << isnu->fPID
-                 << "), species weight: " << giRead->SpeciesWght << std::endl;
-        if ((giRead->SpeciesWght < 0.5) &&
-            (maskHW > 1)) {  // If we only care about a single species, then
-                             // species-weight might not be filled.
-          continue;
-        }
-        fFluxHist = numuFlux;
-        LOG(SAM) << "\tInput file: " << fInputFile
-                 << " determined to be numu dominated vector." << std::endl;
-        break;
-      }
-      case -14: {
-        if ((Found_nu & 2)) {
-          continue;
-        }
-        Found_nu += 2;
-        SpeciesWeights[1] = giRead->SpeciesWght;
-        LOG(SAM) << "\tGiBUU File: " << fInputFile << " -- ev: " << nevt
-                 << " has IS nu (" << isnu->fPID
-                 << "), species weight: " << giRead->SpeciesWght << std::endl;
-        if ((giRead->SpeciesWght < 0.5) &&
-            (maskHW > 1)) {  // If we only care about a single species, then
-                             // species-weight might not be filled.
-          continue;
-        }
-        IsNuBarDominant = true;
-        fFluxHist = numubFlux;
-        LOG(SAM) << "\tInput file: " << fInputFile
-                 << " determined to be numubar dominated vector." << std::endl;
-        break;
-      }
-      default: {}
-    }
-  }
-
-  if (Found_nu != Found_nuMask) {
-    ERR(FTL) << "Input GiBUU file (" << fInputFile
-             << ") appeared to not contain all the relevant incoming neutrino "
-                "species: Found (numu:"
-             << ((Found_nu & (1 << 0)) ? 1 : 0)
-             << ",numub:" << ((Found_nu & (1 << 1)) ? 1 : 0)
-             << ",nue:" << ((Found_nu & (1 << 2)) ? 1 : 0)
-             << ",nueb:" << ((Found_nu & (1 << 3)) ? 1 : 0)
-             << "), expected: (numu:" << ((Found_nuMask & (1 << 0)) ? 1 : 0)
-             << ",numub:" << ((Found_nuMask & (1 << 1)) ? 1 : 0)
-             << ",nue:" << ((Found_nuMask & (1 << 2)) ? 1 : 0)
-             << ",nueb:" << ((Found_nuMask & (1 << 3)) ? 1 : 0) << ")"
-             << std::endl;
-    throw;
-  }
-
-  if (!fFluxHist) {
-    ERR(FTL) << "Couldn't find: "
-             << (IsNuBarDominant ? "nuXb_flux" : "nuX_flux")
-             << " in input file: " << fInputRootFile->GetName() << std::endl;
-    throw;
-  }
-
-  if (numuFlux) {
-    if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[0])) {
-      numuFlux->Scale(SpeciesWeights[0]);
-    }
-
-    TH1D* numuEvt =
-        static_cast<TH1D*>(numuFlux->Clone((fName + "_numu_EVT").c_str()));
-    numuEvt->Reset();
-    numuEvt->SetBinContent(1, SpeciesWeights[0] * double(fNEvents) /
-                                  numuEvt->GetXaxis()->GetBinWidth(1));
-
-    TH1D* numuXSec =
-        static_cast<TH1D*>(numuEvt->Clone((fName + "_numu_XSEC").c_str()));
-    numuXSec->Divide(fFluxHist);
-
-    numuXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
-  }
-  if (numubFlux) {
-    if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[1])) {
-      numubFlux->Scale(SpeciesWeights[1]);
-    }
-    TH1D* numubEvt =
-        static_cast<TH1D*>(numubFlux->Clone((fName + "_numub_EVT").c_str()));
-    numubEvt->Reset();
-    numubEvt->SetBinContent(1, SpeciesWeights[1] * double(fNEvents) /
-                                   numubEvt->GetXaxis()->GetBinWidth(1));
-
-    TH1D* numubXSec =
-        static_cast<TH1D*>(numubEvt->Clone((fName + "_numub_XSEC").c_str()));
-    numubXSec->Divide(fFluxHist);
-
-    numubXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
-  }
-  if (nueFlux) {
-    if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[2])) {
-      nueFlux->Scale(SpeciesWeights[2]);
-    }
-    TH1D* nueEvt =
-        static_cast<TH1D*>(nueFlux->Clone((fName + "_nue_EVT").c_str()));
-    nueEvt->Reset();
-    nueEvt->SetBinContent(1, SpeciesWeights[2] * double(fNEvents) /
-                                 nueEvt->GetXaxis()->GetBinWidth(1));
-
-    TH1D* nueXSec =
-        static_cast<TH1D*>(nueEvt->Clone((fName + "_nue_XSEC").c_str()));
-    nueXSec->Divide(fFluxHist);
-
-    nueXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
-  }
-  if (nuebFlux) {
-    if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[3])) {
-      nuebFlux->Scale(SpeciesWeights[3]);
-    }
-    TH1D* nuebEvt =
-        static_cast<TH1D*>(nuebFlux->Clone((fName + "_nueb_EVT").c_str()));
-    nuebEvt->Reset();
-    nuebEvt->SetBinContent(1, SpeciesWeights[3] * double(fNEvents) /
-                                  nuebEvt->GetXaxis()->GetBinWidth(1));
-
-    TH1D* nuebXSec =
-        static_cast<TH1D*>(nuebEvt->Clone((fName + "_nueb_XSEC").c_str()));
-    nuebXSec->Divide(fFluxHist);
-
-    nuebXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
-  }
-
-  tn->GetEntry(0);
-
-  LOG(SAM) << "\tInput GiBUU file species weights: (numu:" << SpeciesWeights[0]
-           << ",numub:" << SpeciesWeights[1] << ",nue:" << SpeciesWeights[2]
-           << ",nueb:" << SpeciesWeights[3] << ")" << std::endl;
-
-  fFluxHist->SetNameTitle(
-      (fName + "_FLUX").c_str(),
-      (fName + "; E_{#nu} (GeV);" +
-       (IsNuBarDominant ? "#Phi_{#bar{#nu}} (A.U.)" : "#Phi_{#nu} (A.U.)"))
-          .c_str());
-
-  fEventHist = static_cast<TH1D*>(fFluxHist->Clone((fName + "_EVT").c_str()));
-  fEventHist->Reset();
-  fEventHist->SetBinContent(1, double(fNEvents) *
-                                   TotalIntegratedFlux(0, 1.E5, "width") /
-                                   fEventHist->GetXaxis()->GetBinWidth(1));
-
-  fXSecHist = static_cast<TH1D*>(fEventHist->Clone((fName + "_XSEC").c_str()));
-  fXSecHist->Divide(fFluxHist);
-
-  fXSecHist->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
-
-#else
-  ERR(FTL) << "ERROR: Invalid Event File Provided" << std::endl;
-  ERR(FTL) << "GiBUU Input Not Enabled." << std::endl;
-  ERR(FTL) << "Rebuild with -DUSE_GiBUU=1." << std::endl;
-  exit(-1);
-#endif
-}
-
-//********************************************************************
-void InputHandler::ReadBinSplineFile() {
-  //********************************************************************
-
-  // Bin Splines are saved as one event for each histogram bin.
-  // So just read in as normal event splines and it'll all get sorted easily.
-}
-
-//********************************************************************
-void InputHandler::ReadHistogramFile() {
-  //********************************************************************
-
-  // Convert the raw histogram into a series of events with X variables
-
-  // So we don't have to pass stuff upsteam
-}
-
-//********************************************************************
-void InputHandler::ReadNuanceFile() {
-//********************************************************************
-
-#ifdef __NUANCE_ENABLED__
-  // Read in Nuance output ROOT file (converted from hbook)
-  LOG(SAM) << " Reading NUANCE " << std::endl;
-  fEventType = kNUANCE;
-
-  // Read in NUANCE Tree
-  tn = new TChain("h3");
-  tn->AddFile(fInputFile.c_str());
-
-  // Get entries and fNuwroEvent
-  fNEvents = tn->GetEntries();
-  fNuanceEvt = new NuanceEvent();
-
-  // SetBranchAddress for Nuance
-  //  tn->SetBranchAddress("cc",&fNuanceEvt->cc);
-  //  tn->SetBranchAddress("bound",&fNuanceEvt->bound);
-  tn->SetBranchAddress("neutrino", &fNuanceEvt->neutrino);
-  tn->SetBranchAddress("target", &fNuanceEvt->target);
-  tn->SetBranchAddress("channel", &fNuanceEvt->channel);
-  //  tn->SetBranchAddress("iniQ", &fNuanceEvt->iniQ);
-  //  tn->SetBranchAddress("finQ", &fNuanceEvt->finQ);
-  //  tn->SetBranchAddress("lepton0", &fNuanceEvt->lepton0);
-  //  tn->SetBranchAddress("polar", &fNuanceEvt->polar);
-  //  tn->SetBranchAddress("qsq", &fNuanceEvt->qsq);
-
-  //  tn->SetBranchAddress("w", &fNuanceEvt->w);
-  //  tn->SetBranchAddress("x",&fNuanceEvt->x);
-  //  tn->SetBranchAddress("y",&fNuanceEvt->y);
-
-  tn->SetBranchAddress("p_neutrino", &fNuanceEvt->p_neutrino);
-  tn->SetBranchAddress("p_targ", &fNuanceEvt->p_targ);
-  //  tn->SetBranchAddress("vertex", &fNuanceEvt->vertex);
-  //  tn->SetBranchAddress("start",&fNuanceEvt->start);
-  //  tn->SetBranchAddress("depth",&fNuanceEvt->depth);
-  // tn->SetBranchAddress("flux",&fNuanceEvt->flux);
-
-  tn->SetBranchAddress("n_leptons", &fNuanceEvt->n_leptons);
-  tn->SetBranchAddress("p_ltot", &fNuanceEvt->p_ltot);
-  tn->SetBranchAddress("lepton", &fNuanceEvt->lepton);
-  tn->SetBranchAddress("p_lepton", &fNuanceEvt->p_lepton);
-
-  tn->SetBranchAddress("n_hadrons", &fNuanceEvt->n_hadrons);
-  tn->SetBranchAddress("p_htot", &fNuanceEvt->p_htot);
-  tn->SetBranchAddress("hadron", &fNuanceEvt->hadron);
-  tn->SetBranchAddress("p_hadron", &fNuanceEvt->p_hadron);
-
-  fEvent->SetEventAddress(&fNuanceEvt);
-  double EnuMin = 0.0;     // tn->GetMinimum("p_neutrino[3]");
-  double EnuMax = 1000.0;  // tn->GetMaximum("p_neutrino[3]");
-
-  fFluxHist = new TH1D((fName + "_FLUX").c_str(), (fName + "_FLUX").c_str(),
-                       100, EnuMin, EnuMax);
-  for (int i = 0; i < fFluxHist->GetNbinsX(); i++) {
-    fFluxHist->SetBinContent(i + 1, 1.0);
-  }
-  fFluxHist->Scale(1.0 / fFluxHist->Integral());
-
-  fEventHist = new TH1D((fName + "_EVT").c_str(), (fName + "_EVT").c_str(), 100,
-                        EnuMin, EnuMax);
-  for (int i = 0; i < fFluxHist->GetNbinsX(); i++) {
-    fEventHist->SetBinContent(i + 1, 1.0);
-  }
-  fEventHist->Scale(1.0 / fEventHist->Integral());
-
-  fXSecHist = (TH1D*)fEventHist->Clone();
-  fXSecHist->Divide(fFluxHist);
-
-  // Print out what was read in
-  LOG(SAM) << " -> Successfully Read NUANCE file" << std::endl;
-  if (LOG_LEVEL(SAM)) PrintStartInput();
-
-#else
-  ERR(FTL) << "ERROR: Invalid Event File Provided" << std::endl;
-  ERR(FTL) << "NUANCE Input Not Enabled." << std::endl;
-  ERR(FTL) << "Rebuild with -DUSE_NUANCE=1!" << std::endl;
-  exit(-1);
-#endif
-}
-
-//********************************************************************
-void InputHandler::PrintStartInput() {
-  //********************************************************************
-
-  LOG(SAM) << " -> Total events = " << fNEvents << std::endl;
-  LOG(SAM) << " -> Energy Range = " << fFluxHist->GetXaxis()->GetXmin() << "-"
-           << fFluxHist->GetXaxis()->GetXmax() << " GeV" << std::endl;
-  LOG(SAM) << " -> Integrated Flux Hist = "
-           << fFluxHist->Integral(0, fFluxHist->GetNbinsX(), "width")
-           << std::endl;
-
-  LOG(SAM) << " -> Integrated Event Hist = "
-           << fEventHist->Integral(0, fEventHist->GetNbinsX(), "width")
-           << std::endl;
-
-  LOG(SAM) << " -> Integrated Inclusive XSec = "
-           << (fEventHist->Integral(0, fEventHist->GetNbinsX(), "width") /
-               fFluxHist->Integral(0, fFluxHist->GetNbinsX(), "width")) *
-                  1E-38
-           << std::endl;
-  LOG(SAM) << " -> Integrated XSec Hist = " << fXSecHist->Integral("width")
-           << endl;
-
-  if (fEventType == kEVTSPLINE) return;
-
-  // Get First event info
-  StopTalking();
-  tn->GetEntry(0);
-  StartTalking();
-
-  fEvent->CalcKinematics();
-  LOG(SAM) << " -> Event 0. Neutrino PDG = " << fEvent->PartInfo(0)->fPID
-           << std::endl;
-  LOG(SAM) << "             Target A     = " << fEvent->GetTargetA()
-           << std::endl;
-  LOG(SAM) << "             Target Z     = " << fEvent->GetTargetZ()
-           << std::endl;
-}
-
-//********************************************************************
-std::string InputHandler::GetInputStateString() {
-  //********************************************************************
-
-  tn->GetEntry(0);
-  fEvent->CalcKinematics();
-  std::ostringstream state;
-  state << "T" << fEventType << "_PDG" << fEvent->PartInfo(0)->fPID << "_Z"
-        << fEvent->GetTargetZ() << "_A" << fEvent->GetTargetA();
-
-  return state.str();
-}
-
-//********************************************************************
-void InputHandler::ReadEvent(unsigned int i) {
-  //********************************************************************
-
-  bool using_events = (fEventType == kNEUT || fEventType == kGENIE ||
-                       fEventType == kNUWRO || fEventType == kEVTSPLINE ||
-                       fEventType == kNUANCE || fEventType == kGiBUU);
-
-  if (using_events) {
-    tn->LoadTree(i);
-    tn->GetEntry(i);
-    fEvent->CalcKinematics();
-    fEvent->Index = i;
-    fEventIndex = i;
-    fEvent->InputWeight = GetInputWeight(i);
-  } else {
-    GetTreeEntry(i);
-  }
-}
-
-//********************************************************************
-void InputHandler::GetTreeEntry(const Long64_t i) {
-  //********************************************************************
-
-  // If we're just reading from the input root file
-  if (fEventType != kEVTSPLINE) {
-    tn->GetEntry(i);
-  } else {
-    fEvent->FillCoeff(fSplineArray[i]);
-  }
-
-  fEventIndex = i;
-  fEvent->InputWeight = GetInputWeight(i);
-}
-
-//********************************************************************
-double InputHandler::GetInputWeight(const int entry) {
-  //********************************************************************
-
-  if (fEventType == kGiBUU) {
-    return fEvent->InputWeight;
-  }
-
-  //  if (fEventType == kGENIE) {
-  //    return fEvent->InputWeight;
-  //  }
-
-  if (!fIsJointInput) {
-    return 1.0;
-  }
-  double weight = 1.0;
-
-  // Find Histogram
-  for (UInt_t j = 0; j < fJointIndexLow.size(); j++) {
-    if (entry >= fJointIndexLow.at(j) and entry < fJointIndexHigh.at(j)) {
-      weight *= fJointIndexScale.at(j);
-      break;
-    }
-  }
-
-  return weight;
-}
-
-//********************************************************************
-int InputHandler::GetGenEvents() {
-  //********************************************************************
-
-  if (fEventType == 6)
-    return fSplineHead->ngen_events;
-  else
-    return GetNEvents();
-}
-
-//********************************************************************
-double InputHandler::TotalIntegratedFlux(double low, double high,
-                                         std::string intOpt) {
-  //********************************************************************
-
-  Int_t minBin = fFluxHist->GetXaxis()->FindFixBin(low);
-  Int_t maxBin = fFluxHist->GetXaxis()->FindFixBin(high);
-
-  if ((fFluxHist->IsBinOverflow(minBin) && (low != -9999.9))) {
-    minBin = 1;
-  }
-
-  if ((fFluxHist->IsBinOverflow(maxBin) && (high != -9999.9))) {
-    maxBin = fFluxHist->GetXaxis()->GetNbins() + 1;
-  }
-
-
-  // If we are within a single bin
-  if (minBin == maxBin) {
-    // Get the contained fraction of the single bin's width
-    return ((high - low) / fFluxHist->GetXaxis()->GetBinWidth(minBin)) *
-           fFluxHist->Integral(minBin, minBin, intOpt.c_str());
-  }
-
-  double lowBinUpEdge = fFluxHist->GetXaxis()->GetBinUpEdge(minBin);
-  double highBinLowEdge = fFluxHist->GetXaxis()->GetBinLowEdge(maxBin);
-
-  double lowBinfracIntegral =
-      ((lowBinUpEdge - low) / fFluxHist->GetXaxis()->GetBinWidth(minBin)) *
-      fFluxHist->Integral(minBin, minBin, intOpt.c_str());
-  double highBinfracIntegral =
-      ((high - highBinLowEdge) / fFluxHist->GetXaxis()->GetBinWidth(maxBin)) *
-      fFluxHist->Integral(maxBin, maxBin, intOpt.c_str());
-
-  // If they are neighbouring bins
-  if ((minBin + 1) == maxBin) {
-    // Get the contained fraction of the two bin's width
-    return lowBinfracIntegral + highBinfracIntegral;
-  }
-
-  // If there are filled bins between them
-  return lowBinfracIntegral + highBinfracIntegral +
-         fFluxHist->Integral(minBin + 1, maxBin - 1, intOpt.c_str());
-}
-
-//********************************************************************
-double InputHandler::PredictedEventRate(double low, double high,
-                                        std::string intOpt) {
-  //********************************************************************
-
-  int minBin = fFluxHist->GetXaxis()->FindBin(low);
-  int maxBin = fFluxHist->GetXaxis()->FindBin(high);
-
-  return fEventHist->Integral(minBin, maxBin + 1, intOpt.c_str());
-}
diff --git a/src/FitBase/InputHandler.h b/src/FitBase/InputHandler.h
deleted file mode 100644
index 9133f08..0000000
--- a/src/FitBase/InputHandler.h
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef INPUT_HANDLER_H
-#define INPUT_HANDLER_H
-
-#include <cstring>
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "stdint.h"
-
-#include "TObject.h"
-
-#include "FitEvent.h"
-#include "FitParameters.h"
-#include "FitUtils.h"
-#include "FitWeight.h"
-#include "PlotUtils.h"
-#include "InputUtils.h"
-
-#ifdef __GENIE_ENABLED__
-#include "Conventions/Units.h"
-#endif
-
-class InputHandler {
- public:
-  InputHandler(void){};
-  ~InputHandler(void){};
-
-  InputHandler(std::string const& handle, InputUtils::InputType inpType,
-               std::string const& inputs);
-
-  void ReadBinSplineFile(void);
-  void ReadHistogramFile(void);
-  void ReadNeutFile(void);
-  void ReadNuanceFile(void);
-  void ReadGenieFile(void);
-  void ReadNuWroFile(void);
-  void ReadEventSplineFile(void);
-  void ReadJointFile(void);
-  void ReadGiBUUFile(void);
-  void ReadEmptyEvents(void);  // For Validations
-  void ReadFitEvents(void);
-  FitSplineHead* GetSplineHead(void);
-
-  double PredictedEventRate(double low, double high,
-                            std::string intOpt = "width");
-  double TotalIntegratedFlux(double low, double high,
-                             std::string intOpt = "width");
-
-  inline FitEvent* GetEventPointer(void) { return fEvent; };
-  inline BaseFitEvt* GetSignalPointer(void) { return fSignalEvent; };
-
-  inline int GetNEvents(void) const { return fNEvents; };
-  int GetGenEvents(void);
-  std::string GetInputFileName(){return fInputFile; }
-  InputUtils::InputType GetInputFileType(){return fInputType; }
-
-  void PrintStartInput(void);
-  void ReadEvent(unsigned int i);
-
-  inline TH1D* GetFluxHistogram(void) { return fFluxHist; };
-  inline TH1D* GetEventHistogram(void) { return fEventHist; };
-  inline TH1D* GetXSecHistogram(void) { return fXSecHist; };
-
-  std::vector<TH1*> GetFluxList(void) { return fFluxList; };
-  std::vector<TH1*> GetEventList(void) { return fEventList; };
-  std::vector<TH1*> GetXSecList(void) { return fXSecList; };
-
-  inline int GetType(void) const { return fEventType; };
-
-  bool CanIGoFast(void);
-  void GetTreeEntry(const Long64_t entry);
-  std::string GetInputStateString(void);
-  double GetInputWeight(const int entry = -1);
-
-  void SetupCache();
-
- protected:
-  FitEvent* fEvent;
-  int fEventType;
-  BaseFitEvt* fSignalEvent;
-
-  FitSplineHead* fSplineHead;
-
-  int fMaxEvents;
-  int fNEvents;
-  int fEventIndex;
-
-  TH1D* fFluxHist;
-  TH1D* fEventHist;
-  TH1D* fXSecHist;
-
-  std::string fName;
-  std::string fInput;
-
-  InputUtils::InputType fInputType;
-  std::string fInputFile;
-  TFile* fInputRootFile;
-
-  std::vector<BaseFitEvt*> fAllBaseEvents;
-
-  std::vector<int> fJointIndexLow;
-  std::vector<int> fJointIndexHigh;
-  std::vector<TH1D*> fJointIndexHist;
-  std::vector<double> fJointIndexScale;
-  bool fIsJointInput;
-  bool fIsExplicitJointInput; // Kept for backwards compatibility
-
-  std::vector<TH1*> fXSecList;
-  std::vector<TH1*> fEventList;
-  std::vector<TH1*> fFluxList;
-
-  double** fSplineArray;
-//  std::vector<double*> fAllSplines;
-
-// Horribly Wrapped Event Objects!
-// Have to add this hear incase one generator isn't supported.
-#ifdef __NEUT_ENABLED__
-  NeutVect* fNeutVect;  //!< Pointer to NEUT Events
-#endif
-#ifdef __NUWRO_ENABLED__
-  event*
-      fNuwroEvent;  //!< Pointer to NuWro Events (Set to bool if NUWRO disabled)
-#endif
-#ifdef __GENIE_ENABLED__
-  GHepRecord* fGenieGHep;
-  NtpMCEventRecord* fGenieNtpl;
-#endif
-#ifdef __NUANCE_ENABLED__
-  NuanceEvent* fNuanceEvt;
-#endif
-
-  TChain* tn;
-};
-#endif
diff --git a/src/FitBase/InputTypes.h b/src/FitBase/InputTypes.h
new file mode 100644
index 0000000..130cf86
--- /dev/null
+++ b/src/FitBase/InputTypes.h
@@ -0,0 +1,68 @@
+//! Global Enum to define generator type being read with FitEvent
+// Have to define kNORM as if its a generator for the time being.
+enum generator_event_type {
+  kUNKNOWN = 999,
+  kNEUT = 0,
+  kNIWG = 1,
+  kNUWRO = 2,
+  kT2K = 3,
+  kCUSTOM = 4,
+  kGENIE = 5,
+  kEVTSPLINE = 6,
+  kNUANCE = 7,
+  kGiBUU = 8,
+  kNORM = 9,
+  kMODENORM = 10,
+  kEMPTY = 11,
+  kINPUTFITEVENT = 12,
+  kNEWSPLINE = 13,
+  kLIKEWEIGHT = 14,
+  kSPLINEPARAMETER = 15,
+  kHEPMC = 16,
+};
+
+inline std::ostream& operator<<(std::ostream& os,
+                                generator_event_type const& gs) {
+  switch (gs) {
+    case kUNKNOWN: {
+      return os << "kUNKNOWN";
+    }
+    case kNEUT: {
+      return os << "kNEUT";
+    }
+    case kNIWG: {
+      return os << "kNIWG";
+    }
+    case kNUWRO: {
+      return os << "kNUWRO";
+    }
+    case kT2K: {
+      return os << "kT2K";
+    }
+    case kCUSTOM: {
+      return os << "kCUSTOM";
+    }
+    case kGENIE: {
+      return os << "kGENIE";
+    }
+    case kEVTSPLINE: {
+      return os << "kEVTSPLINE";
+    }
+    case kNUANCE: {
+      return os << "kNUANCE";
+    }
+    case kGiBUU: {
+      return os << "kGiBUU";
+    }
+    case kNORM: {
+      return os << "kNORM";
+    }
+    case kMODENORM: {
+      return os << "kMODENORM";
+    }
+  case kHEPMC: {
+    return os << "kHEPMC";
+  }
+    default: { return os << "kUNKNOWN"; }
+  }
+}
diff --git a/src/FitBase/InputUtils.h b/src/FitBase/InputUtils.h
deleted file mode 100644
index c3568ed..0000000
--- a/src/FitBase/InputUtils.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
-
-/*******************************************************************************
-*    This file is part of NUISANCE.
-*
-*    NUISANCE is free software: you can redistribute it and/or modify
-*    it under the terms of the GNU General Public License as published by
-*    the Free Software Foundation, either version 3 of the License, or
-*    (at your option) any later version.
-*
-*    NUISANCE is distributed in the hope that it will be useful,
-*    but WITHOUT ANY WARRANTY; without even the implied warranty of
-*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-*    GNU General Public License for more details.
-*
-*    You should have received a copy of the GNU General Public License
-*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
-*******************************************************************************/
-
-#ifndef INPUT_UTILS_H
-#define INPUT_UTILS_H
-
-#include <string>
-#include "TFile.h"
-
-namespace InputUtils {
-
-enum InputType {
-  kNEUT_Input = 0,
-  kNUWRO_Input,
-  kGENIE_Input,
-  kGiBUU_Input,
-  kNUANCE_Input,
-  kEVSPLN_Input,
-  kEMPTY_Input,
-  kFEVENT_Input,
-  kJOINT_Input,  // Kept for backwards compatibility
-  kInvalid_Input,
-  kHIST_Input,   // Not sure if this are currently used.
-  kBNSPLN_Input  // Not sure if this are currently used.
-};
-
-inline std::string EnsureTrailSlash(std::string str) {
-  if (str[str.length() - 1] != '/') {
-    str += '/';
-  }
-  return str;
-}
-
-inline std::string RemoveDoubleSlash(std::string str) {
-  size_t torpl = str.find("//");
-  while (torpl != std::string::npos) {
-    str.replace(torpl, 2, "/");
-    torpl = str.find("//");
-  }
-  return str;
-}
-
-InputType ParseInputType(std::string const &inp);
-bool IsJointInput(std::string const &inputs);
-std::string ExpandInputDirectories(std::string const &inputs);
-
-InputType GuessInputTypeFromFile(TFile *inpF);
-std::string PrependGuessedInputTypeToName(std::string const &inpFName);
-}
-
-inline std::ostream &operator<<(std::ostream &os, InputUtils::InputType it) {
-  switch (it) {
-    case InputUtils::kNEUT_Input: {
-      return os << "kNEUT_Input";
-    }
-    case InputUtils::kNUWRO_Input: {
-      return os << "kNUWRO_Input";
-    }
-    case InputUtils::kGENIE_Input: {
-      return os << "kGENIE_Input";
-    }
-    case InputUtils::kGiBUU_Input: {
-      return os << "kGiBUU_Input";
-    }
-    case InputUtils::kNUANCE_Input: {
-      return os << "kNUANCE_Input";
-    }
-    case InputUtils::kEVSPLN_Input: {
-      return os << "kEVSPLN_Input";
-    }
-    case InputUtils::kEMPTY_Input: {
-      return os << "kEMPTY_Input";
-    }
-    case InputUtils::kFEVENT_Input: {
-      return os << "kFEVENT_Input";
-    }
-    case InputUtils::kJOINT_Input: {
-      return os << "kJOINT_Input";
-    }
-    case InputUtils::kInvalid_Input:
-    case InputUtils::kHIST_Input:
-    case InputUtils::kBNSPLN_Input:
-    default: { return os << "kInvalid_Input"; }
-  }
-}
-
-#endif
diff --git a/src/FitBase/JointMeas1D.cxx b/src/FitBase/JointMeas1D.cxx
index 2f9e7ba..46226ac 100644
--- a/src/FitBase/JointMeas1D.cxx
+++ b/src/FitBase/JointMeas1D.cxx
@@ -1,518 +1,2209 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
+*    This ile is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "JointMeas1D.h"
+
+
+//********************************************************************
+JointMeas1D::JointMeas1D(void) {
+//********************************************************************
+
+  // XSec Scalings
+  fScaleFactor = -1.0;
+  fCurrentNorm = 1.0;
+
+  // Histograms
+  fDataHist = NULL;
+  fDataTrue = NULL;
+
+  fMCHist = NULL;
+  fMCFine = NULL;
+  fMCWeighted = NULL;
+
+  fMaskHist = NULL;
+
+  // Covar
+  covar = NULL;
+  fFullCovar = NULL;
+
+  fCovar  = NULL;
+  fInvert = NULL;
+  fDecomp = NULL;
+
+  // Fake Data
+  fFakeDataInput = "";
+  fFakeDataFile  = NULL;
+
+  // Options
+  fDefaultTypes = "FIX/FULL/CHI2";
+  fAllowedTypes =
+    "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/MASK";
+
+  fIsFix = false;
+  fIsShape = false;
+  fIsFree = false;
+  fIsDiag = false;
+  fIsFull = false;
+  fAddNormPen = false;
+  fIsMask = false;
+  fIsChi2SVD = false;
+  fIsRawEvents = false;
+  fIsDifXSec = false;
+  fIsEnu1D = false;
+
+  // Inputs
+  fInput = NULL;
+  fRW = NULL;
+
+  // Extra Histograms
+  fMCHist_Modes = NULL;
+
+  for (std::vector<MeasurementBase*>::const_iterator iter = fSubChain.begin();
+       iter != fSubChain.end(); iter++) {
+    MeasurementBase* exp = *iter;
+    if (exp) delete exp;
+  }
+  fSubChain.clear();
+
+  // Flags for Joint Measurements
+  fIsRatio = false;
+  fIsSummed = false;
+  fSaveSubMeas = false;
+
+  fIsJoint = true;
+
+}
+
+
+//********************************************************************
+void JointMeas1D::SetupDefaultHist() {
+  //********************************************************************
+
+  // Setup fMCHist
+  fMCHist = (TH1D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fName + "_MC").c_str(),
+                        (fName + "_MC" + fPlotTitles).c_str());
+
+  // Setup fMCFine
+  Int_t nBins = fMCHist->GetNbinsX();
+  fMCFine = new TH1D(
+    (fName + "_MC_FINE").c_str(), (fName + "_MC_FINE" + fPlotTitles).c_str(),
+    nBins * 6, fMCHist->GetBinLowEdge(1), fMCHist->GetBinLowEdge(nBins + 1));
+
+  fMCStat = (TH1D*)fMCHist->Clone();
+  fMCStat->Reset();
+
+  fMCHist->Reset();
+  fMCFine->Reset();
+
+  // Setup the NEUT Mode Array
+  PlotUtils::CreateNeutModeArray((TH1D*)fMCHist, (TH1**)fMCHist_PDG);
+  PlotUtils::ResetNeutModeArray((TH1**)fMCHist_PDG);
+
+  // Setup bin masks using sample name
+  if (fIsMask) {
+    std::string maskloc = FitPar::Config().GetParDIR(fName + ".mask");
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + fName + ".mask";
+    }
+
+    SetBinMask(maskloc);
+  }
+
+  fMCHist_Modes = new TrueModeStack( (fName + "_MODES").c_str(), ("True Channels"), fMCHist);
+  SetAutoProcessTH1(fMCHist_Modes);
+
+  return;
+}
+
+
+//********************************************************************
+JointMeas1D::~JointMeas1D(void) {
+//********************************************************************
+
+  if (fDataHist)   delete fDataHist;
+  if (fDataTrue)   delete fDataTrue;
+  if (fMCHist)     delete fMCHist;
+  if (fMCFine)     delete fMCFine;
+  if (fMCWeighted) delete fMCWeighted;
+  if (fMaskHist)   delete fMaskHist;
+  if (covar)       delete covar;
+  if (fFullCovar)  delete fFullCovar;
+  if (fCovar)      delete fCovar;
+  if (fInvert)     delete fInvert;
+  if (fDecomp)     delete fDecomp;
+
+  for (std::vector<MeasurementBase*>::const_iterator iter = fSubChain.begin();
+       iter != fSubChain.end(); iter++) {
+    MeasurementBase* exp = *iter;
+    if (exp) delete exp;
+  }
+  fSubChain.clear();
+
+
+
+}
+
+//********************************************************************                                                                                                                                                                     
+SampleSettings JointMeas1D::LoadSampleSettings(nuiskey samplekey){
+//********************************************************************                                                                                                                                                                      
+  SampleSettings s = MeasurementBase::LoadSampleSettings(samplekey);
+
+  // Parse Inputs                                                                                                                                                                                                                          
+  fSubInFiles.clear();
+
+  std::vector<std::string> entries = GeneralUtils::ParseToStr(s.GetS("input"), ";");
+
+  if (entries.size() < 2) {
+    ERR(FTL) << "Joint measurement expected to recieve at least two semi-colon "
+             "separated input files, but recieved: \""
+             << s.GetS("input") << "\"" << std::endl;
+    throw;
+  }
+
+  std::vector<std::string> first_file_descriptor =
+    GeneralUtils::ParseToStr(entries.front(), ":");
+
+  if (first_file_descriptor.size() != 2) {
+    ERR(FTL) << "Found Joint measurement where the input file had no type: \""
+             << s.GetS("input") << "\", expected \"INPUTTYPE:File.root;File2.root\"."
+             << std::endl;
+    throw;
+  }
+  std::string inpType = first_file_descriptor[0];
+
+
+  for (std::vector<string>::iterator iter = entries.begin();
+       iter != entries.end(); iter++) {
+    if (GeneralUtils::ParseToStr(*iter, ":").size() != 2) {
+      std::stringstream ss("");
+      ss << inpType << ":" << (*iter);
+      fSubInFiles.push_back(ss.str());
+    } else {
+      fSubInFiles.push_back(*iter);
+    }
+  }
+
+  return s;
+}
+
+//********************************************************************
+void JointMeas1D::FinaliseSampleSettings() {
+//********************************************************************
+
+  // Setup naming + renaming
+  fName = fSettings.GetName();
+  fSettings.SetS("originalname", fName);
+  if (fSettings.Has("rename")) {
+    fName = fSettings.GetS("rename");
+    fSettings.SetS("name", fName);
+  }
+
+  // Setup all other options
+  LOG(SAM) << "Finalising Sample Settings: " << fName << std::endl;
+
+  if ((fSettings.GetS("originalname").find("Evt") != std::string::npos)) {
+    fIsRawEvents = true;
+    LOG(SAM) << "Found event rate measurement but using poisson likelihoods."
+             << std::endl;
+  }
+
+  if (fSettings.GetS("originalname").find("XSec_1DEnu") != std::string::npos) {
+    fIsEnu1D = true;
+    LOG(SAM) << "::" << fName << "::" << std::endl;
+    LOG(SAM) << "Found XSec Enu measurement, applying flux integrated scaling, "
+             << "not flux averaged!" << std::endl;
+  }
+
+  if (fIsEnu1D && fIsRawEvents) {
+    LOG(SAM) << "Found 1D Enu XSec distribution AND fIsRawEvents, is this "
+             "really correct?!"
+             << std::endl;
+    LOG(SAM) << "Check experiment constructor for " << fName
+             << " and correct this!" << std::endl;
+    LOG(SAM) << "I live in " << __FILE__ << ":" << __LINE__ << std::endl;
+    exit(-1);
+  }
+
+  // Parse Inputs
+  fSubInFiles.clear();
+
+  std::vector<std::string> entries = GeneralUtils::ParseToStr(fSettings.GetS("input"), ";");
+
+  if (entries.size() < 2) {
+    ERR(FTL) << "Joint measurement expected to recieve at least two semi-colon "
+             "separated input files, but recieved: \""
+             << fSettings.GetS("input") << "\"" << std::endl;
+    throw;
+  }
+
+  std::vector<std::string> first_file_descriptor =
+    GeneralUtils::ParseToStr(entries.front(), ":");
+
+  if (first_file_descriptor.size() != 2) {
+    ERR(FTL) << "Found Joint measurement where the input file had no type: \""
+             << fSettings.GetS("input") << "\", expected \"INPUTTYPE:File.root;File2.root\"."
+             << std::endl;
+    throw;
+  }
+  std::string inpType = first_file_descriptor[0];
+
+
+  for (std::vector<string>::iterator iter = entries.begin();
+       iter != entries.end(); iter++) {
+    if (GeneralUtils::ParseToStr(*iter, ":").size() != 2) {
+      std::stringstream ss("");
+      ss << inpType << ":" << (*iter);
+      fSubInFiles.push_back(ss.str());
+    } else {
+      fSubInFiles.push_back(*iter);
+    }
+  }
+
+
+  // Setup options
+  SetFitOptions(fDefaultTypes); // defaults
+  SetFitOptions(fSettings.GetS("type")); // user specified
+
+  EnuMin = GeneralUtils::StrToDbl(fSettings.GetS("enu_min"));
+  EnuMax = GeneralUtils::StrToDbl(fSettings.GetS("enu_max"));
+
+  if (fAddNormPen) {
+    if (fNormError <= 0.0) {
+      ERR(WRN) << "Norm error for class " << fName << " is 0.0!" << std::endl;
+      ERR(WRN) << "If you want to use it please add fNormError=VAL" << std::endl;
+      throw;
+    }
+  }
+
+  if (!fRW) fRW = FitBase::GetRW();
+
+
+  LOG(SAM) << "Finalised Sample Settings" << std::endl;
+
+}
+
+//********************************************************************
+void JointMeas1D::SetDataFromTextFile(std::string datafile) {
+//********************************************************************
+
+  LOG(SAM) << "Reading data from text file: " << datafile << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromFile(datafile,
+                                         fSettings.GetName() + "_data",
+                                         fSettings.GetFullTitles());
+
+}
+
+//********************************************************************
+void JointMeas1D::SetDataFromRootFile(std::string datafile,
+                                        std::string histname) {
+//********************************************************************
+
+  LOG(SAM) << "Reading data from root file: " << datafile << ";" << histname << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile(datafile, histname);
+  fDataHist->SetNameTitle((fSettings.GetName() + "_data").c_str(),
+                          (fSettings.GetFullTitles()).c_str());
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::SetPoissonErrors() {
+//********************************************************************
+
+  if (!fDataHist) {
+    ERR(FTL) << "Need a data hist to setup possion errors! " << std::endl;
+    ERR(FTL) << "Setup Data First!" << std::endl;
+    throw;
+  }
+
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, sqrt(fDataHist->GetBinContent(i + 1)));
+  }
+}
+
+//********************************************************************
+void JointMeas1D::SetCovarFromDiagonal(TH1D* data) {
+//********************************************************************
+
+  if (!data and fDataHist) {
+    data = fDataHist;
+  }
+
+  if (data) {
+    LOG(SAM) << "Setting diagonal covariance for: " << data->GetName() << std::endl;
+    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(data);
+    covar      = StatUtils::GetInvert(fFullCovar);
+    fDecomp    = StatUtils::GetDecomp(fFullCovar);
+  } else {
+    ERR(FTL) << "No data input provided to set diagonal covar from!" << std::endl;
+
+  }
+
+  if (!fIsDiag) {
+    ERR(FTL) << "SetCovarMatrixFromDiag called for measurement "
+             << "that is not set as diagonal." << std::endl;
+    throw;
+  }
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCovarFromTextFile(std::string covfile, int dim) {
+//********************************************************************
+
+  LOG(SAM) << "Reading covariance from text file: " << covfile << std::endl;
+  fFullCovar = StatUtils::GetCovarFromTextFile(covfile, dim);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCovarFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
+
+  LOG(SAM) << "Reading covariance from text file: " << covfile << ";" << histname << std::endl;
+  fFullCovar = StatUtils::GetCovarFromRootFile(covfile, histname);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCovarInvertFromTextFile(std::string covfile, int dim) {
+//********************************************************************
+
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << std::endl;
+  covar       = StatUtils::GetCovarFromTextFile(covfile, dim);
+  fFullCovar  = StatUtils::GetInvert(covar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCovarInvertFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
+
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << ";" << histname << std::endl;
+  covar      = StatUtils::GetCovarFromRootFile(covfile, histname);
+  fFullCovar = StatUtils::GetInvert(covar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCorrelationFromTextFile(std::string covfile, int dim) {
+//********************************************************************
+
+  if (dim == -1) dim = fDataHist->GetNbinsX();
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << dim << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromTextFile(covfile, dim);
+
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
+  }
+
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(dim);
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
+    }
+  }
+
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
+
+  delete correlation;
+}
+
+//********************************************************************
+void JointMeas1D::SetCorrelationFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
+
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << histname << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromRootFile(covfile, histname);
+
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
+  }
+
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(fDataHist->GetNbinsX());
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
+    }
+  }
+
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
+
+  delete correlation;
+}
+
+
+//********************************************************************
+void JointMeas1D::SetCholDecompFromTextFile(std::string covfile, int dim) {
+//********************************************************************
+
+  LOG(SAM) << "Reading cholesky from text file: " << covfile << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromTextFile(covfile, dim, dim);
+
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
+  trans->T();
+  (*trans) *= (*temp);
+
+  fFullCovar  = new TMatrixDSym(dim, trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
+
+  delete temp;
+  delete trans;
+
+}
+
+//********************************************************************
+void JointMeas1D::SetCholDecompFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
+
+  LOG(SAM) << "Reading cholesky decomp from root file: " << covfile << ";" << histname << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromRootFile(covfile, histname);
+
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
+  trans->T();
+  (*trans) *= (*temp);
+
+  fFullCovar  = new TMatrixDSym(temp->GetNrows(), trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
+
+  delete temp;
+  delete trans;
+}
+
+
+//********************************************************************
+void JointMeas1D::ScaleData(double scale) {
+//********************************************************************
+  fDataHist->Scale(scale);
+}
+
+//********************************************************************
+void JointMeas1D::ScaleCovar(double scale) {
+//********************************************************************
+  (*fFullCovar) *= scale;
+  (*covar) *= 1.0 / scale;
+  (*fDecomp) *= sqrt(scale);
+}
+
+
+//********************************************************************
+void JointMeas1D::SetBinMask(std::string maskfile) {
+//********************************************************************
+
+  if (!fIsMask) return;
+  LOG(SAM) << "Reading bin mask from file: " << maskfile << std::endl;
+
+  // Create a mask histogram with dim of data
+  int nbins = fDataHist->GetNbinsX();
+  fMaskHist =
+    new TH1I((fSettings.GetName() + "_BINMASK").c_str(),
+             (fSettings.GetName() + "_BINMASK; Bin; Mask?").c_str(), nbins, 0, nbins);
+  std::string line;
+  std::ifstream mask(maskfile.c_str(), ifstream::in);
+
+  if (!mask.is_open()) {
+    LOG(FTL) << " Cannot find mask file." << std::endl;
+    throw;
+  }
+
+  while (std::getline(mask >> std::ws, line, '\n')) {
+    std::vector<int> entries = GeneralUtils::ParseToInt(line, " ");
+
+    // Skip lines with poorly formatted lines
+    if (entries.size() < 2) {
+      LOG(WRN) << "JointMeas1D::SetBinMask(), couldn't parse line: " << line
+               << std::endl;
+      continue;
+    }
+
+    // The first index should be the bin number, the second should be the mask
+    // value.
+    int val = 0;
+    if (entries[1] > 0) val = 1;
+    fMaskHist->SetBinContent(entries[0], val);
+  }
+
+  // Apply masking by setting masked data bins to zero
+  PlotUtils::MaskBins(fDataHist, fMaskHist);
+
+  return;
+}
+
+
+
+//********************************************************************
+void JointMeas1D::FinaliseMeasurement() {
+//********************************************************************
+
+  LOG(SAM) << "Finalising Measurement: " << fName << std::endl;
+
+  // Make sure data is setup
+  if (!fDataHist) {
+    ERR(FTL) << "No data has been setup inside " << fName << " constructor!" << std::endl;
+    throw;
+  }
+
+  // Make sure covariances are setup
+  if (!fFullCovar) {
+    SetCovarFromDiagonal(fDataHist);
+  }
+
+  if (!covar) {
+    covar = StatUtils::GetInvert(fFullCovar);
+  }
+
+  if (!fDecomp) {
+    fDecomp = StatUtils::GetDecomp(fFullCovar);
+  }
+
+  // Setup fMCHist from data
+  fMCHist = (TH1D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fSettings.GetName() + "_MC").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCHist->Reset();
+
+  // Setup fMCFine
+  fMCFine = new TH1D("mcfine", "mcfine", fDataHist->GetNbinsX(),
+                     fMCHist->GetBinLowEdge(1),
+                     fMCHist->GetBinLowEdge(fDataHist->GetNbinsX() + 1));
+  fMCFine->SetNameTitle((fSettings.GetName() + "_MC_FINE").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCFine->Reset();
+
+  // Setup MC Stat
+  fMCStat = (TH1D*)fMCHist->Clone();
+  fMCStat->Reset();
+
+  // Search drawopts for possible types to include by default
+  std::string drawopts = FitPar::Config().GetParS("drawopts");
+  if (drawopts.find("MODES") != std::string::npos) {
+    fMCHist_Modes = new TrueModeStack( (fSettings.GetName() + "_MODES").c_str(),
+                                       ("True Channels"), fMCHist);
+    SetAutoProcessTH1(fMCHist_Modes);
+  }
+
+  // Setup bin masks using sample name
+  if (fIsMask) {
+
+    std::string curname  = fName;
+    std::string origname = fSettings.GetS("originalname");
+
+    // Check rename.mask
+    std::string maskloc = FitPar::Config().GetParDIR(curname + ".mask");
+
+    // Check origname.mask
+    if (maskloc.empty()) maskloc = FitPar::Config().GetParDIR(origname + ".mask");
+
+    // Check database
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + origname + ".mask";
+    }
+
+    // Setup Bin Mask
+    SetBinMask(maskloc);
+  }
+
+  /*
+  if (fScaleFactor < 0) {
+    ERR(FTL) << "I found a negative fScaleFactor in " << __FILE__ << ":" << __LINE__ << std::endl;
+    ERR(FTL) << "fScaleFactor = " << fScaleFactor << std::endl;
+    ERR(FTL) << "EXITING" << std::endl;
+    throw;
+  }
+  */
+
+  // Create and fill Weighted Histogram
+  if (!fMCWeighted) {
+
+    fMCWeighted = (TH1D*)fMCHist->Clone();
+    fMCWeighted->SetNameTitle((fName + "_MCWGHTS").c_str(),
+                              (fName + "_MCWGHTS" + fPlotTitles).c_str());
+    fMCWeighted->GetYaxis()->SetTitle("Weighted Events");
+
+  }
+
+
+}
+
+//********************************************************************
+void JointMeas1D::SetFitOptions(std::string opt) {
+//********************************************************************
+
+  // Do nothing if default given
+  if (opt == "DEFAULT") return;
+
+  // CHECK Conflicting Fit Options
+  std::vector<std::string> fit_option_allow =
+    GeneralUtils::ParseToStr(fAllowedTypes, "/");
+
+  for (UInt_t i = 0; i < fit_option_allow.size(); i++) {
+    std::vector<std::string> fit_option_section =
+      GeneralUtils::ParseToStr(fit_option_allow.at(i), ",");
+
+    bool found_option = false;
+
+    for (UInt_t j = 0; j < fit_option_section.size(); j++) {
+      std::string av_opt = fit_option_section.at(j);
+
+      if (!found_option and opt.find(av_opt) != std::string::npos) {
+        found_option = true;
+
+      } else if (found_option and opt.find(av_opt) != std::string::npos) {
+        ERR(FTL) << "ERROR: Conflicting fit options provided: "
+                 << opt << std::endl
+                 << "Conflicting group = " << fit_option_section.at(i) << std::endl
+                 << "You should only supply one of these options in card file." << std::endl;
+        throw;
+      }
+    }
+  }
+
+  // Check all options are allowed
+  std::vector<std::string> fit_options_input =
+    GeneralUtils::ParseToStr(opt, "/");
+  for (UInt_t i = 0; i < fit_options_input.size(); i++) {
+    if (fAllowedTypes.find(fit_options_input.at(i)) == std::string::npos) {
+      ERR(FTL) << "ERROR: Fit Option '" << fit_options_input.at(i)
+               << "' Provided is not allowed for this measurement."
+               << std::endl;
+      ERR(FTL) << "Fit Options should be provided as a '/' seperated list "
+               "(e.g. FREE/DIAG/NORM)"
+               << std::endl;
+      ERR(FTL) << "Available options for " << fName << " are '" << fAllowedTypes
+               << "'" << std::endl;
+
+      throw;
+    }
+  }
+
+  // Set TYPE
+  fFitType = opt;
+
+  // FIX,SHAPE,FREE
+  if (opt.find("FIX") != std::string::npos) {
+    fIsFree = fIsShape = false;
+    fIsFix = true;
+  } else if (opt.find("SHAPE") != std::string::npos) {
+    fIsFree = fIsFix = false;
+    fIsShape = true;
+  } else if (opt.find("FREE") != std::string::npos) {
+    fIsFix = fIsShape = false;
+    fIsFree = true;
+  }
+
+  // DIAG,FULL (or default to full)
+  if (opt.find("DIAG") != std::string::npos) {
+    fIsDiag = true;
+    fIsFull = false;
+  } else if (opt.find("FULL") != std::string::npos) {
+    fIsDiag = false;
+    fIsFull = true;
+  }
+
+  // CHI2/LL (OTHERS?)
+  if (opt.find("LOG") != std::string::npos) {
+    fIsChi2 = false;
+
+    ERR(FTL) << "No other LIKELIHOODS properly supported!" << std::endl;
+    ERR(FTL) << "Try to use a chi2!" << std::endl;
+    throw;
+
+  } else {
+    fIsChi2 = true;
+  }
+
+  // EXTRAS
+  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
+  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
+  if (opt.find("ENU1D") != std::string::npos) fIsEnu1D = true;
+  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
+  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+
+  return;
+};
+
+
+//********************************************************************
+void JointMeas1D::SetSmearingMatrix(std::string smearfile, int truedim,
+                                      int recodim) {
+  //********************************************************************
+
+  // The smearing matrix describes the migration from true bins (rows) to reco
+  // bins (columns)
+  // Counter over the true bins!
+  int row = 0;
+
+  std::string line;
+  std::ifstream smear(smearfile.c_str(), ifstream::in);
+
+  // Note that the smearing matrix may be rectangular.
+  fSmearMatrix = new TMatrixD(truedim, recodim);
+
+  if (smear.is_open())
+    LOG(SAM) << "Reading smearing matrix from file: " << smearfile << std::endl;
+  else
+    ERR(FTL) << "Smearing matrix provided is incorrect: " << smearfile
+             << std::endl;
+
+  while (std::getline(smear >> std::ws, line, '\n')) {
+    int column = 0;
+
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      (*fSmearMatrix)(row, column) =
+        (*iter) / 100.;  // Convert to fraction from
+      // percentage (this may not be
+      // general enough)
+      column++;
+    }
+    row++;
+  }
+  return;
+}
+
+//********************************************************************
+void JointMeas1D::ApplySmearingMatrix() {
+//********************************************************************
+
+  if (!fSmearMatrix) {
+    ERR(WRN) << fName
+             << ": attempted to apply smearing matrix, but none was set"
+             << std::endl;
+    return;
+  }
+
+  TH1D* unsmeared = (TH1D*)fMCHist->Clone();
+  TH1D* smeared = (TH1D*)fMCHist->Clone();
+  smeared->Reset();
+
+  // Loop over reconstructed bins
+  // true = row; reco = column
+  for (int rbin = 0; rbin < fSmearMatrix->GetNcols(); ++rbin) {
+    // Sum up the constributions from all true bins
+    double rBinVal = 0;
+
+    // Loop over true bins
+    for (int tbin = 0; tbin < fSmearMatrix->GetNrows(); ++tbin) {
+      rBinVal +=
+        (*fSmearMatrix)(tbin, rbin) * unsmeared->GetBinContent(tbin + 1);
+    }
+    smeared->SetBinContent(rbin + 1, rBinVal);
+  }
+  fMCHist = (TH1D*)smeared->Clone();
+
+  return;
+}
+
+/*
+   Reconfigure LOOP
+*/
+//********************************************************************
+void JointMeas1D::ResetAll() {
+//********************************************************************
+
+  fMCHist->Reset();
+  fMCFine->Reset();
+  fMCStat->Reset();
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::FillHistograms() {
+  //********************************************************************
+
+  if (Signal) {
+    fMCHist->Fill(fXVar, Weight);
+    fMCFine->Fill(fXVar, Weight);
+    fMCStat->Fill(fXVar, 1.0);
+
+    if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, fXVar, Weight);
+  }
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::ScaleEvents() {
+//********************************************************************
+
+  LOG(FIT) << "Scaling JointMeas1D" << std::endl;
+
+  // Fill MCWeighted;
+  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+    fMCWeighted->SetBinContent(i + 1, fMCHist->GetBinContent(i + 1));
+    fMCWeighted->SetBinError(i + 1,   fMCHist->GetBinError(i + 1));
+  }
+
+
+  // Setup Stat ratios for MC and MC Fine
+  double* statratio     = new double[fMCHist->GetNbinsX()];
+  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+    if (fMCHist->GetBinContent(i + 1) != 0) {
+      statratio[i] = fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1);
+    } else {
+      statratio[i] = 0.0;
+    }
+  }
+
+  double* statratiofine = new double[fMCFine->GetNbinsX()];
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    if (fMCFine->GetBinContent(i + 1) != 0) {
+      statratiofine[i] = fMCFine->GetBinError(i + 1) / fMCFine->GetBinContent(i + 1);
+    } else {
+      statratiofine[i] = 0.0;
+    }
+  }
+
+
+  // Scaling for raw event rates
+  if (fIsRawEvents) {
+    double datamcratio = fDataHist->Integral() / fMCHist->Integral();
+
+    fMCHist->Scale(datamcratio);
+    fMCFine->Scale(datamcratio);
+
+    if (fMCHist_Modes) fMCHist_Modes->Scale(datamcratio);
+
+    // Scaling for XSec as function of Enu
+  } else if (fIsEnu1D) {
+
+    PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram(),
+                                   GetEventHistogram(), fScaleFactor,
+                                   fNEvents);
+    PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram(),
+                                   GetEventHistogram(), fScaleFactor,
+                                   fNEvents);
+
+
+    // if (fMCHist_Modes) {
+    // PlotUtils::FluxUnfoldedScaling(fMCHist_Modes, GetFluxHistogram(),
+    // GetEventHistogram(), fScaleFactor,
+    // fNEvents);
+    // }
+
+    // Any other differential scaling
+  } else {
+    fMCHist->Scale(fScaleFactor, "width");
+    fMCFine->Scale(fScaleFactor, "width");
+
+    if (fMCHist_Modes) fMCHist_Modes->Scale(fScaleFactor, "width");
+  }
+
+
+  // Proper error scaling - ROOT Freaks out with xsec weights sometimes
+  for (int i = 0; i < fMCStat->GetNbinsX(); i++) {
+    fMCHist->SetBinError(i + 1, fMCHist->GetBinContent(i + 1) * statratio[i]);
+  }
+
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    fMCFine->SetBinError(i + 1, fMCFine->GetBinContent(i + 1) * statratiofine[i]);
+  }
+
+
+  // Clean up
+  delete statratio;
+  delete statratiofine;
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::ApplyNormScale(double norm) {
+//********************************************************************
+
+  fCurrentNorm = norm;
+
+  fMCHist->Scale(1.0 / norm);
+  fMCFine->Scale(1.0 / norm);
+
+  return;
+};
+
+
+
+/*
+   Statistic Functions - Outsources to StatUtils
+*/
+
+//********************************************************************
+int JointMeas1D::GetNDOF() {
+  //********************************************************************
+  return fDataHist->GetNbinsX() - fMaskHist->Integral();
+}
+
+//********************************************************************
+double JointMeas1D::GetLikelihood() {
+//********************************************************************
+
+  // If this is for a ratio, there is no data histogram to compare to!
+  if (fNoData || !fDataHist) return 0.;
+
+  // Apply Masking to MC if Required.
+  if (fIsMask and fMaskHist) {
+    PlotUtils::MaskBins(fMCHist, fMaskHist);
+  }
+
+
+  // Sort Shape Scaling
+  double scaleF = 0.0;
+  if (fIsShape) {
+    if (fMCHist->Integral(1, fMCHist->GetNbinsX(), "width")) {
+      scaleF = fDataHist->Integral(1, fDataHist->GetNbinsX(), "width") /
+               fMCHist->Integral(1, fMCHist->GetNbinsX(), "width");
+      fMCHist->Scale(scaleF);
+      fMCFine->Scale(scaleF);
+    }
+  }
+
+
+  // Likelihood Calculation
+  double stat = 0.;
+  if (fIsChi2) {
+
+    if (fIsRawEvents) {
+      stat = StatUtils::GetChi2FromEventRate(fDataHist, fMCHist, fMaskHist);
+    } else if (fIsDiag) {
+      stat = StatUtils::GetChi2FromDiag(fDataHist, fMCHist, fMaskHist);
+    } else if (!fIsDiag and !fIsRawEvents) {
+      stat = StatUtils::GetChi2FromCov(fDataHist, fMCHist, covar, fMaskHist);
+    }
+
+  }
+
+  // Sort Penalty Terms
+  if (fAddNormPen) {
+    double penalty =
+      (1. - fCurrentNorm) * (1. - fCurrentNorm) / (fNormError * fNormError);
+
+    stat += penalty;
+  }
+
+  // Return to normal scaling
+  if (fIsShape and !FitPar::Config().GetParB("saveshapescaling")) {
+    fMCHist->Scale(1. / scaleF);
+    fMCFine->Scale(1. / scaleF);
+  }
+
+  return stat;
+}
+
+
+/*
+  Fake Data Functions
+*/
+//********************************************************************
+void JointMeas1D::SetFakeDataValues(std::string fakeOption) {
+//********************************************************************
+
+  // Setup original/datatrue
+  TH1D* tempdata = (TH1D*) fDataHist->Clone();
+
+  if (!fIsFakeData) {
+    fIsFakeData = true;
+
+    // Make a copy of the original data histogram.
+    if (!fDataOrig) fDataOrig = (TH1D*)fDataHist->Clone((fName + "_data_original").c_str());
+
+  } else {
+    ResetFakeData();
+
+  }
+
+  // Setup Inputs
+  fFakeDataInput = fakeOption;
+  LOG(SAM) << "Setting fake data from : " << fFakeDataInput << std::endl;
+
+  // From MC
+  if (fFakeDataInput.compare("MC") == 0) {
+    fDataHist = (TH1D*)fMCHist->Clone((fName + "_MC").c_str());
+
+    // Fake File
+  } else {
+    if (!fFakeDataFile) fFakeDataFile = new TFile(fFakeDataInput.c_str(), "READ");
+    fDataHist = (TH1D*)fFakeDataFile->Get((fName + "_MC").c_str());
+
+  }
+
+  // Setup Data Hist
+  fDataHist->SetNameTitle((fName + "_FAKE").c_str(),
+                          (fName + fPlotTitles).c_str());
+
+  // Replace Data True
+  if (fDataTrue) delete fDataTrue;
+  fDataTrue = (TH1D*)fDataHist->Clone();
+  fDataTrue->SetNameTitle((fName + "_FAKE_TRUE").c_str(),
+                          (fName + fPlotTitles).c_str());
+
+
+  // Make a new covariance for fake data hist.
+  int nbins = fDataHist->GetNbinsX();
+  double alpha_i = 0.0;
+  double alpha_j = 0.0;
+
+  for (int i = 0; i < nbins; i++) {
+    for (int j = 0; j < nbins; j++) {
+      alpha_i = fDataHist->GetBinContent(i + 1) / tempdata->GetBinContent(i + 1);
+      alpha_j = fDataHist->GetBinContent(j + 1) / tempdata->GetBinContent(j + 1);
+
+      (*fFullCovar)(i, j) = alpha_i * alpha_j * (*fFullCovar)(i, j);
+    }
+  }
+
+  // Setup Covariances
+  if (covar) delete covar;
+  covar   = StatUtils::GetInvert(fFullCovar);
+
+  if (fDecomp) delete fDecomp;
+  fDecomp = StatUtils::GetInvert(fFullCovar);
+
+  delete tempdata;
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::ResetFakeData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH1D*)fDataTrue->Clone((fSettings.GetName() + "_FKDAT").c_str());
+  }
+
+}
+
+//********************************************************************
+void JointMeas1D::ResetData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH1D*)fDataOrig->Clone((fSettings.GetName() + "_data").c_str());
+  }
+
+  fIsFakeData = false;
+}
+
+//********************************************************************
+void JointMeas1D::ThrowCovariance() {
+//********************************************************************
+
+  // Take a fDecomposition and use it to throw the current dataset.
+  // Requires fDataTrue also be set incase used repeatedly.
+
+  if (fDataHist) delete fDataHist;
+  fDataHist = StatUtils::ThrowHistogram(fDataTrue, fFullCovar);
+
+  return;
+};
+
+/*
+   Access Functions
+*/
+
+//********************************************************************
+TH1D* JointMeas1D::GetMCHistogram() {
+//********************************************************************
+
+  if (!fMCHist) return fMCHist;
+
+  std::ostringstream chi2;
+  chi2 << std::setprecision(5) << this->GetLikelihood();
+
+  int linecolor = kRed;
+  int linestyle = 1;
+  int linewidth = 1;
+
+  int fillcolor = 0;
+  int fillstyle = 1001;
+
+  if (fSettings.Has("linecolor")) linecolor = fSettings.GetI("linecolor");
+  if (fSettings.Has("linestyle")) linestyle = fSettings.GetI("linestyle");
+  if (fSettings.Has("linewidth")) linewidth = fSettings.GetI("linewidth");
+
+  if (fSettings.Has("fillcolor")) fillcolor = fSettings.GetI("fillcolor");
+  if (fSettings.Has("fillstyle")) fillstyle = fSettings.GetI("fillstyle");
+
+  fMCHist->SetTitle(chi2.str().c_str());
+
+  fMCHist->SetLineColor(linecolor);
+  fMCHist->SetLineStyle(linestyle);
+  fMCHist->SetLineWidth(linewidth);
+
+  fMCHist->SetFillColor(fillcolor);
+  fMCHist->SetFillStyle(fillstyle);
+
+  return fMCHist;
+};
+
+//********************************************************************
+TH1D* JointMeas1D::GetDataHistogram() {
+//********************************************************************
+
+  if (!fDataHist) return fDataHist;
+
+  int datacolor = kBlack;
+  int datastyle = 1;
+  int datawidth = 1;
+
+  if (fSettings.Has("datacolor")) datacolor = fSettings.GetI("datacolor");
+  if (fSettings.Has("datastyle")) datastyle = fSettings.GetI("datastyle");
+  if (fSettings.Has("datawidth")) datawidth = fSettings.GetI("datawidth");
+
+  fDataHist->SetLineColor(datacolor);
+  fDataHist->SetLineWidth(datawidth);
+  fDataHist->SetMarkerStyle(datastyle);
+
+  return fDataHist;
+};
+
+
+/*
+   Write Functions
+*/
+
+// Save all the histograms at once
+//********************************************************************
+void JointMeas1D::Write(std::string drawOpt) {
+//********************************************************************
+
+  // Get Draw Options
+  drawOpt = FitPar::Config().GetParS("drawopts");
+
+  // Write Data/MC
+  GetDataList().at(0)->Write();
+  GetMCList().at(0)->Write();
+
+  // Write Fine Histogram
+  if (drawOpt.find("FINE") != std::string::npos)
+    GetFineList().at(0)->Write();
+
+  // Write Weighted Histogram
+  if (drawOpt.find("WEIGHTS") != std::string::npos && fMCWeighted)
+    fMCWeighted->Write();
+
+
+  // Save Flux/Evt if no event manager
+  if (!FitPar::Config().GetParB("EventManager")) {
+
+    if (drawOpt.find("FLUX") != std::string::npos && GetFluxHistogram())
+      GetFluxHistogram()->Write();
+
+    if (drawOpt.find("EVT") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
+
+    if (drawOpt.find("XSEC") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
+
+  }
+
+  // Write Mask
+  if (fIsMask && (drawOpt.find("MASK") != std::string::npos)) {
+    fMaskHist->Write();
+  }
+
+
+  // Write Covariances
+  if (drawOpt.find("COV") != std::string::npos && fFullCovar) {
+    PlotUtils::GetFullCovarPlot(fFullCovar, fSettings.GetName());
+  }
+
+  if (drawOpt.find("INVCOV") != std::string::npos && covar) {
+    PlotUtils::GetInvCovarPlot(covar, fSettings.GetName());
+  }
+
+  if (drawOpt.find("DECOMP") != std::string::npos && fDecomp) {
+    PlotUtils::GetDecompCovarPlot(fDecomp, fSettings.GetName());
+  }
+
+  // // Likelihood residual plots
+  // if (drawOpt.find("RESIDUAL") != std::string::npos) {
+  //   WriteResidualPlots();
+  // }
+
+  // Ratio and Shape Plots
+  if (drawOpt.find("RATIO") != std::string::npos) {
+    WriteRatioPlot();
+  }
+
+  if (drawOpt.find("SHAPE") != std::string::npos) {
+    WriteShapePlot();
+    if (drawOpt.find("RATIO") != std::string::npos)
+      WriteShapeRatioPlot();
+  }
+
+  // // RATIO
+  // if (drawOpt.find("CANVMC") != std::string::npos) {
+  //   TCanvas* c1 = WriteMCCanvas(fDataHist, fMCHist);
+  //   c1->Write();
+  //   delete c1;
+  // }
+
+  // // PDG
+  // if (drawOpt.find("CANVPDG") != std::string::npos && fMCHist_Modes) {
+  //   TCanvas* c2 = WritePDGCanvas(fDataHist, fMCHist, fMCHist_Modes);
+  //   c2->Write();
+  //   delete c2;
+  // }
+
+  // Write Extra Histograms
+  AutoWriteExtraTH1();
+  WriteExtraHistograms();
+
+  if (fSaveSubMeas) {
+    for (std::vector<MeasurementBase*>::const_iterator expIter =
+           fSubChain.begin();
+         expIter != fSubChain.end(); expIter++) {
+      MeasurementBase* exp = *expIter;
+      exp->Write(drawOpt);
+    }
+  }
+
+  // Returning
+  LOG(SAM) << "Written Histograms: " << fName << std::endl;
+  return;
+}
+
+
+//********************************************************************
+void JointMeas1D::WriteRatioPlot() {
+//********************************************************************
+
+  // Setup mc data ratios
+  TH1D* dataRatio = (TH1D*)fDataHist->Clone((fName + "_data_RATIO").c_str());
+  TH1D* mcRatio   = (TH1D*)fMCHist->Clone((fName + "_MC_RATIO").c_str());
+
+  // Extra MC Data Ratios
+  for (int i = 0; i < mcRatio->GetNbinsX(); i++) {
+
+    dataRatio->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) / fMCHist->GetBinContent(i + 1));
+    dataRatio->SetBinError(i + 1,   fDataHist->GetBinError(i + 1)   / fMCHist->GetBinContent(i + 1));
+
+    mcRatio->SetBinContent(i + 1, fMCHist->GetBinContent(i + 1) / fMCHist->GetBinContent(i + 1));
+    mcRatio->SetBinError(i + 1,   fMCHist->GetBinError(i + 1)   / fMCHist->GetBinContent(i + 1));
+
+  }
+
+  // Write ratios
+  mcRatio->Write();
+  dataRatio->Write();
+
+  delete mcRatio;
+  delete dataRatio;
+}
+
+
+//********************************************************************
+void JointMeas1D::WriteShapePlot() {
+//********************************************************************
+
+  TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
+
+  double shapeScale = 1.0;
+  if (fIsRawEvents) {
+    shapeScale = fDataHist->Integral() / fMCHist->Integral();
+  } else {
+    shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
+  }
+
+  mcShape->Scale(shapeScale);
+
+  std::stringstream ss;
+  ss << shapeScale;
+  mcShape->SetTitle(ss.str().c_str());
+
+  mcShape->SetLineWidth(3);
+  mcShape->SetLineStyle(7);
+
+  mcShape->Write();
+
+  delete mcShape;
+
+}
+
+//********************************************************************
+void JointMeas1D::WriteShapeRatioPlot() {
+//********************************************************************
+
+  // Get a mcshape histogram
+  TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
+
+  double shapeScale = 1.0;
+  if (fIsRawEvents) {
+    shapeScale = fDataHist->Integral() / fMCHist->Integral();
+  } else {
+    shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
+  }
+
+  mcShape->Scale(shapeScale);
+
+  // Create shape ratio histograms
+  TH1D* mcShapeRatio   = (TH1D*)mcShape->Clone((fName + "_MC_SHAPE_RATIO").c_str());
+  TH1D* dataShapeRatio = (TH1D*)fDataHist->Clone((fName + "_data_SHAPE_RATIO").c_str());
+
+  // Divide the histograms
+  mcShapeRatio->Divide(mcShape);
+  dataShapeRatio->Divide(mcShape);
+
+  // Colour the shape ratio plots
+  mcShapeRatio->SetLineWidth(3);
+  mcShapeRatio->SetLineStyle(7);
+
+  mcShapeRatio->Write();
+  dataShapeRatio->Write();
+
+  delete mcShapeRatio;
+  delete dataShapeRatio;
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "JointMeas1D.h"
 
 /*
   Constructor/Deconstuctor
 */
 
-//********************************************************************
-JointMeas1D::JointMeas1D() {
-  //********************************************************************
-
-  // Reset list
-  for (std::vector<MeasurementBase*>::const_iterator iter = fSubChain.begin();
-       iter != fSubChain.end(); iter++) {
-    MeasurementBase* exp = *iter;
-    if (exp) delete exp;
-  }
-
-  // Reset Variables
-  this->Init();
-}
-
-//********************************************************************
-JointMeas1D::~JointMeas1D() {
-  //********************************************************************
-
-  // Delete sub experiments
-  for (std::vector<MeasurementBase*>::const_iterator iter = fSubChain.begin();
-       iter != fSubChain.end(); iter++) {
-    MeasurementBase* exp = *iter;
-    if (exp) delete exp;
-  }
-}
-
-//********************************************************************
-void JointMeas1D::Init() {
-  //********************************************************************
-
-  // Flags for Joint Measurements
-  fIsRatio = false;
-  fIsSummed = false;
-  fSaveSubMeas = false;
-
-  // Clear Input Files
-  fSubInFiles.clear();
-
-  return;
-}
 
 /*
   Setup Functions
 */
 //********************************************************************
 void JointMeas1D::SetupMeasurement(std::string input, std::string type,
                                    FitWeight* rw, std::string fkdt) {
   //********************************************************************
 
   // For joint samples, input files are given as a semi-colon seperated list.
   // Parse this list and save it for later, and set up the types etc.
 
-  if (FitPar::Config().GetParB("EventManager")){
+  if (FitPar::Config().GetParB("EventManager")) {
     ERR(FTL) << "Event Manager does not yet work with JointMeas1D Samples" << std::endl;
     ERR(FTL) << "If you want good predictions for " << fName << " then run with it turned off! (-q EventManager=0)" << std::endl;
-    sleep(2);
   }
 
   fSubInFiles.clear();
 
   std::vector<std::string> entries = GeneralUtils::ParseToStr(input, ";");
 
   if (entries.size() < 2) {
     ERR(FTL) << "Joint measurement expected to recieve at least two semi-colon "
-                "separated input files, but recieved: \""
+             "separated input files, but recieved: \""
              << input << "\"" << std::endl;
     throw;
   }
 
   std::vector<std::string> first_file_descriptor =
-      GeneralUtils::ParseToStr(entries.front(), ":");
+    GeneralUtils::ParseToStr(entries.front(), ":");
 
   if (first_file_descriptor.size() != 2) {
     ERR(FTL) << "Found Joint measurement where the input file had no type: \""
              << input << "\", expected \"INPUTTYPE:File.root;File2.root\"."
              << std::endl;
     throw;
   }
   std::string inpType = first_file_descriptor[0];
 
 
   for (std::vector<string>::iterator iter = entries.begin();
        iter != entries.end(); iter++) {
     if (GeneralUtils::ParseToStr(*iter, ":").size() != 2) {
       std::stringstream ss("");
       ss << inpType << ":" << (*iter);
       fSubInFiles.push_back(ss.str());
     } else {
       fSubInFiles.push_back(*iter);
     }
   }
 
   // Set Engine and Fake Data
   fRW = rw;
-  fakeDataFile = fkdt;
+  fFakeDataInput = fkdt;
 
   // Set Fit Options
   SetFitOptions(type);
 
   return;
 }
 
 /*
   XSec Functions
 */
-
 //********************************************************************
 double JointMeas1D::TotalIntegratedFlux(std::string intOpt, double low,
                                         double high) {
-  //********************************************************************
+//********************************************************************
 
   double totalflux = 0.0;
 
   // Destroy the job for sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
     double expflux = exp->TotalIntegratedFlux(intOpt, low, high);
 
     // Fill flux options
     if (fIsRatio) {
       totalflux = expflux;
       break;
     }
     if (fIsSummed) {
       totalflux += expflux;
     }
   }
 
   return totalflux;
 }
 
 /*
   Reconfigure Functions
 */
 
 //********************************************************************
 void JointMeas1D::Reconfigure() {
-  //********************************************************************
+//********************************************************************
 
-  // This will just call reconfigure explicitly and apply all the standard
-  // scalings too each sub sample.
-  // If you just want to fill event rates into plots make a Reconfigure in the
-  // top level sample, you will
-  // need to loop over each sample explicitly and cast it to an InputHandler
-  // before calling ReconfigureAllEvents.
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
     exp->Reconfigure();
   }
 
-  // Joint function called by top level class
-  MakePlots();
-
-  // Do Final Normalisation
-  ApplyNormScale(fRW->GetSampleNorm(this->fName));
-
+  ConvertEventRates();
   return;
 }
 
 //********************************************************************
-void JointMeas1D::ReconfigureFast() {
-  //********************************************************************
-  // This will just call reconfigure explicitly and apply all the standard
-  // scalings too each sub sample.
-  // If you just want to fill event rates into plots make a Reconfigure in the
-  // top level sample, you will
-  // need to loop over each sample explicitly and cast it to an InputHandler
-  // before calling ReconfigureAllEvents.
+void JointMeas1D::ConvertEventRates() {
+//********************************************************************
+
+  // Apply Event Scaling                                                                                                                                                                                                                   
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
-    MeasurementBase* exp = *expIter;
-    exp->ReconfigureFast();
+    MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
+    exp->ScaleEvents();
   }
 
+
   // Joint function called by top level class
   MakePlots();
 
   // Do Final Normalisation
   ApplyNormScale(fRW->GetSampleNorm(this->fName));
 
-  return;
 }
 
 //********************************************************************
 void JointMeas1D::MakePlots() {
-  //********************************************************************
+//********************************************************************
 
   // Reset the 1D histograms but not the subClasses
-  Measurement1D::ResetAll();
+  ResetAll();
 
   // If Summed
   if (fIsSummed) {
     for (std::vector<MeasurementBase*>::const_iterator expIter =
-             fSubChain.begin();
+           fSubChain.begin();
          expIter != fSubChain.end(); expIter++) {
       MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
 
       this->fMCHist->Add(exp->GetMCList().at(0));
       this->fMCFine->Add(exp->GetFineList().at(0));
     }
 
     return;
   }
 
   // If Ratio
   if (fIsRatio) {
     int sample = 0;
     for (std::vector<MeasurementBase*>::const_iterator expIter =
-             fSubChain.begin();
+           fSubChain.begin();
          expIter != fSubChain.end(); expIter++) {
       MeasurementBase* exp = *expIter;
 
       if (sample == 0) {
         this->fMCHist->Add(exp->GetMCList().at(0));
         this->fMCFine->Add(exp->GetFineList().at(0));
 
       } else if (sample == 1) {
         this->fMCHist->Divide(exp->GetMCList().at(0));
         this->fMCFine->Divide(exp->GetFineList().at(0));
 
-      } else
+      } else {
         break;
+      }
 
       sample++;
     }
     return;
   }
 
   return;
 }
 
 /*
   Access Functions
 */
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetMCList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(this->fMCHist);
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetMCList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetDataList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(this->fDataHist);
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetDataList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetFineList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(this->fMCFine);
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetFineList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetMaskList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(this->fMaskHist);
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetMaskList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetFluxList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(MeasurementBase::GetFluxHistogram());
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetFluxList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetEventRateList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(MeasurementBase::GetEventHistogram());
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetEventRateList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 std::vector<TH1*> JointMeas1D::GetXSecList() {
   //********************************************************************
 
   // Make Default Vector
   std::vector<TH1*> tempVect;
   tempVect.push_back(MeasurementBase::GetXSecHistogram());
 
   // Return vector from all sub samples
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     std::vector<TH1*> subTempVect = exp->GetXSecList();
 
     for (UInt_t i = 0; i < subTempVect.size(); i++) {
       tempVect.push_back(subTempVect.at(i));
     }
   }
 
   return tempVect;
 }
 
 //********************************************************************
 TH1D* JointMeas1D::GetCombinedFlux() {
   //********************************************************************
 
-  TH1D* newflux;
+  TH1D* newflux = NULL;
   int sample = 0;
 
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     // Get flux from experiment
     std::vector<TH1*> fluxVect = exp->GetFluxList();
 
     // Setup newflux
     if (sample == 0) {
       newflux = (TH1D*)fluxVect.at(0);
       newflux->Reset();
     }
 
     // Add all fluxes
     for (UInt_t i = 0; i < fluxVect.size(); i++) {
       newflux->Add((TH1D*)fluxVect.at(i));
       sample++;
     }
   }
 
+  if (!newflux){
+    ERR(FTL) << "No combined flux setup in JointMeas1D" << std::endl;
+  }
+
   return newflux;
 }
 
 //********************************************************************
 TH1D* JointMeas1D::GetCombinedEventRate() {
   //********************************************************************
 
   TH1D* newflux;
   int sample = 0;
 
   for (std::vector<MeasurementBase*>::const_iterator expIter =
-           fSubChain.begin();
+         fSubChain.begin();
        expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = *expIter;
 
     // Get flux from experiment
     std::vector<TH1*> fluxVect = exp->GetFluxList();
 
     // Setup newflux
     if (sample == 0) {
       newflux = (TH1D*)fluxVect.at(0);
       newflux->Reset();
     }
 
     // Add all fluxes
     for (UInt_t i = 0; i < fluxVect.size(); i++) {
       newflux->Add(fluxVect.at(i));
       sample++;
     }
   }
 
+  if (!newflux){
+    ERR(FTL) << "No combined event rate setup in JointMeas1D" << std::endl;
+  }
+
   return newflux;
 }
 
-/*
-  Write Functions
-*/
+//********************************************************************
+std::vector<MeasurementBase*> JointMeas1D::GetSubSamples() {
+//********************************************************************
+
+  std::vector<MeasurementBase*> exps;
+  for (std::vector<MeasurementBase*>::const_iterator expIter =
+         fSubChain.begin();
+       expIter != fSubChain.end(); expIter++) {
+    exps.push_back(*expIter);
+  }
+
+  return exps;
+}
+
+
+
+
+
+
+
+//// CRAP TO BE REMOVED
+
+
 
 //********************************************************************
-void JointMeas1D::Write(std::string drawOpt) {
+void JointMeas1D::SetDataValues(std::string dataFile) {
   //********************************************************************
 
-  // Write the top level class
-  Measurement1D::Write(drawOpt);
+  // Override this function if the input file isn't in a suitable format
+  LOG(SAM) << "Reading data from: " << dataFile.c_str() << std::endl;
+  fDataHist =
+    PlotUtils::GetTH1DFromFile(dataFile, (fName + "_data"), fPlotTitles);
+  fDataTrue = (TH1D*)fDataHist->Clone();
 
-  if (fSaveSubMeas) {
-    for (std::vector<MeasurementBase*>::const_iterator expIter =
-             fSubChain.begin();
-         expIter != fSubChain.end(); expIter++) {
-      MeasurementBase* exp = *expIter;
-      exp->Write(drawOpt);
+  // Number of data points is number of bins
+  fNDataPointsX = fDataHist->GetXaxis()->GetNbins();
+
+  return;
+};
+
+
+
+
+
+//********************************************************************
+void JointMeas1D::SetDataFromDatabase(std::string inhistfile,
+                                        std::string histname) {
+  //********************************************************************
+
+  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
+           << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile(
+                (GeneralUtils::GetTopLevelDir() + "/data/" + inhistfile), histname);
+  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::SetDataFromFile(std::string inhistfile,
+                                    std::string histname) {
+  //********************************************************************
+
+  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
+           << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile((inhistfile), histname);
+  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::SetCovarMatrix(std::string covarFile) {
+  //********************************************************************
+
+  // Covariance function, only really used when reading in the MB Covariances.
+
+  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
+
+  TH2D* covarPlot = new TH2D();
+  //  TH2D* decmpPlot = new TH2D();
+  TH2D* covarInvPlot = new TH2D();
+  TH2D* fFullCovarPlot = new TH2D();
+  std::string covName = "";
+  std::string covOption = FitPar::Config().GetParS("thrown_covariance");
+
+  if (fIsShape || fIsFree) covName = "shp_";
+  if (fIsDiag)
+    covName += "diag";
+  else
+    covName += "full";
+
+  covarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  covarInvPlot = (TH2D*)tempFile->Get((covName + "covinv").c_str());
+
+  if (!covOption.compare("SUB"))
+    fFullCovarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  else if (!covOption.compare("FULL"))
+    fFullCovarPlot = (TH2D*)tempFile->Get("fullcov");
+  else
+    ERR(WRN) << "Incorrect thrown_covariance option in parameters."
+             << std::endl;
+
+  int dim = int(fDataHist->GetNbinsX());  //-this->masked->Integral());
+  int covdim = int(fDataHist->GetNbinsX());
+
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  fDecomp = new TMatrixDSym(dim);
+
+  int row, column = 0;
+  row = 0;
+  column = 0;
+  for (Int_t i = 0; i < covdim; i++) {
+    // if (this->masked->GetBinContent(i+1) > 0) continue;
+
+    for (Int_t j = 0; j < covdim; j++) {
+      //   if (this->masked->GetBinContent(j+1) > 0) continue;
+
+      (*this->covar)(row, column) = covarPlot->GetBinContent(i + 1, j + 1);
+      (*fFullCovar)(row, column) = fFullCovarPlot->GetBinContent(i + 1, j + 1);
+
+      column++;
+    }
+    column = 0;
+    row++;
+  }
+
+  // Set bin errors on data
+  if (!fIsDiag) {
+    StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar);
+  }
+
+  // Get Deteriminant and inverse matrix
+  // fCovDet = this->covar->Determinant();
+
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  return;
+};
+
+//********************************************************************
+// Sets the covariance matrix from a provided file in a text format
+// scale is a multiplicative pre-factor to apply in the case where the
+// covariance is given in some unit (e.g. 1E-38)
+void JointMeas1D::SetCovarMatrixFromText(std::string covarFile, int dim,
+    double scale) {
+  //********************************************************************
+
+  // Make a counter to track the line number
+  int row = 0;
+
+  std::string line;
+  std::ifstream covarread(covarFile.c_str(), ifstream::in);
+
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  if (covarread.is_open())
+    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
+             << std::endl;
+  else
+    ERR(FTL) << "Covariance matrix provided is incorrect: " << covarFile
+             << std::endl;
+
+  // Loop over the lines in the file
+  while (std::getline(covarread >> std::ws, line, '\n')) {
+    int column = 0;
+
+    // Loop over entries and insert them into matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+
+    if (entries.size() <= 1) {
+      ERR(WRN) << "SetCovarMatrixFromText -> Covariance matrix only has <= 1 "
+               "entries on this line: "
+               << row << std::endl;
+    }
+
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      (*covar)(row, column) = *iter;
+      (*fFullCovar)(row, column) = *iter;
+
+      column++;
+    }
+
+    row++;
+  }
+  covarread.close();
+
+  // Scale the actualy covariance matrix by some multiplicative factor
+  (*fFullCovar) *= scale;
+
+  // Robust matrix inversion method
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  // THIS IS ACTUALLY THE INVERSE COVARIANCE MATRIXA AAAAARGH
+  delete this->covar;
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  // Now need to multiply by the scaling factor
+  // If the covariance
+  (*this->covar) *= 1. / (scale);
+
+  return;
+};
+
+//********************************************************************
+void JointMeas1D::SetCovarMatrixFromCorrText(std::string corrFile, int dim) {
+  //********************************************************************
+
+  // Make a counter to track the line number
+  int row = 0;
+
+  std::string line;
+  std::ifstream corr(corrFile.c_str(), ifstream::in);
+
+  this->covar = new TMatrixDSym(dim);
+  this->fFullCovar = new TMatrixDSym(dim);
+  if (corr.is_open())
+    LOG(SAM) << "Reading and converting correlation matrix from file: "
+             << corrFile << std::endl;
+  else {
+    ERR(FTL) << "Correlation matrix provided is incorrect: " << corrFile
+             << std::endl;
+    exit(-1);
+  }
+
+  while (std::getline(corr >> std::ws, line, '\n')) {
+    int column = 0;
+
+    // Loop over entries and insert them into matrix
+    // Multiply by the errors to get the covariance, rather than the correlation
+    // matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      double val = (*iter) * this->fDataHist->GetBinError(row + 1) * 1E38 *
+                   this->fDataHist->GetBinError(column + 1) * 1E38;
+      if (val == 0) {
+        ERR(FTL) << "Found a zero value in the covariance matrix, assuming "
+                 "this is an error!"
+                 << std::endl;
+        exit(-1);
+      }
+
+      (*this->covar)(row, column) = val;
+      (*this->fFullCovar)(row, column) = val;
+
+      column++;
+    }
+
+    row++;
+  }
+
+  // Robust matrix inversion method
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  delete this->covar;
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  return;
+};
+
+
+
+
+
+
+//********************************************************************
+// FullUnits refers to if we have "real" unscaled units in the covariance matrix, e.g. 1E-76.
+// If this is the case we need to scale it so that the chi2 contribution is correct
+// NUISANCE internally assumes the covariance matrix has units of 1E76
+void JointMeas1D::SetCovarFromDataFile(std::string covarFile,
+    std::string covName, bool FullUnits) {
+  //********************************************************************
+
+  LOG(SAM) << "Getting covariance from " << covarFile << "->" << covName
+           << std::endl;
+
+  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
+  TH2D* covPlot = (TH2D*)tempFile->Get(covName.c_str());
+  covPlot->SetDirectory(0);
+  // Scale the covariance matrix if it comes in normal units
+  if (FullUnits) {
+    covPlot->Scale(1.E76);
+  }
+
+  int dim = covPlot->GetNbinsX();
+  fFullCovar = new TMatrixDSym(dim);
+
+  for (int i = 0; i < dim; i++) {
+    for (int j = 0; j < dim; j++) {
+      (*fFullCovar)(i, j) = covPlot->GetBinContent(i + 1, j + 1);
     }
   }
 
+  this->covar = (TMatrixDSym*)fFullCovar->Clone();
+  fDecomp = (TMatrixDSym*)fFullCovar->Clone();
+
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  TDecompChol LUChol = TDecompChol(*fDecomp);
+  LUChol.Decompose();
+  fDecomp = new TMatrixDSym(dim, LU.GetU().GetMatrixArray(), "");
+
   return;
 };
+
+
+// std::vector<TH1*> JointMeas1D::GetMCList(void){
+//   std::vector<TH1*> temp;
+//   return temp;
+// }
+
+
+// std::vector<TH1*> JointMeas1D::GetDataList(void){
+//  std::vector<TH1*> temp;
+//   return temp;
+// }
+
+
+
+// std::vector<TH1*> JointMeas1D::GetMaskList(void){
+//  std::vector<TH1*> temp;
+//   return temp;
+// }
+
+
+// std::vector<TH1*> JointMeas1D::GetFineList(void){
+//  std::vector<TH1*> temp;
+//   return temp;
+// }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/FitBase/JointMeas1D.h b/src/FitBase/JointMeas1D.h
index f6c2c35..fab8689 100644
--- a/src/FitBase/JointMeas1D.h
+++ b/src/FitBase/JointMeas1D.h
@@ -1,170 +1,664 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef JOINTMEASUREMENT_1D_H_SEEN
 #define JOINTMEASUREMENT_1D_H_SEEN
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
 #include <math.h>
 #include <stdlib.h>
 #include <deque>
 #include <iomanip>
 #include <iostream>
 #include <list>
 #include <numeric>
 #include <sstream>
 #include <string>
 
 // ROOT includes
 #include <TArrayF.h>
 #include <TCanvas.h>
 #include <TCut.h>
 #include <TDecompChol.h>
 #include <TDecompSVD.h>
 #include <TGraph.h>
 #include <TGraphErrors.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <TMatrixDSym.h>
 #include <TROOT.h>
 #include <TSystem.h>
 #include "Measurement1D.h"
 
 // External data fit includes
 #include "FitEvent.h"
 #include "FitParameters.h"
 #include "FitUtils.h"
 #include "MeasurementBase.h"
 #include "PlotUtils.h"
 #include "StatUtils.h"
 
-#include "InputHandler.h"
-
-/// Joint Measurement 1D Class
-///
-/// Base class used to setup measurements that require multiple distributions to
-/// then be merged.
-/// The "fSubChain" object is used to keep track of each of the individual
-/// experiments which are then
-/// automatically reconfigured, written, etc.
 
 //********************************************************************
-//! Base class to setup measurements that require several sub measurements
-class JointMeas1D : public Measurement1D {
-  //********************************************************************
+/// 1D Measurement base class. Histogram handling is done in this base layer.
+class JointMeas1D : public MeasurementBase {
+//********************************************************************
 
- public:
+public:
   /*
     Constructor/Deconstuctor
   */
+  JointMeas1D(void);
+  virtual ~JointMeas1D(void);
+
+  /*
+    Setup Functions
+  */
+
+
+  SampleSettings LoadSampleSettings(nuiskey samplekey);
+
+
+  /// \brief Setup all configs once initialised
+  ///
+  /// Should be called after all configs have been setup inside fSettings container.
+  /// Handles the processing of inputs and setting up of types.
+  /// Replaces the old 'SetupMeasurement' function.
+  void FinaliseSampleSettings();
+
+
+  /// \brief Read 1D data inputs from a text file.
+  ///
+  /// Inputfile should have the format: \n
+  /// low_binedge_1    bin_content_1  bin_error_1 \n
+  /// low_binedge_2    bin_content_2  bin_error_2 \n
+  /// ....             ....           ....        \n
+  /// high_bin_edge_N  0.0            0.0
+  virtual void SetDataFromTextFile(std::string datafile);
+
+  /// \brief Read 1D data inputs from a root file.
+  ///
+  /// inhistfile specifies the path to the root file
+  /// histname specifies the name of the histogram.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ';' so that: \n
+  /// 'myhistfile.root;myhistname' \n
+  /// will also work.
+  virtual void SetDataFromRootFile(std::string inhistfile, std::string histname = "");
+
+
+  /// \brief Set data bin errors to sqrt(entries)
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Sets the data errors as the sqrt of the bin contents
+  /// Should be use for counting experiments
+  virtual void SetPoissonErrors();
+
+  /// \brief Make diagonal covariance from data
+  ///
+  /// \warning If no histogram passed, data must be setup first!
+  /// Setup the covariance inputs by taking the data histogram
+  /// errors and setting up a diagonal covariance matrix.
+  ///
+  /// If no data is supplied, fDataHist is used if already set.
+  virtual void SetCovarFromDiagonal(TH1D* data = NULL);
+
+  /// \brief Read the data covariance from a text file.
+  ///
+  /// Inputfile should have the format: \n
+  /// covariance_11  covariance_12  covariance_13 ... \n
+  /// covariance_21  covariance_22  covariance_23 ... \n
+  /// ...            ...            ...           ... \n
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data covariance from a ROOT file.
+  ///
+  /// - covfile specifies the full path to the file
+  /// - histname specifies the name of the covariance object. Both TMatrixDSym and TH2D are supported.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarFromRootFile(std::string covfile, std::string histname);
+
+  /// \brief Read the inverted data covariance from a text file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarInvertFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the inverted data covariance from a ROOT file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarInvertFromRootFile(std::string covfile, std::string histname);
+
+  /// \brief Read the data correlations from a text file.
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCorrelationFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data correlations from a ROOT file.
+  ///
+  /// \warning REQUIRES DATA TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCorrelationFromRootFile(std::string covfile, std::string histname);
+
+
+  /// \brief Read the cholesky decomposed covariance from a text file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCholDecompFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the cholesky decomposed covariance from a ROOT file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCholDecompFromRootFile(std::string covfile, std::string histname);
+
+
+  /// \brief Scale the data by some scale factor
+  virtual void ScaleData(double scale);
+
+
+  /// \brief Scale the covariaince and its invert/decomp by some scale factor.
+  virtual void ScaleCovar(double scale);
+
+
+
+  /// \brief Setup a bin masking histogram and apply masking to data
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Reads in a list of bins in a text file to be masked. Format is: \n
+  /// bin_index_1  1 \n
+  /// bin_index_2  1 \n
+  /// bin_index_3  1 \n
+  ///
+  /// If 0 is given then a bin entry will NOT be masked. So for example: \n\n
+  /// 1  1 \n
+  /// 2  1 \n
+  /// 3  0 \n
+  /// 4  1 \n\n
+  /// Will mask only the 1st, 2nd, and 4th bins.
+  ///
+  /// Masking can be turned on by specifiying the MASK option when creating a sample.
+  /// When this is passed NUISANCE will look in the following locations for the mask file:
+  /// - FitPar::Config().GetParS(fName + ".mask")
+  /// - "data/masks/" + fName + ".mask";
+  virtual void SetBinMask(std::string maskfile);
 
-  //! Default Constructor
-  JointMeas1D();
 
-  //! Default Virtual Destructor
-  virtual ~JointMeas1D();
+  /// \brief Final constructor setup
+  /// \warning Should be called right at the end of the constructor.
+  ///
+  /// Contains a series of checks to ensure the data and inputs have been setup.
+  /// Also creates the MC histograms needed for fitting.
+  virtual void FinaliseMeasurement();
+
+
+
+  /// \brief Set the current fit options from a string.
+  ///
+  /// This is called twice for each sample, once to set the default
+  /// and once to set the current setting (if anything other than default given)
+  ///
+  /// For this to work properly it requires the default and allowed types to be
+  /// set correctly. These should be specified as a string listing options.
+  ///
+  /// To split up options so that NUISANCE can automatically detect ones that
+  /// are conflicting. Any options seperated with the '/' symbol are non conflicting
+  /// and can be given together, whereas any seperated with the ',' symbol cannot
+  /// be specified by the end user at the same time.
+  ///
+  /// Default Type Examples:
+  /// - DIAG/FIX = Default option will be a diagonal covariance, with FIXED norm.
+  /// - MASK/SHAPE = Default option will be a masked hist, with SHAPE always on.
+  ///
+  /// Allowed Type examples:
+  /// - 'FULL/DIAG/NORM/MASK' = Any of these options can be specified.
+  /// - 'FULL,FREE,SHAPE/MASK/NORM' = User can give either FULL, FREE, or SHAPE as on option.
+  /// MASK and NORM can also be included as options.
+  virtual void SetFitOptions(std::string opt);
 
-  //! Initialise the samples
-  void Init();
 
   /*
-    Worker Node Functions
-    - Input handler does the long reconfigures so gives option for cluster
-    submission
-    - on a sample by sample basis
+    Smearing
   */
+  /// \brief Read in smearing matrix from file
+  ///
+  /// Set the smearing matrix from a text file given the size of the matrix
+  virtual void SetSmearingMatrix(std::string smearfile, int truedim,
+                                 int recodim);
+
+  /// \brief Apply smearing to MC true to get MC reco
+  ///
+  /// Apply smearing matrix to fMCHist using fSmearingMatrix
+  virtual void ApplySmearingMatrix(void);
+
+
 
   /*
-    Setup Functions
+    Reconfigure Functions
   */
-  /// Setup the measurement and weight engines, parse the input files and setup
-  /// sub measurements.
-  virtual void SetupMeasurement(std::string input, std::string type,
-                                FitWeight* rw, std::string fkdt);
+
+  /// \brief Create a Measurement1D box
+  ///
+  /// Creates a new 1D variable box containing just fXVar.
+  ///
+  /// This box is the bare minimum required by the JointFCN when
+  /// running fast reconfigures during a routine.
+  /// If for some reason a sample needs extra variables to be saved then
+  /// it should override this function creating its own MeasurementVariableBox
+  /// that contains the extra variables.
+  virtual MeasurementVariableBox* CreateBox() {return new MeasurementVariableBox1D();};
+
+  /// \brief Reset all MC histograms
+  ///
+  /// Resets all standard histograms and those registered to auto
+  /// process to zero.
+  ///
+  /// If extra histograms are not included in auto processing, then they must be reset
+  /// by overriding this function and doing it manually if required.
+  virtual void ResetAll(void);
+
+  /// \brief Fill MC Histograms from XVar
+  ///
+  /// Fill standard histograms using fXVar, Weight read from the variable box.
+  ///
+  /// WARNING : Any extra MC histograms need to be filled by overriding this function,
+  /// even if they have been set to auto process.
+  virtual void FillHistograms(void);
+
+  // \brief Convert event rates to final histogram
+  ///
+  /// Apply standard scaling procedure to standard mc histograms to convert from
+  /// raw events to xsec prediction.
+  ///
+  /// If any distributions have been set to auto process
+  /// that is done during this function call, and a differential xsec is assumed.
+  /// If that is not the case this function must be overriden.
+  virtual void ScaleEvents(void);
+
+  /// \brief Scale MC by a factor=1/norm
+  ///
+  /// Apply a simple normalisation scaling if the option FREE or a norm_parameter
+  /// has been specified in the NUISANCE routine.
+  virtual void ApplyNormScale(double norm);
+
+
+  /*
+    Statistical Functions
+  */
+
+  /// \brief Get Number of degrees of freedom
+  ///
+  /// Returns the number bins inside the data histogram accounting for
+  /// any bin masking applied.
+  virtual int GetNDOF(void);
+
+  /// \brief Return Data/MC Likelihood at current state
+  ///
+  /// Returns the likelihood of the data given the current MC prediction.
+  /// Diferent likelihoods definitions are used depending on the FitOptions.
+  virtual double GetLikelihood(void);
+
+
+  /*
+    Fake Data
+  */
+
+  /// \brief Set the fake data values from either a file, or MC
+  ///
+  /// - Setting from a file "path": \n
+  /// When reading from a file the full path must be given to a standard
+  /// nuisance output. The standard MC histogram should have a name that matches
+  /// this sample for it to be read in.
+  /// \n\n
+  /// - Setting from "MC": \n
+  /// If the MC option is given the current MC prediction is used as fake data.
+  virtual void SetFakeDataValues(std::string fakeOption);
+
+  /// \brief Reset fake data back to starting fake data
+  ///
+  /// Reset the fake data back to original fake data (Reset back to before
+  /// ThrowCovariance was first called)
+  virtual void ResetFakeData(void);
+
+  /// \brief Reset fake data back to original data
+  ///
+  /// Reset the data histogram back to the true original dataset for this sample
+  /// before any fake data was defined.
+  virtual void ResetData(void);
+
+  /// \brief Generate fake data by throwing the covariance.
+  ///
+  /// Can be used on fake MC data or just the original dataset.
+  /// Call ResetFakeData or ResetData to return to values before the throw.
+  virtual void ThrowCovariance(void);
+
+
+  /*
+    Access Functions
+  */
+
+  /// \brief Returns nicely formatted MC Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - linecolor
+  /// - linestyle
+  /// - linewidth
+  /// - fillcolor
+  /// - fillstyle
+  ///
+  /// So to have a sample line colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// linecolor="2" linestyle="7"  linewidth="2" />
+  virtual TH1D* GetMCHistogram(void);
+
+  /// \brief Returns nicely formatted data Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - datacolor
+  /// - datastyle
+  /// - datawidth
+  ///
+  /// So to have a sample data colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// datacolor="2" datastyle="7"  datawidth="2" />
+  virtual TH1D* GetDataHistogram(void);
+
+  /// \brief Returns a list of all MC histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  virtual std::vector<TH1*> GetMCList(void);
+
+
+  /// \brief Returns a list of all Data histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  virtual std::vector<TH1*> GetDataList(void);
+
+
+  /// \brief Returns a list of all Mask histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  virtual std::vector<TH1*> GetMaskList(void);
+
+
+  /// \brief Returns a list of all Fine histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+virtual std::vector<TH1*> GetFineList(void);
 
   /*
-    XSec Functions
+    Write Functions
   */
-  /// Return total integrated flux. Will integrate flux of all sub samples if
-  /// required.
-  virtual double TotalIntegratedFlux(std::string intOpt = "width",
-                                     double low = -9999.9,
-                                     double high = -9999.9);
+  /// \brief Save the current state to the current TFile directory \n
+  ///
+  /// Data/MC are both saved by default.
+  /// A range of other histograms can be saved by setting the
+  /// config option 'drawopts'.
+  ///
+  /// Possible options: \n
+  /// - FINE    = Write Fine Histogram \n
+  /// - WEIGHTS = Write Weighted MC Histogram (before scaling) \n
+  /// - FLUX    = Write Flux Histogram from MC Input \n
+  /// - EVT     = Write Event Histogram from MC Input \n
+  /// - XSEC    = Write XSec Histogram from MC Input \n
+  /// - MASK    = Write Mask Histogram \n
+  /// - COV     = Write Covariance Histogram \n
+  /// - INVCOV  = Write Inverted Covariance Histogram \n
+  /// - DECMOP  = Write Decomp. Covariance Histogram \n
+  /// - RESIDUAL= Write Resudial Histograms \n
+  /// - RATIO   = Write Data/MC Ratio Histograms \n
+  /// - SHAPE   = Write MC Shape Histograms norm. to Data \n
+  /// - CANVMC  = Build MC Canvas Showing Data, MC, Shape \n
+  /// - MODES   = Write PDG Stack \n
+  /// - CANVPDG = Build MC Canvas Showing Data, PDGStack \n
+  ///
+  /// So to save a range of these in parameters/config.xml set: \n
+  /// <config drawopts='FINE/COV/SHAPE/RATIO' />
+  virtual void Write(std::string drawOpt);
+
+
+
+  virtual void WriteRatioPlot();
+
+
+
+
+  virtual void WriteShapePlot();
+  virtual void WriteShapeRatioPlot();
+
+
+  double TotalIntegratedFlux(std::string intOpt, double low,
+                             double high);
+
+  //*
+  // OLD DEFUNCTIONS
+  //
+
+  /// OLD FUNCTION
+  virtual void SetupMeasurement(std::string input, std::string type,
+                                FitWeight* rw, std::string fkdt);
+
+  /// OLD FUNCTION
+  virtual void SetupDefaultHist(void);
+
+  /// OLD FUNCTION
+  virtual void SetDataValues(std::string dataFile);
+
+  /// OLD FUNCTION
+  virtual void SetDataFromFile(std::string inhistfile, std::string histname);
+  /// OLD FUNCTION
+  virtual void SetDataFromDatabase(std::string inhistfile,
+                                   std::string histname);
+
+  /// OLD FUNCTION
+  virtual void SetCovarMatrix(std::string covarFile);
+  /// OLD FUNCTION
+  virtual void SetCovarMatrixFromText(std::string covarFile, int dim,
+                                      double scale = 1.0);
+  /// OLD FUNCTION
+  virtual void SetCovarMatrixFromCorrText(std::string covarFile, int dim);
+
+
+  /// OLD FUNCTION
+  virtual void SetCovarFromDataFile(std::string covarFile, std::string covName,
+                                    bool FullUnits = false);
+
+
+
+
+
+  ////// JOINT MEAS1D Functions //////
 
   /*
     Reconfigure Functions
   */
 
   /// Call reconfigure on every sub sample
   virtual void Reconfigure();
-  virtual void ReconfigureFast();
 
   /// Stitch the sub sample plots together to make a final fMCHist after
   /// reconfigure has been called
   virtual void MakePlots();
 
+
+  virtual std::vector<MeasurementBase*> GetSubSamples();
+  virtual void ConvertEventRates();
+
   /*
     Access Functions
   */
-  virtual std::vector<TH1*> GetMCList();
-  virtual std::vector<TH1*> GetDataList();
-  virtual std::vector<TH1*> GetFineList();
-  virtual std::vector<TH1*> GetMaskList();
   virtual std::vector<TH1*> GetFluxList();
   virtual std::vector<TH1*> GetEventRateList();
   virtual std::vector<TH1*> GetXSecList();
 
   //! Return a flux integrated across all sub samples
   virtual TH1D* GetCombinedFlux();
 
   //! Return an event rate integrated across all sub samples
   virtual TH1D* GetCombinedEventRate();
 
   virtual TH1D* GetEventHistogram() { return GetCombinedEventRate(); };
   virtual TH1D* GetXSecHistogram() {
     ERR(WRN)
         << "XSec histogram not properly implemented for joint measurements.";
     return MeasurementBase::GetXSecHistogram();
   };
   virtual TH1D* GetFluxHistogram() { return GetCombinedFlux(); };
 
-  /*
-    Write Functions
-  */
 
-  //! Write the current status of the plots to the current directory
-  virtual void Write(std::string drawOpt);
+protected:
+
+  // Data
+  TH1D* fDataHist;  ///< default data histogram
+  TH1D* fDataOrig;  ///< histogram to store original data before throws.
+  TH1D* fDataTrue;  ///< histogram to store true dataset
+  std::string fPlotTitles;  ///< Plot title x and y for the histograms
+
+
+  // MC
+  TH1D* fMCHist;     ///< default MC Histogram used in the chi2 fits
+  TH1D* fMCFine;     ///< finely binned MC histogram
+  TH1D* fMCStat;     ///< histogram with unweighted events to properly calculate
+  TH1D* fMCWeighted; ///< Weighted histogram before xsec scaling
+
+  TH1I* fMaskHist;   ///< Mask histogram for neglecting specific bins
+  TMatrixD* fSmearMatrix;   ///< Smearing matrix (note, this is not symmetric)
+
+  TrueModeStack* fMCHist_Modes; ///< Optional True Mode Stack
+
+
+  // Statistical
+  TMatrixDSym* covar;       ///< Inverted Covariance
+  TMatrixDSym* fFullCovar;  ///< Full Covariance
+  TMatrixDSym* fDecomp;     ///< Decomposed Covariance
+  TMatrixDSym* fCorrel;     ///< Correlation Matrix
+
+  TMatrixDSym* fCovar;    ///< New FullCovar
+  TMatrixDSym* fInvert;   ///< New covar
+
+  double fNormError;        ///< Sample norm error
 
+
+  // Fake Data
+  bool fIsFakeData;            ///< Flag: is the current data fake from MC
+  std::string fFakeDataInput;  ///< Input fake data file path
+  TFile* fFakeDataFile;        ///< Input fake data file
+
+
+  // Fit specific flags
+  std::string fFitType;       ///< Current fit type
+  std::string fAllowedTypes;  ///< Fit Types Possible
+  std::string fDefaultTypes;  ///< Starting Default Fit Types
+
+  bool fIsShape;      ///< Flag : Perform Shape-only fit
+  bool fIsFree;       ///< Flag : Perform normalisation free fit
+  bool fIsDiag;       ///< Flag : only include uncorrelated diagonal errors
+  bool fIsMask;       ///< Flag : Apply bin masking
+  bool fIsRawEvents;  ///< Flag : Are bin contents just event rates
+  bool fIsEnu1D;      ///< Flag : Perform Flux Unfolded Scaling
+  bool fIsChi2SVD;    ///< Flag : Use alternative Chi2 SVD Method (Do not use)
+  bool fAddNormPen;   ///< Flag : Add a normalisation penalty term to the chi2.
+  bool fIsFix;        ///< Flag : keeping norm fixed
+  bool fIsFull;       ///< Flag : using full covariaince
+  bool fIsDifXSec;    ///< Flag : creating a dif xsec
+  bool fIsChi2;       ///< Flag : using Chi2 over LL methods
+  bool fIsSmeared;    ///< Flag : Apply smearing?
+
+
+
+
+  /// OLD STUFF TO REMOVE
+  TH1D* fMCHist_PDG[61]; ///< REMOVE OLD MC PDG Plot
+
+  // Arrays for data entries
+  Double_t* fXBins;       ///< REMOVE xBin edges
+  Double_t* fDataValues;  ///< REMOVE data bin contents
+  Double_t* fDataErrors;  ///< REMOVE data bin errors
+  Int_t fNDataPointsX;    ///< REMOVE number of data points
+
+
+
+
+  //// JOINT MEAS1D OBJECTS ////
   std::vector<MeasurementBase*> fSubChain;  //!< Vector of experimental classes
-                                            //! that are the sub measurements
+  //! that are the sub measurements
   std::vector<std::string>
-      fSubInFiles;  //!< vector of input files for each of the sub measurements.
+  fSubInFiles;  //!< vector of input files for each of the sub measurements.
 
- protected:
   bool fIsRatio;      //!< Flag: is this sample a hist1/hist2 ratio sample
   bool fIsSummed;     //!< Flag: is this sample a combination hist1 + hist2
   bool fSaveSubMeas;  //!< Flag: Save each of the histograms from the sub
-                      //! samples as well as this joint samples plots
+  //! samples as well as this joint samples plots
+
 };
 
+
+
 /*! @} */
 #endif
diff --git a/src/FitBase/Measurement1D.cxx b/src/FitBase/Measurement1D.cxx
index c033464..67923a2 100644
--- a/src/FitBase/Measurement1D.cxx
+++ b/src/FitBase/Measurement1D.cxx
@@ -1,1406 +1,1780 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016 L. Pickering, P caltowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
-*    This file is part of NUISANCE.
+*    This ile is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #include "Measurement1D.h"
 
-/*
-   Constructor/destructor Functions
-*/
+
 //********************************************************************
-Measurement1D::Measurement1D() {
-  //********************************************************************
+Measurement1D::Measurement1D(void) {
+//********************************************************************
+
+  // XSec Scalings
   fScaleFactor = -1.0;
   fCurrentNorm = 1.0;
-  fMCHist = NULL;
+
+  // Histograms
   fDataHist = NULL;
+  fDataTrue = NULL;
+
+  fMCHist = NULL;
   fMCFine = NULL;
   fMCWeighted = NULL;
+
   fMaskHist = NULL;
-  this->covar = NULL;
+
+  // Covar
+  covar = NULL;
   fFullCovar = NULL;
+
+  fCovar  = NULL;
+  fInvert = NULL;
   fDecomp = NULL;
 
-  this->fakeDataFile = "";
+  // Fake Data
+  fFakeDataInput = "";
+  fFakeDataFile  = NULL;
 
+  // Options
   fDefaultTypes = "FIX/FULL/CHI2";
   fAllowedTypes =
-      "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/MASK";
+    "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/MASK";
 
   fIsFix = false;
   fIsShape = false;
   fIsFree = false;
   fIsDiag = false;
   fIsFull = false;
   fAddNormPen = false;
   fIsMask = false;
   fIsChi2SVD = false;
   fIsRawEvents = false;
   fIsDifXSec = false;
   fIsEnu1D = false;
 
-  NSignal = 0;
-}
+  // Inputs
+  fInput = NULL;
+  fRW = NULL;
+
+  // Extra Histograms
+  fMCHist_Modes = NULL;
 
-//********************************************************************
-Measurement1D::~Measurement1D() {
-  //********************************************************************
 }
 
 //********************************************************************
-void Measurement1D::Init() {
-  //********************************************************************
+Measurement1D::~Measurement1D(void) {
+//********************************************************************
+
+  if (fDataHist)   delete fDataHist;
+  if (fDataTrue)   delete fDataTrue;
+  if (fMCHist)     delete fMCHist;
+  if (fMCFine)     delete fMCFine;
+  if (fMCWeighted) delete fMCWeighted;
+  if (fMaskHist)   delete fMaskHist;
+  if (covar)       delete covar;
+  if (fFullCovar)  delete fFullCovar;
+  if (fCovar)      delete fCovar;
+  if (fInvert)     delete fInvert;
+  if (fDecomp)     delete fDecomp;
+
 }
 
-/*
-  Setup Functions
-  -- All these are used only at the start of the Measurement
-*/
 //********************************************************************
-void Measurement1D::SetupMeasurement(std::string inputfile, std::string type,
-                                     FitWeight* rw, std::string fkdt) {
-  //********************************************************************
+void Measurement1D::FinaliseSampleSettings() {
+//********************************************************************
 
-  // Reset everything to NULL
-  Init();
+  MeasurementBase::FinaliseSampleSettings();
 
-  // Check if name contains Evt, indicating that it is a raw number of events
-  // measurements and should thus be treated as once
-  fIsRawEvents = false;
-  if ((fName.find("Evt") != std::string::npos) && fIsRawEvents == false) {
+  // Setup naming + renaming
+  fName = fSettings.GetName();
+  fSettings.SetS("originalname", fName);
+  if (fSettings.Has("rename")) {
+    fName = fSettings.GetS("rename");
+    fSettings.SetS("name", fName);
+  }
+
+  // Setup all other options
+  LOG(SAM) << "Finalising Sample Settings: " << fName << std::endl;
+
+  if ((fSettings.GetS("originalname").find("Evt") != std::string::npos)) {
     fIsRawEvents = true;
-    LOG(SAM) << "Found event rate measurement but fIsRawEvents == false!"
-             << std::endl;
-    LOG(SAM) << "Overriding this and setting fIsRawEvents == true!"
+    LOG(SAM) << "Found event rate measurement but using poisson likelihoods."
              << std::endl;
   }
 
-  fIsEnu1D = false;
-  if (fName.find("XSec_1DEnu") != std::string::npos) {
+  if (fSettings.GetS("originalname").find("XSec_1DEnu") != std::string::npos) {
     fIsEnu1D = true;
     LOG(SAM) << "::" << fName << "::" << std::endl;
     LOG(SAM) << "Found XSec Enu measurement, applying flux integrated scaling, "
-                "not flux averaged!"
-             << std::endl;
-
-    if (FitPar::Config().GetParB("EventManager")) {
-      ERR(FTL) << "Enu Measurements do not yet work with the Event Manager!"
-               << std::endl;
-      ERR(FTL) << "If you want decent flux unfolded results please run in "
-                  "series mode (-q EventManager=0)"
-               << std::endl;
-      sleep(2);
-    }
+             << "not flux averaged!" << std::endl;
   }
 
   if (fIsEnu1D && fIsRawEvents) {
     LOG(SAM) << "Found 1D Enu XSec distribution AND fIsRawEvents, is this "
-                "really correct?!"
+             "really correct?!"
              << std::endl;
     LOG(SAM) << "Check experiment constructor for " << fName
              << " and correct this!" << std::endl;
     LOG(SAM) << "I live in " << __FILE__ << ":" << __LINE__ << std::endl;
     exit(-1);
   }
 
-  fRW = rw;
+  if (!fRW) fRW = FitBase::GetRW();
+  if (!fInput and !fIsJoint) SetupInputs(fSettings.GetS("input"));
 
-  SetupInputs(inputfile);
+  // Setup options
+  SetFitOptions(fDefaultTypes); // defaults
+  SetFitOptions(fSettings.GetS("type")); // user specified
 
-  // Set Default Options
-  SetFitOptions(fDefaultTypes);
+  EnuMin = GeneralUtils::StrToDbl(fSettings.GetS("enu_min"));
+  EnuMax = GeneralUtils::StrToDbl(fSettings.GetS("enu_max"));
 
-  // Set Passed Options
-  SetFitOptions(type);
+  if (fAddNormPen) {
+    if (fNormError <= 0.0) {
+      ERR(WRN) << "Norm error for class " << fName << " is 0.0!" << std::endl;
+      ERR(WRN) << "If you want to use it please add fNormError=VAL" << std::endl;
+      throw;
+    }
+  }
 
-  // Still adding support for flat flux inputs
-  //  // Set Enu Flux Scaling
-  //  if (isFlatFluxFolding) this->Input()->ApplyFluxFolding(
-  //  this->defaultFluxHist );
 }
 
 //********************************************************************
-void Measurement1D::SetupDefaultHist() {
-  //********************************************************************
-
-  // Setup fMCHist
-  fMCHist = (TH1D*)fDataHist->Clone();
-  fMCHist->SetNameTitle((fName + "_MC").c_str(),
-                        (fName + "_MC" + fPlotTitles).c_str());
+void Measurement1D::CreateDataHistogram(int dimx, double* binx) {
+//********************************************************************
 
-  // Setup fMCFine
-  Int_t nBins = fMCHist->GetNbinsX();
-  fMCFine = new TH1D(
-      (fName + "_MC_FINE").c_str(), (fName + "_MC_FINE" + fPlotTitles).c_str(),
-      nBins * 6, fMCHist->GetBinLowEdge(1), fMCHist->GetBinLowEdge(nBins + 1));
+  if (fDataHist) delete fDataHist;
 
-  fMCStat = (TH1D*)fMCHist->Clone();
-  fMCStat->Reset();
+  fDataHist = new TH1D( (fSettings.GetName() + "_data").c_str(), (fSettings.GetFullTitles()).c_str(),
+                        dimx, binx) ;
 
-  fMCHist->Reset();
-  fMCFine->Reset();
+}
 
-  // Setup the NEUT Mode Array
-  PlotUtils::CreateNeutModeArray((TH1D*)fMCHist, (TH1**)fMCHist_PDG);
-  PlotUtils::ResetNeutModeArray((TH1**)fMCHist_PDG);
 
-  // Setup bin masks using sample name
-  if (fIsMask) {
-    std::string maskloc = FitPar::Config().GetParDIR(fName + ".mask");
-    if (maskloc.empty()) {
-      maskloc = FitPar::GetDataBase() + "/masks/" + fName + ".mask";
-    }
+//********************************************************************
+void Measurement1D::SetDataFromTextFile(std::string datafile) {
+//********************************************************************
 
-    SetBinMask(maskloc);
-  }
+  LOG(SAM) << "Reading data from text file: " << datafile << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromFile(datafile,
+                                         fSettings.GetName() + "_data",
+                                         fSettings.GetFullTitles());
 
-  return;
 }
 
 //********************************************************************
-void Measurement1D::SetFitOptions(std::string opt) {
-  //********************************************************************
+void Measurement1D::SetDataFromRootFile(std::string datafile,
+                                        std::string histname) {
+//********************************************************************
 
-  // Do nothing if default given
-  if (opt == "DEFAULT") return;
+  LOG(SAM) << "Reading data from root file: " << datafile << ";" << histname << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile(datafile, histname);
+  fDataHist->SetNameTitle((fSettings.GetName() + "_data").c_str(),
+                          (fSettings.GetFullTitles()).c_str());
 
-  // CHECK Conflicting Fit Options
-  std::vector<std::string> fit_option_allow =
-      GeneralUtils::ParseToStr(fAllowedTypes, "/");
-  for (UInt_t i = 0; i < fit_option_allow.size(); i++) {
-    std::vector<std::string> fit_option_section =
-        GeneralUtils::ParseToStr(fit_option_allow.at(i), ",");
-    bool found_option = false;
+  return;
+};
 
-    for (UInt_t j = 0; j < fit_option_section.size(); j++) {
-      std::string av_opt = fit_option_section.at(j);
+//********************************************************************
+void Measurement1D::SetEmptyData(){
+//********************************************************************
 
-      if (!found_option and opt.find(av_opt) != std::string::npos) {
-        found_option = true;
+  fDataHist = new TH1D("EMPTY_DATA","EMPTY_DATA",1,0.0,1.0);
+}
 
-      } else if (found_option and opt.find(av_opt) != std::string::npos) {
-        ERR(FTL) << "ERROR: Conflicting fit options provided: " << opt
-                 << std::endl;
-        ERR(FTL) << "Conflicting group = " << fit_option_section.at(i)
-                 << std::endl;
-        ERR(FTL) << "You should only supply one of these options in card file."
-                 << std::endl;
-        exit(-1);
-      }
-    }
-  }
+//********************************************************************
+void Measurement1D::SetPoissonErrors() {
+//********************************************************************
 
-  // Check all options are allowed
-  std::vector<std::string> fit_options_input =
-      GeneralUtils::ParseToStr(opt, "/");
-  for (UInt_t i = 0; i < fit_options_input.size(); i++) {
-    if (fAllowedTypes.find(fit_options_input.at(i)) == std::string::npos) {
-      ERR(FTL) << "ERROR: Fit Option '" << fit_options_input.at(i)
-               << "' Provided is not allowed for this measurement."
-               << std::endl;
-      ERR(FTL) << "Fit Options should be provided as a '/' seperated list "
-                  "(e.g. FREE/DIAG/NORM)"
-               << std::endl;
-      ERR(FTL) << "Available options for " << fName << " are '" << fAllowedTypes
-               << "'" << std::endl;
+  if (!fDataHist) {
+    ERR(FTL) << "Need a data hist to setup possion errors! " << std::endl;
+    ERR(FTL) << "Setup Data First!" << std::endl;
+    throw;
+  }
 
-      exit(-1);
-    }
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, sqrt(fDataHist->GetBinContent(i + 1)));
   }
+}
 
-  // Set TYPE
-  fFitType = opt;
+//********************************************************************
+void Measurement1D::SetCovarFromDiagonal(TH1D* data) {
+//********************************************************************
 
-  // FIX,SHAPE,FREE
-  if (opt.find("FIX") != std::string::npos) {
-    fIsFree = fIsShape = false;
-    fIsFix = true;
-  } else if (opt.find("SHAPE") != std::string::npos) {
-    fIsFree = fIsFix = false;
-    fIsShape = true;
-  } else if (opt.find("FREE") != std::string::npos) {
-    fIsFix = fIsShape = false;
-    fIsFree = true;
+  if (!data and fDataHist) {
+    data = fDataHist;
   }
 
-  // DIAG,FULL (or default to full)
-  if (opt.find("DIAG") != std::string::npos) {
-    fIsDiag = true;
-    fIsFull = false;
-  } else if (opt.find("FULL") != std::string::npos) {
-    fIsDiag = false;
-    fIsFull = true;
-  }
+  if (data) {
+    LOG(SAM) << "Setting diagonal covariance for: " << data->GetName() << std::endl;
+    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(data);
+    covar      = StatUtils::GetInvert(fFullCovar);
+    fDecomp    = StatUtils::GetDecomp(fFullCovar);
+  } else {
+    ERR(FTL) << "No data input provided to set diagonal covar from!" << std::endl;
 
-  // CHI2/LL (OTHERS?)
-  if (opt.find("LOG") != std::string::npos)
-    fIsChi2 = false;
-  else
-    fIsChi2 = true;
+  }
 
-  // EXTRAS
-  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
-  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
-  if (opt.find("ENU1D") != std::string::npos) fIsEnu1D = true;
-  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
-  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+  // if (!fIsDiag) {
+  //   ERR(FTL) << "SetCovarMatrixFromDiag called for measurement "
+  //            << "that is not set as diagonal." << std::endl;
+  //   throw;
+  // }
 
-  return;
-};
+}
 
 //********************************************************************
-void Measurement1D::SetDataValues(std::string dataFile) {
-  //********************************************************************
+void Measurement1D::SetCovarFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  // Override this function if the input file isn't in a suitable format
-  LOG(SAM) << "Reading data from: " << dataFile.c_str() << std::endl;
-  fDataHist =
-    PlotUtils::GetTH1DFromFile(dataFile, (fName + "_data"), fPlotTitles);
-  fDataTrue = (TH1D*)fDataHist->Clone();
+  if (dim == -1) {
+    dim = fDataHist->GetNbinsX();
+  }
 
-  // Number of data points is number of bins
-  fNDataPointsX = fDataHist->GetXaxis()->GetNbins();
+  LOG(SAM) << "Reading covariance from text file: " << covfile << std::endl;
+  fFullCovar = StatUtils::GetCovarFromTextFile(covfile, dim);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
 
-  return;
-};
+}
 
 //********************************************************************
-void Measurement1D::SetDataFromDatabase(std::string inhistfile,
-                                        std::string histname) {
-  //********************************************************************
+void Measurement1D::SetCovarFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
-           << std::endl;
-  fDataHist = (TH1D*)PlotUtils::GetHistFromRootFile(
-      (GeneralUtils::GetTopLevelDir() + "/data/" + inhistfile), histname);
-  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
+  LOG(SAM) << "Reading covariance from text file: " << covfile << ";" << histname << std::endl;
+  fFullCovar = StatUtils::GetCovarFromRootFile(covfile, histname);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
 
-  return;
-};
+}
 
 //********************************************************************
-void Measurement1D::SetDataFromFile(std::string inhistfile,
-                                    std::string histname) {
-  //********************************************************************
+void Measurement1D::SetCovarInvertFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
-           << std::endl;
-  fDataHist = (TH1D*)PlotUtils::GetHistFromRootFile((inhistfile), histname);
-  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
+  if (dim == -1) {
+    dim = fDataHist->GetNbinsX();
+  }
 
-  return;
-};
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << std::endl;
+  covar       = StatUtils::GetCovarFromTextFile(covfile, dim);
+  fFullCovar  = StatUtils::GetInvert(covar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
+
+}
 
 //********************************************************************
-void Measurement1D::SetCovarMatrix(std::string covarFile) {
-  //********************************************************************
+void Measurement1D::SetCovarInvertFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-  // Covariance function, only really used when reading in the MB Covariances.
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << ";" << histname << std::endl;
+  covar      = StatUtils::GetCovarFromRootFile(covfile, histname);
+  fFullCovar = StatUtils::GetInvert(covar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
 
-  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
+}
 
-  TH2D* covarPlot = new TH2D();
-  //  TH2D* decmpPlot = new TH2D();
-  TH2D* covarInvPlot = new TH2D();
-  TH2D* fFullCovarPlot = new TH2D();
-  std::string covName = "";
-  std::string covOption = FitPar::Config().GetParS("thrown_covariance");
+//********************************************************************
+void Measurement1D::SetCorrelationFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  if (fIsShape || fIsFree) covName = "shp_";
-  if (fIsDiag)
-    covName += "diag";
-  else
-    covName += "full";
+  if (dim == -1) dim = fDataHist->GetNbinsX();
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << dim << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromTextFile(covfile, dim);
 
-  covarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
-  covarInvPlot = (TH2D*)tempFile->Get((covName + "covinv").c_str());
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
+  }
 
-  if (!covOption.compare("SUB"))
-    fFullCovarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
-  else if (!covOption.compare("FULL"))
-    fFullCovarPlot = (TH2D*)tempFile->Get("fullcov");
-  else
-    ERR(WRN) << "Incorrect thrown_covariance option in parameters."
-             << std::endl;
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(dim);
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
+    }
+  }
 
-  int dim = int(fDataHist->GetNbinsX());  //-this->masked->Integral());
-  int covdim = int(fDataHist->GetNbinsX());
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
 
-  this->covar = new TMatrixDSym(dim);
-  fFullCovar = new TMatrixDSym(dim);
-  fDecomp = new TMatrixDSym(dim);
+  delete correlation;
+}
 
-  int row, column = 0;
-  row = 0;
-  column = 0;
-  for (Int_t i = 0; i < covdim; i++) {
-    // if (this->masked->GetBinContent(i+1) > 0) continue;
+//********************************************************************
+void Measurement1D::SetCorrelationFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-    for (Int_t j = 0; j < covdim; j++) {
-      //   if (this->masked->GetBinContent(j+1) > 0) continue;
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << histname << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromRootFile(covfile, histname);
 
-      (*this->covar)(row, column) = covarPlot->GetBinContent(i + 1, j + 1);
-      (*fFullCovar)(row, column) = fFullCovarPlot->GetBinContent(i + 1, j + 1);
-
-      column++;
-    }
-    column = 0;
-    row++;
-  }
-
-  // Set bin errors on data
-  if (!fIsDiag) {
-    StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar);
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
   }
 
-  // Get Deteriminant and inverse matrix
-  fCovDet = this->covar->Determinant();
-
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
-
-  return;
-};
-
-//********************************************************************
-// Sets the covariance matrix from a provided file in a text format
-// scale is a multiplicative pre-factor to apply in the case where the
-// covariance is given in some unit (e.g. 1E-38)
-void Measurement1D::SetCovarMatrixFromText(std::string covarFile, int dim,
-                                           double scale) {
-  //********************************************************************
-
-  // Make a counter to track the line number
-  int row = 0;
-
-  std::string line;
-  std::ifstream covarread(covarFile.c_str(), ifstream::in);
-
-  this->covar = new TMatrixDSym(dim);
-  fFullCovar = new TMatrixDSym(dim);
-  if (covarread.is_open())
-    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
-             << std::endl;
-  else
-    ERR(FTL) << "Covariance matrix provided is incorrect: " << covarFile
-             << std::endl;
-
-  // Loop over the lines in the file
-  while (std::getline(covarread >> std::ws, line, '\n')) {
-    int column = 0;
-
-    // Loop over entries and insert them into matrix
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-
-    if (entries.size() <= 1) {
-      ERR(WRN) << "SetCovarMatrixFromText -> Covariance matrix only has <= 1 "
-                  "entries on this line: "
-               << row << std::endl;
-    }
-
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      (*covar)(row, column) = *iter;
-      (*fFullCovar)(row, column) = *iter;
-
-      column++;
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(fDataHist->GetNbinsX());
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
     }
-
-    row++;
   }
-  covarread.close();
-
-  // Scale the actualy covariance matrix by some multiplicative factor
-  (*fFullCovar) *= scale;
 
-  // Robust matrix inversion method
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  // THIS IS ACTUALLY THE INVERSE COVARIANCE MATRIXA AAAAARGH
-  delete this->covar;
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
 
-  // Now need to multiply by the scaling factor
-  // If the covariance
-  (*this->covar) *= 1. / (scale);
+  delete correlation;
+}
 
-  return;
-};
 
 //********************************************************************
-void Measurement1D::SetCovarMatrixFromCorrText(std::string corrFile, int dim) {
-  //********************************************************************
-
-  // Make a counter to track the line number
-  int row = 0;
-
-  std::string line;
-  std::ifstream corr(corrFile.c_str(), ifstream::in);
+void Measurement1D::SetCholDecompFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  this->covar = new TMatrixDSym(dim);
-  this->fFullCovar = new TMatrixDSym(dim);
-  if (corr.is_open())
-    LOG(SAM) << "Reading and converting correlation matrix from file: "
-             << corrFile << std::endl;
-  else {
-    ERR(FTL) << "Correlation matrix provided is incorrect: " << corrFile
-             << std::endl;
-    exit(-1);
+  if (dim == -1) {
+    dim = fDataHist->GetNbinsX();
   }
 
-  while (std::getline(corr >> std::ws, line, '\n')) {
-    int column = 0;
-
-    // Loop over entries and insert them into matrix
-    // Multiply by the errors to get the covariance, rather than the correlation
-    // matrix
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      double val = (*iter) * this->fDataHist->GetBinError(row + 1) * 1E38 *
-                   this->fDataHist->GetBinError(column + 1) * 1E38;
-      if (val == 0) {
-        ERR(FTL) << "Found a zero value in the covariance matrix, assuming "
-                    "this is an error!"
-                 << std::endl;
-        exit(-1);
-      }
-
-      (*this->covar)(row, column) = val;
-      (*this->fFullCovar)(row, column) = val;
+  LOG(SAM) << "Reading cholesky from text file: " << covfile << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromTextFile(covfile, dim, dim);
 
-      column++;
-    }
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
+  trans->T();
+  (*trans) *= (*temp);
 
-    row++;
-  }
+  fFullCovar  = new TMatrixDSym(dim, trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
 
-  // Robust matrix inversion method
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  delete this->covar;
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+  delete temp;
+  delete trans;
 
-  return;
-};
+}
 
 //********************************************************************
-void Measurement1D::SetSmearingMatrix(std::string smearfile, int truedim,
-                                      int recodim) {
-  //********************************************************************
-
-  // The smearing matrix describes the migration from true bins (rows) to reco
-  // bins (columns)
-  // Counter over the true bins!
-  int row = 0;
-
-  std::string line;
-  std::ifstream smear(smearfile.c_str(), ifstream::in);
+void Measurement1D::SetCholDecompFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-  // Note that the smearing matrix may be rectangular.
-  fSmearMatrix = new TMatrixD(truedim, recodim);
+  LOG(SAM) << "Reading cholesky decomp from root file: " << covfile << ";" << histname << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromRootFile(covfile, histname);
 
-  if (smear.is_open())
-    LOG(SAM) << "Reading smearing matrix from file: " << smearfile << std::endl;
-  else
-    ERR(FTL) << "Smearing matrix provided is incorrect: " << smearfile
-             << std::endl;
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
+  trans->T();
+  (*trans) *= (*temp);
 
-  while (std::getline(smear >> std::ws, line, '\n')) {
-    int column = 0;
+  fFullCovar  = new TMatrixDSym(temp->GetNrows(), trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
 
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      (*fSmearMatrix)(row, column) =
-          (*iter) / 100.;  // Convert to fraction from
-      // percentage (this may not be
-      // general enough)
-      column++;
-    }
-    row++;
-  }
-  return;
+  delete temp;
+  delete trans;
 }
 
-//********************************************************************
-// FullUnits refers to if we have "real" unscaled units in the covariance matrix, e.g. 1E-76.
-// If this is the case we need to scale it so that the chi2 contribution is correct
-// NUISANCE internally assumes the covariance matrix has units of 1E76
-void Measurement1D::SetCovarFromDataFile(std::string covarFile,
-    std::string covName, bool FullUnits) {
-  //********************************************************************
-
-  LOG(SAM) << "Getting covariance from " << covarFile << "->" << covName
-           << std::endl;
 
-  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
-  TH2D* covPlot = (TH2D*)tempFile->Get(covName.c_str());
-  covPlot->SetDirectory(0);
-  // Scale the covariance matrix if it comes in normal units
-  if (FullUnits) {
-    covPlot->Scale(1.E76);
-  }
+//********************************************************************
+void Measurement1D::ScaleData(double scale) {
+//********************************************************************
+  fDataHist->Scale(scale);
+}
 
-  int dim = covPlot->GetNbinsX();
-  fFullCovar = new TMatrixDSym(dim);
 
-  for (int i = 0; i < dim; i++) {
-    for (int j = 0; j < dim; j++) {
-      (*fFullCovar)(i, j) = covPlot->GetBinContent(i + 1, j + 1);
-    }
+//********************************************************************
+void Measurement1D::ScaleDataErrors(double scale) {
+//********************************************************************
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinError(i + 1) * scale);
   }
+}
 
-  this->covar = (TMatrixDSym*)fFullCovar->Clone();
-  fDecomp = (TMatrixDSym*)fFullCovar->Clone();
 
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
 
-  TDecompChol LUChol = TDecompChol(*fDecomp);
-  LUChol.Decompose();
-  fDecomp = new TMatrixDSym(dim, LU.GetU().GetMatrixArray(), "");
+//********************************************************************
+void Measurement1D::ScaleCovar(double scale) {
+//********************************************************************
+  (*fFullCovar) *= scale;
+  (*covar) *= 1.0 / scale;
+  (*fDecomp) *= sqrt(scale);
+}
 
-  return;
-};
 
 //********************************************************************
-void Measurement1D::SetBinMask(std::string maskFile) {
-  //********************************************************************
+void Measurement1D::SetBinMask(std::string maskfile) {
+//********************************************************************
+
+  if (!fIsMask) return;
+  LOG(SAM) << "Reading bin mask from file: " << maskfile << std::endl;
 
-  // Create a mask histogram.
+  // Create a mask histogram with dim of data
   int nbins = fDataHist->GetNbinsX();
   fMaskHist =
-      new TH1I((fName + "_fMaskHist").c_str(),
-               (fName + "_fMaskHist; Bin; Mask?").c_str(), nbins, 0, nbins);
+    new TH1I((fSettings.GetName() + "_BINMASK").c_str(),
+             (fSettings.GetName() + "_BINMASK; Bin; Mask?").c_str(), nbins, 0, nbins);
   std::string line;
-  std::ifstream mask(maskFile.c_str(), ifstream::in);
+  std::ifstream mask(maskfile.c_str(), ifstream::in);
 
-  if (mask.is_open())
-    LOG(SAM) << "Reading bin mask from file: " << maskFile << std::endl;
-  else
+  if (!mask.is_open()) {
     LOG(FTL) << " Cannot find mask file." << std::endl;
+    throw;
+  }
 
   while (std::getline(mask >> std::ws, line, '\n')) {
     std::vector<int> entries = GeneralUtils::ParseToInt(line, " ");
 
     // Skip lines with poorly formatted lines
     if (entries.size() < 2) {
       LOG(WRN) << "Measurement1D::SetBinMask(), couldn't parse line: " << line
                << std::endl;
       continue;
     }
 
     // The first index should be the bin number, the second should be the mask
     // value.
-    fMaskHist->SetBinContent(entries[0], entries[1]);
+    int val = 0;
+    if (entries[1] > 0) val = 1;
+    fMaskHist->SetBinContent(entries[0], val);
   }
 
-  // Set masked data bins to zero
+  // Apply masking by setting masked data bins to zero
   PlotUtils::MaskBins(fDataHist, fMaskHist);
 
   return;
 }
 
-/*
-   XSec Functions
-   */
 
-// //********************************************************************
-// void Measurement1D::SetFluxHistogram(std::string fluxFile, int minE, int
-// maxE,
-//     double fluxNorm) {
-//   //********************************************************************
 
-//   // Note this expects the flux bins to be given in terms of MeV
-//   LOG(SAM) << "Reading flux from file: " << fluxFile << std::endl;
+//********************************************************************
+void Measurement1D::FinaliseMeasurement() {
+//********************************************************************
 
-//   TGraph f(fluxFile.c_str(), "%lg %lg");
+  LOG(SAM) << "Finalising Measurement: " << fName << std::endl;
 
-//   fFluxHist =
-//     new TH1D((fName + "_flux").c_str(), (fName + "; E_{#nu} (GeV)").c_str(),
-//         f.GetN() - 1, minE, maxE);
+  // Make sure data is setup
+  if (!fDataHist) {
+    ERR(FTL) << "No data has been setup inside " << fName << " constructor!" << std::endl;
+    throw;
+  }
 
-//   Double_t* yVal = f.GetY();
+  // Make sure covariances are setup
+  if (!fFullCovar) {
+    SetCovarFromDiagonal(fDataHist);
+  }
 
-//   for (int i = 0; i < fFluxHist->GetNbinsX(); ++i)
-//     fFluxHist->SetBinContent(i + 1, yVal[i] * fluxNorm);
-// };
+  if (!covar) {
+    covar = StatUtils::GetInvert(fFullCovar);
+  }
 
-// //********************************************************************
-// double Measurement1D::TotalIntegratedFlux(std::string intOpt, double low,
-//     double high) {
-//   //********************************************************************
+  if (!fDecomp) {
+    fDecomp = StatUtils::GetDecomp(fFullCovar);
+  }
 
-//   if (fInput->GetType() == kGiBUU) {
-//     return 1.0;
-//   }
+  // Setup fMCHist from data
+  fMCHist = (TH1D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fSettings.GetName() + "_MC").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCHist->Reset();
 
-//   // The default case of low = -9999.9 and high = -9999.9
-//   if (low == -9999.9) low = this->EnuMin;
-//   if (high == -9999.9) high = this->EnuMax;
+  // Setup fMCFine
+  fMCFine = new TH1D("mcfine", "mcfine", fDataHist->GetNbinsX(),
+                     fMCHist->GetBinLowEdge(1),
+                     fMCHist->GetBinLowEdge(fDataHist->GetNbinsX() + 1));
+  fMCFine->SetNameTitle((fSettings.GetName() + "_MC_FINE").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCFine->Reset();
 
-//   int minBin = fFluxHist->GetXaxis()->FindBin(low);
-//   int maxBin = fFluxHist->GetXaxis()->FindBin(high);
+  // Setup MC Stat
+  fMCStat = (TH1D*)fMCHist->Clone();
+  fMCStat->Reset();
 
-//   // Get integral over custom range
-//   double integral = fFluxHist->Integral(minBin, maxBin + 1, intOpt.c_str());
+  // Search drawopts for possible types to include by default
+  std::string drawopts = FitPar::Config().GetParS("drawopts");
+  if (drawopts.find("MODES") != std::string::npos) {
+    fMCHist_Modes = new TrueModeStack( (fSettings.GetName() + "_MODES").c_str(),
+                                       ("True Channels"), fMCHist);
+    SetAutoProcessTH1(fMCHist_Modes, kCMD_Reset, kCMD_Norm, kCMD_Write);
+  }
 
-//   return integral;
-// };
+  // Setup bin masks using sample name
+  if (fIsMask) {
 
-/*
-   Reconfigure LOOP
-   */
+    std::string curname  = fName;
+    std::string origname = fSettings.GetS("originalname");
+
+    // Check rename.mask
+    std::string maskloc = FitPar::Config().GetParDIR(curname + ".mask");
+
+    // Check origname.mask
+    if (maskloc.empty()) maskloc = FitPar::Config().GetParDIR(origname + ".mask");
+
+    // Check database
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + origname + ".mask";
+    }
+
+    // Setup Bin Mask
+    SetBinMask(maskloc);
+  }
+
+  if (fScaleFactor < 0) {
+    ERR(FTL) << "I found a negative fScaleFactor in " << __FILE__ << ":" << __LINE__ << std::endl;
+    ERR(FTL) << "fScaleFactor = " << fScaleFactor << std::endl;
+    ERR(FTL) << "EXITING" << std::endl;
+    throw;
+  }
+
+  // Create and fill Weighted Histogram
+  if (!fMCWeighted) {
+
+    fMCWeighted = (TH1D*)fMCHist->Clone();
+    fMCWeighted->SetNameTitle((fName + "_MCWGHTS").c_str(),
+                              (fName + "_MCWGHTS" + fPlotTitles).c_str());
+    fMCWeighted->GetYaxis()->SetTitle("Weighted Events");
+
+  }
+
+
+}
 
 //********************************************************************
-void Measurement1D::ResetAll() {
+void Measurement1D::SetFitOptions(std::string opt) {
+//********************************************************************
+
+  // Do nothing if default given
+  if (opt == "DEFAULT") return;
+
+  // CHECK Conflicting Fit Options
+  std::vector<std::string> fit_option_allow =
+    GeneralUtils::ParseToStr(fAllowedTypes, "/");
+
+  for (UInt_t i = 0; i < fit_option_allow.size(); i++) {
+    std::vector<std::string> fit_option_section =
+      GeneralUtils::ParseToStr(fit_option_allow.at(i), ",");
+
+    bool found_option = false;
+
+    for (UInt_t j = 0; j < fit_option_section.size(); j++) {
+      std::string av_opt = fit_option_section.at(j);
+
+      if (!found_option and opt.find(av_opt) != std::string::npos) {
+        found_option = true;
+
+      } else if (found_option and opt.find(av_opt) != std::string::npos) {
+        ERR(FTL) << "ERROR: Conflicting fit options provided: "
+                 << opt << std::endl
+                 << "Conflicting group = " << fit_option_section.at(i) << std::endl
+                 << "You should only supply one of these options in card file." << std::endl;
+        throw;
+      }
+    }
+  }
+
+  // Check all options are allowed
+  std::vector<std::string> fit_options_input =
+    GeneralUtils::ParseToStr(opt, "/");
+  for (UInt_t i = 0; i < fit_options_input.size(); i++) {
+    if (fAllowedTypes.find(fit_options_input.at(i)) == std::string::npos) {
+      ERR(FTL) << "ERROR: Fit Option '" << fit_options_input.at(i)
+               << "' Provided is not allowed for this measurement."
+               << std::endl;
+      ERR(FTL) << "Fit Options should be provided as a '/' seperated list "
+               "(e.g. FREE/DIAG/NORM)"
+               << std::endl;
+      ERR(FTL) << "Available options for " << fName << " are '" << fAllowedTypes
+               << "'" << std::endl;
+
+      throw;
+    }
+  }
+
+  // Set TYPE
+  fFitType = opt;
+
+  // FIX,SHAPE,FREE
+  if (opt.find("FIX") != std::string::npos) {
+    fIsFree = fIsShape = false;
+    fIsFix = true;
+  } else if (opt.find("SHAPE") != std::string::npos) {
+    fIsFree = fIsFix = false;
+    fIsShape = true;
+  } else if (opt.find("FREE") != std::string::npos) {
+    fIsFix = fIsShape = false;
+    fIsFree = true;
+  }
+
+  // DIAG,FULL (or default to full)
+  if (opt.find("DIAG") != std::string::npos) {
+    fIsDiag = true;
+    fIsFull = false;
+  } else if (opt.find("FULL") != std::string::npos) {
+    fIsDiag = false;
+    fIsFull = true;
+  }
+
+  // CHI2/LL (OTHERS?)
+  if (opt.find("LOG") != std::string::npos) {
+    fIsChi2 = false;
+
+    ERR(FTL) << "No other LIKELIHOODS properly supported!" << std::endl;
+    ERR(FTL) << "Try to use a chi2!" << std::endl;
+    throw;
+
+  } else {
+    fIsChi2 = true;
+  }
+
+  // EXTRAS
+  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
+  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
+  if (opt.find("ENU1D") != std::string::npos) fIsEnu1D = true;
+  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
+  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+
+  return;
+};
+
+
+//********************************************************************
+void Measurement1D::SetSmearingMatrix(std::string smearfile, int truedim,
+                                      int recodim) {
   //********************************************************************
 
-  // Simple function to reset the mc Histograms incase that is all that is
-  // needed.
+  // The smearing matrix describes the migration from true bins (rows) to reco
+  // bins (columns)
+  // Counter over the true bins!
+  int row = 0;
+
+  std::string line;
+  std::ifstream smear(smearfile.c_str(), ifstream::in);
+
+  // Note that the smearing matrix may be rectangular.
+  fSmearMatrix = new TMatrixD(truedim, recodim);
+
+  if (smear.is_open())
+    LOG(SAM) << "Reading smearing matrix from file: " << smearfile << std::endl;
+  else
+    ERR(FTL) << "Smearing matrix provided is incorrect: " << smearfile
+             << std::endl;
+
+  while (std::getline(smear >> std::ws, line, '\n')) {
+    int column = 0;
+
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      (*fSmearMatrix)(row, column) =
+        (*iter) / 100.;  // Convert to fraction from
+      // percentage (this may not be
+      // general enough)
+      column++;
+    }
+    row++;
+  }
+  return;
+}
+
+//********************************************************************
+void Measurement1D::ApplySmearingMatrix() {
+//********************************************************************
+
+  if (!fSmearMatrix) {
+    ERR(WRN) << fName
+             << ": attempted to apply smearing matrix, but none was set"
+             << std::endl;
+    return;
+  }
+
+  TH1D* unsmeared = (TH1D*)fMCHist->Clone();
+  TH1D* smeared = (TH1D*)fMCHist->Clone();
+  smeared->Reset();
+
+  // Loop over reconstructed bins
+  // true = row; reco = column
+  for (int rbin = 0; rbin < fSmearMatrix->GetNcols(); ++rbin) {
+    // Sum up the constributions from all true bins
+    double rBinVal = 0;
+
+    // Loop over true bins
+    for (int tbin = 0; tbin < fSmearMatrix->GetNrows(); ++tbin) {
+      rBinVal +=
+        (*fSmearMatrix)(tbin, rbin) * unsmeared->GetBinContent(tbin + 1);
+    }
+    smeared->SetBinContent(rbin + 1, rBinVal);
+  }
+  fMCHist = (TH1D*)smeared->Clone();
+
+  return;
+}
+
+/*
+   Reconfigure LOOP
+*/
+//********************************************************************
+void Measurement1D::ResetAll() {
+//********************************************************************
 
-  // Clear histograms
   fMCHist->Reset();
   fMCFine->Reset();
   fMCStat->Reset();
-  NSignal = 0;
 
-  PlotUtils::ResetNeutModeArray((TH1**)fMCHist_PDG);
+  return;
+};
+
+//********************************************************************
+void Measurement1D::FillHistograms() {
+  //********************************************************************
+
+  if (Signal) {
+
+    fMCHist->Fill(fXVar, Weight);
+    fMCFine->Fill(fXVar, Weight);
+    fMCStat->Fill(fXVar, 1.0);
+
+    if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, fXVar, Weight);
+  }
+
+  return;
+};
+
+//********************************************************************
+void Measurement1D::ScaleEvents() {
+//********************************************************************
+
+  // Fill MCWeighted;
+  // for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+  //   fMCWeighted->SetBinContent(i + 1, fMCHist->GetBinContent(i + 1));
+  //   fMCWeighted->SetBinError(i + 1,   fMCHist->GetBinError(i + 1));
+  // }
+
+
+  // Setup Stat ratios for MC and MC Fine
+  double* statratio     = new double[fMCHist->GetNbinsX()];
+  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+    if (fMCHist->GetBinContent(i + 1) != 0) {
+      statratio[i] = fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1);
+    } else {
+      statratio[i] = 0.0;
+    }
+  }
+
+  double* statratiofine = new double[fMCFine->GetNbinsX()];
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    if (fMCFine->GetBinContent(i + 1) != 0) {
+      statratiofine[i] = fMCFine->GetBinError(i + 1) / fMCFine->GetBinContent(i + 1);
+    } else {
+      statratiofine[i] = 0.0;
+    }
+  }
+
+
+  // Scaling for raw event rates
+  if (fIsRawEvents) {
+    double datamcratio = fDataHist->Integral() / fMCHist->Integral();
+
+    fMCHist->Scale(datamcratio);
+    fMCFine->Scale(datamcratio);
+
+    if (fMCHist_Modes) fMCHist_Modes->Scale(datamcratio);
+
+    // Scaling for XSec as function of Enu
+  } else if (fIsEnu1D) {
+
+    PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram(),
+                                   GetEventHistogram(), fScaleFactor,
+                                   fNEvents);
+    PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram(),
+                                   GetEventHistogram(), fScaleFactor,
+                                   fNEvents);
+
+
+    // if (fMCHist_Modes) {
+    // PlotUtils::FluxUnfoldedScaling(fMCHist_Modes, GetFluxHistogram(),
+    // GetEventHistogram(), fScaleFactor,
+    // fNEvents);
+    // }
+
+    // Any other differential scaling
+  } else {
+    fMCHist->Scale(fScaleFactor, "width");
+    fMCFine->Scale(fScaleFactor, "width");
+
+    if (fMCHist_Modes) fMCHist_Modes->Scale(fScaleFactor, "width");
+  }
+
+
+  // Proper error scaling - ROOT Freaks out with xsec weights sometimes
+  for (int i = 0; i < fMCStat->GetNbinsX(); i++) {
+    fMCHist->SetBinError(i + 1, fMCHist->GetBinContent(i + 1) * statratio[i]);
+  }
+
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    fMCFine->SetBinError(i + 1, fMCFine->GetBinContent(i + 1) * statratiofine[i]);
+  }
+
+
+  // Clean up
+  delete statratio;
+  delete statratiofine;
+
+  return;
+};
+
+//********************************************************************
+void Measurement1D::ApplyNormScale(double norm) {
+//********************************************************************
+
+  fCurrentNorm = norm;
+
+  fMCHist->Scale(1.0 / norm);
+  fMCFine->Scale(1.0 / norm);
+
+  return;
+};
+
+
+
+/*
+   Statistic Functions - Outsources to StatUtils
+*/
+
+//********************************************************************
+int Measurement1D::GetNDOF() {
+  //********************************************************************
+  int ndof = fDataHist->GetNbinsX();
+  if (fMaskHist) ndof -= fMaskHist->Integral();
+  return ndof;
+}
+
+//********************************************************************
+double Measurement1D::GetLikelihood() {
+//********************************************************************
+
+  // If this is for a ratio, there is no data histogram to compare to!
+  if (fNoData || !fDataHist) return 0.;
+
+  // Apply Masking to MC if Required.
+  if (fIsMask and fMaskHist) {
+    PlotUtils::MaskBins(fMCHist, fMaskHist);
+  }
+
+
+  // Sort Shape Scaling
+  double scaleF = 0.0;
+  if (fIsShape) {
+    if (fMCHist->Integral(1, fMCHist->GetNbinsX(), "width")) {
+      scaleF = fDataHist->Integral(1, fDataHist->GetNbinsX(), "width") /
+               fMCHist->Integral(1, fMCHist->GetNbinsX(), "width");
+      fMCHist->Scale(scaleF);
+      fMCFine->Scale(scaleF);
+    }
+  }
+
+
+  // Likelihood Calculation
+  double stat = 0.;
+  if (fIsChi2) {
+
+    if (fIsRawEvents) {
+      stat = StatUtils::GetChi2FromEventRate(fDataHist, fMCHist, fMaskHist);
+    } else if (fIsDiag) {
+      stat = StatUtils::GetChi2FromDiag(fDataHist, fMCHist, fMaskHist);
+    } else if (!fIsDiag and !fIsRawEvents) {
+      std::cout << "Getting likelihood from covariance " << std::endl;
+      stat = StatUtils::GetChi2FromCov(fDataHist, fMCHist, covar, fMaskHist);
+    }
+
+  }
+
+  // Sort Penalty Terms
+  if (fAddNormPen) {
+    double penalty =
+      (1. - fCurrentNorm) * (1. - fCurrentNorm) / (fNormError * fNormError);
+
+    stat += penalty;
+  }
+
+  // Return to normal scaling
+  if (fIsShape and !FitPar::Config().GetParB("saveshapescaling")) {
+    fMCHist->Scale(1. / scaleF);
+    fMCFine->Scale(1. / scaleF);
+  }
+
+  return stat;
+}
+
+
+/*
+  Fake Data Functions
+*/
+//********************************************************************
+void Measurement1D::SetFakeDataValues(std::string fakeOption) {
+//********************************************************************
+
+  // Setup original/datatrue
+  TH1D* tempdata = (TH1D*) fDataHist->Clone();
+
+  if (!fIsFakeData) {
+    fIsFakeData = true;
+
+    // Make a copy of the original data histogram.
+    if (!fDataOrig) fDataOrig = (TH1D*)fDataHist->Clone((fName + "_data_original").c_str());
+
+  } else {
+    ResetFakeData();
+
+  }
+
+  // Setup Inputs
+  fFakeDataInput = fakeOption;
+  LOG(SAM) << "Setting fake data from : " << fFakeDataInput << std::endl;
+
+  // From MC
+  if (fFakeDataInput.compare("MC") == 0) {
+    fDataHist = (TH1D*)fMCHist->Clone((fName + "_MC").c_str());
+
+    // Fake File
+  } else {
+    if (!fFakeDataFile) fFakeDataFile = new TFile(fFakeDataInput.c_str(), "READ");
+    fDataHist = (TH1D*)fFakeDataFile->Get((fName + "_MC").c_str());
+
+  }
+
+  // Setup Data Hist
+  fDataHist->SetNameTitle((fName + "_FAKE").c_str(),
+                          (fName + fPlotTitles).c_str());
+
+  // Replace Data True
+  if (fDataTrue) delete fDataTrue;
+  fDataTrue = (TH1D*)fDataHist->Clone();
+  fDataTrue->SetNameTitle((fName + "_FAKE_TRUE").c_str(),
+                          (fName + fPlotTitles).c_str());
+
+
+  // Make a new covariance for fake data hist.
+  int nbins = fDataHist->GetNbinsX();
+  double alpha_i = 0.0;
+  double alpha_j = 0.0;
+
+  for (int i = 0; i < nbins; i++) {
+    for (int j = 0; j < nbins; j++) {
+      alpha_i = fDataHist->GetBinContent(i + 1) / tempdata->GetBinContent(i + 1);
+      alpha_j = fDataHist->GetBinContent(j + 1) / tempdata->GetBinContent(j + 1);
+
+      (*fFullCovar)(i, j) = alpha_i * alpha_j * (*fFullCovar)(i, j);
+    }
+  }
+
+  // Setup Covariances
+  if (covar) delete covar;
+  covar   = StatUtils::GetInvert(fFullCovar);
+
+  if (fDecomp) delete fDecomp;
+  fDecomp = StatUtils::GetInvert(fFullCovar);
+
+  delete tempdata;
+
+  return;
+};
+
+//********************************************************************
+void Measurement1D::ResetFakeData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH1D*)fDataTrue->Clone((fSettings.GetName() + "_FKDAT").c_str());
+  }
+
+}
+
+//********************************************************************
+void Measurement1D::ResetData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH1D*)fDataOrig->Clone((fSettings.GetName() + "_data").c_str());
+  }
+
+  fIsFakeData = false;
+}
+
+//********************************************************************
+void Measurement1D::ThrowCovariance() {
+//********************************************************************
+
+  // Take a fDecomposition and use it to throw the current dataset.
+  // Requires fDataTrue also be set incase used repeatedly.
+
+  if (fDataHist) delete fDataHist;
+  fDataHist = StatUtils::ThrowHistogram(fDataTrue, fFullCovar);
+
+  return;
+};
+
+/*
+   Access Functions
+*/
+
+//********************************************************************
+TH1D* Measurement1D::GetMCHistogram() {
+//********************************************************************
+
+  if (!fMCHist) return fMCHist;
+
+  std::ostringstream chi2;
+  chi2 << std::setprecision(5) << this->GetLikelihood();
+
+  int linecolor = kRed;
+  int linestyle = 1;
+  int linewidth = 1;
+
+  int fillcolor = 0;
+  int fillstyle = 1001;
+
+  // if (fSettings.Has("linecolor")) linecolor = fSettings.GetI("linecolor");
+  // if (fSettings.Has("linestyle")) linestyle = fSettings.GetI("linestyle");
+  // if (fSettings.Has("linewidth")) linewidth = fSettings.GetI("linewidth");
+
+  // if (fSettings.Has("fillcolor")) fillcolor = fSettings.GetI("fillcolor");
+  // if (fSettings.Has("fillstyle")) fillstyle = fSettings.GetI("fillstyle");
+
+  fMCHist->SetTitle(chi2.str().c_str());
+
+  fMCHist->SetLineColor(linecolor);
+  fMCHist->SetLineStyle(linestyle);
+  fMCHist->SetLineWidth(linewidth);
+
+  fMCHist->SetFillColor(fillcolor);
+  fMCHist->SetFillStyle(fillstyle);
+
+  return fMCHist;
+};
+
+//********************************************************************
+TH1D* Measurement1D::GetDataHistogram() {
+//********************************************************************
+
+  if (!fDataHist) return fDataHist;
+
+  int datacolor = kBlack;
+  int datastyle = 1;
+  int datawidth = 1;
+
+  // if (fSettings.Has("datacolor")) datacolor = fSettings.GetI("datacolor");
+  // if (fSettings.Has("datastyle")) datastyle = fSettings.GetI("datastyle");
+  // if (fSettings.Has("datawidth")) datawidth = fSettings.GetI("datawidth");
+
+  fDataHist->SetLineColor(datacolor);
+  fDataHist->SetLineWidth(datawidth);
+  fDataHist->SetMarkerStyle(datastyle);
+
+  return fDataHist;
+};
+
+
+/*
+   Write Functions
+*/
+
+// Save all the histograms at once
+//********************************************************************
+void Measurement1D::Write(std::string drawOpt) {
+//********************************************************************
+
+  // Get Draw Options
+  drawOpt = FitPar::Config().GetParS("drawopts");
+
+  // Write Data/MC
+  GetDataList().at(0)->Write();
+  GetMCList().at(0)->Write();
+
+  // Write Fine Histogram
+  if (drawOpt.find("FINE") != std::string::npos)
+    GetFineList().at(0)->Write();
+
+  // Write Weighted Histogram
+  if (drawOpt.find("WEIGHTS") != std::string::npos && fMCWeighted)
+    fMCWeighted->Write();
+
+
+  // Save Flux/Evt if no event manager
+  if (!FitPar::Config().GetParB("EventManager")) {
+
+    if (drawOpt.find("FLUX") != std::string::npos && GetFluxHistogram())
+      GetFluxHistogram()->Write();
+
+    if (drawOpt.find("EVT") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
+
+    if (drawOpt.find("XSEC") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
+
+  }
+
+  // Write Mask
+  if (fIsMask && (drawOpt.find("MASK") != std::string::npos)) {
+    fMaskHist->Write();
+  }
+
+
+  // Write Covariances
+  if (drawOpt.find("COV") != std::string::npos && fFullCovar) {
+    PlotUtils::GetFullCovarPlot(fFullCovar, fSettings.GetName());
+  }
+
+  if (drawOpt.find("INVCOV") != std::string::npos && covar) {
+    PlotUtils::GetInvCovarPlot(covar, fSettings.GetName());
+  }
+
+  if (drawOpt.find("DECOMP") != std::string::npos && fDecomp) {
+    PlotUtils::GetDecompCovarPlot(fDecomp, fSettings.GetName());
+  }
+
+  // // Likelihood residual plots
+  // if (drawOpt.find("RESIDUAL") != std::string::npos) {
+  //   WriteResidualPlots();
+  // }
+
+  // Ratio and Shape Plots
+  if (drawOpt.find("RATIO") != std::string::npos) {
+    WriteRatioPlot();
+  }
+
+  if (drawOpt.find("SHAPE") != std::string::npos) {
+    WriteShapePlot();
+    if (drawOpt.find("RATIO") != std::string::npos)
+      WriteShapeRatioPlot();
+  }
+
+  // // RATIO
+  // if (drawOpt.find("CANVMC") != std::string::npos) {
+  //   TCanvas* c1 = WriteMCCanvas(fDataHist, fMCHist);
+  //   c1->Write();
+  //   delete c1;
+  // }
+
+  // // PDG
+  // if (drawOpt.find("CANVPDG") != std::string::npos && fMCHist_Modes) {
+  //   TCanvas* c2 = WritePDGCanvas(fDataHist, fMCHist, fMCHist_Modes);
+  //   c2->Write();
+  //   delete c2;
+  // }
+
+  // Write Extra Histograms
+  AutoWriteExtraTH1();
+  WriteExtraHistograms();
+
+  // Returning
+  LOG(SAM) << "Written Histograms: " << fName << std::endl;
+  return;
+}
+
+//********************************************************************
+void Measurement1D::WriteRatioPlot() {
+//********************************************************************
+
+  // Setup mc data ratios
+  TH1D* dataRatio = (TH1D*)fDataHist->Clone((fName + "_data_RATIO").c_str());
+  TH1D* mcRatio   = (TH1D*)fMCHist->Clone((fName + "_MC_RATIO").c_str());
+
+  // Extra MC Data Ratios
+  for (int i = 0; i < mcRatio->GetNbinsX(); i++) {
+
+    dataRatio->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) / fMCHist->GetBinContent(i + 1));
+    dataRatio->SetBinError(i + 1,   fDataHist->GetBinError(i + 1)   / fMCHist->GetBinContent(i + 1));
+
+    mcRatio->SetBinContent(i + 1, fMCHist->GetBinContent(i + 1) / fMCHist->GetBinContent(i + 1));
+    mcRatio->SetBinError(i + 1,   fMCHist->GetBinError(i + 1)   / fMCHist->GetBinContent(i + 1));
+
+  }
+
+  // Write ratios
+  mcRatio->Write();
+  dataRatio->Write();
+
+  delete mcRatio;
+  delete dataRatio;
+}
+
+
+//********************************************************************
+void Measurement1D::WriteShapePlot() {
+//********************************************************************
+
+  TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
+
+  double shapeScale = 1.0;
+  if (fIsRawEvents) {
+    shapeScale = fDataHist->Integral() / fMCHist->Integral();
+  } else {
+    shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
+  }
+
+  mcShape->Scale(shapeScale);
 
-  return;
-};
+  std::stringstream ss;
+  ss << shapeScale;
+  mcShape->SetTitle(ss.str().c_str());
 
-//********************************************************************
-void Measurement1D::FillHistograms() {
-  //********************************************************************
+  mcShape->SetLineWidth(3);
+  mcShape->SetLineStyle(7);
 
-  if (Signal) {
-    fMCHist->Fill(fXVar, Weight);
-    fMCFine->Fill(fXVar, Weight);
-    fMCStat->Fill(fXVar, 1.0);
-    NSignal++;
+  mcShape->Write();
 
-    PlotUtils::FillNeutModeArray(fMCHist_PDG, Mode, fXVar, Weight);
-  }
+  delete mcShape;
 
-  return;
-};
+}
 
 //********************************************************************
-void Measurement1D::ScaleEvents() {
-  //********************************************************************
+void Measurement1D::WriteShapeRatioPlot() {
+//********************************************************************
 
-  // Check that the fScaleFactor variable has been set and makes sense
-  if (fScaleFactor < 0) {
-    ERR(FTL) << "I found a negative fScaleFactor in " << __FILE__ << ":" << __LINE__ << std::endl;
-    ERR(FTL) << "fScaleFactor = " << fScaleFactor << std::endl;
-    ERR(FTL) << "EXITING" << std::endl;
-    throw;
+  // Get a mcshape histogram
+  TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
+
+  double shapeScale = 1.0;
+  if (fIsRawEvents) {
+    shapeScale = fDataHist->Integral() / fMCHist->Integral();
+  } else {
+    shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
   }
 
-  LOG(REC) << std::setw(10) << std::right << NSignal << "/"
-           << fNEvents << " events passed selection + binning after reweight"
-           << std::endl;
+  mcShape->Scale(shapeScale);
 
-  // Simple function to scale to xsec result if this is all that is needed.
-  // Scale bin errors correctly
-  TH1D* tempFine = (TH1D*)fMCFine->Clone();
+  // Create shape ratio histograms
+  TH1D* mcShapeRatio   = (TH1D*)mcShape->Clone((fName + "_MC_SHAPE_RATIO").c_str());
+  TH1D* dataShapeRatio = (TH1D*)fDataHist->Clone((fName + "_data_SHAPE_RATIO").c_str());
 
-  // Create Weighted Histogram
-  if (fMCWeighted) delete fMCWeighted;
-  fMCWeighted = (TH1D*)fMCHist->Clone();
-  fMCWeighted->SetNameTitle((fName + "_MC_WGHTS").c_str(),
-                            (fName + "_MC_WGHTS" + fPlotTitles).c_str());
-  fMCWeighted->GetYaxis()->SetTitle("Weighted Events");
+  // Divide the histograms
+  mcShapeRatio->Divide(mcShape);
+  dataShapeRatio->Divide(mcShape);
 
-  // Should apply different scaling for:
-  // 1D Enu distributions -- need bin by bin flux unfolding (bin by bin flux
-  // integration)
-  // 1D count distributions -- need shape scaling to data
-  // anything else -- flux averages
+  // Colour the shape ratio plots
+  mcShapeRatio->SetLineWidth(3);
+  mcShapeRatio->SetLineStyle(7);
 
-  LOG(DEB) << "Scaling Factor = " << fScaleFactor << endl;
-  LOG(DEB) << "MC Hist = " << fMCHist->Integral() << endl;
+  mcShapeRatio->Write();
+  dataShapeRatio->Write();
 
-  // Scaling for raw event rates
-  if (fIsRawEvents) {
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG,
-                                  (fDataHist->Integral() / fMCHist->Integral()),
-                                  "width");
-    fMCHist->Scale(fDataHist->Integral() / fMCHist->Integral());
-    fMCFine->Scale(fDataHist->Integral() / fMCFine->Integral());
+  delete mcShapeRatio;
+  delete dataShapeRatio;
 
-    // Scaling for XSec as function of Enu
-  } else if (fIsEnu1D) {
-    PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram(),
-                                   GetEventHistogram(), fScaleFactor,
-                                   fNEvents);
-    PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram(),
-                                   GetEventHistogram(), fScaleFactor,
-                                   fNEvents);
+}
 
-    // Any other differential scaling
-  } else {
-    fMCHist->Scale(fScaleFactor, "width");
-    fMCFine->Scale(fScaleFactor, "width");
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, fScaleFactor, "width");
-  }
 
-  // Proper error scaling - ROOT Freaks out with xsec weights sometimes
-  // Scale the MC histogram
-  for (int i = 0; i < fMCStat->GetNbinsX(); i++) {
-    if (fMCStat->GetBinContent(i + 1) != 0) {
-      fMCHist->SetBinError(i + 1, fMCHist->GetBinContent(i + 1) *
-                                      fMCStat->GetBinError(i + 1) /
-                                      fMCStat->GetBinContent(i + 1));
-    } else {
-      fMCHist->SetBinError(i + 1, fMCHist->Integral());
-    }
-  }
 
-  // Scale the fine MC histogram
-  for (int i = 0; i < tempFine->GetNbinsX(); i++) {
-    if (tempFine->GetBinContent(i + 1) != 0) {
-      fMCFine->SetBinError(i + 1, fMCFine->GetBinContent(i + 1) *
-                                      tempFine->GetBinError(i + 1) /
-                                      tempFine->GetBinContent(i + 1));
-    } else {
-      fMCFine->SetBinError(i + 1, fMCFine->Integral());
-    }
-  }
-  
-  // Set the number of signal events back to zero so we don't keep counting
-  NSignal = 0;
 
-  return;
-};
+//// CRAP TO BE REMOVED
+
 
 //********************************************************************
-void Measurement1D::ApplyNormScale(double norm) {
+void Measurement1D::SetupMeasurement(std::string inputfile, std::string type,
+                                     FitWeight * rw, std::string fkdt) {
   //********************************************************************
 
-  fCurrentNorm = norm;
 
-  fMCHist->Scale(1.0 / norm);
-  fMCFine->Scale(1.0 / norm);
+  //nuiskey samplekey = Config::CreateKey("sample");
+//  samplekey.AddS("name", fName);
+//  samplekey.AddS("type",type);
+//  samplekey.AddS("input",inputfile);
+//  fSettings = LoadSampleSettings(samplekey);
 
-  PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, 1.0 / norm);
+  // Reset everything to NULL
+  // Init();
 
-  return;
-};
+  // Check if name contains Evt, indicating that it is a raw number of events
+  // measurements and should thus be treated as once
+  fIsRawEvents = false;
+  if ((fName.find("Evt") != std::string::npos) && fIsRawEvents == false) {
+    fIsRawEvents = true;
+    LOG(SAM) << "Found event rate measurement but fIsRawEvents == false!"
+             << std::endl;
+    LOG(SAM) << "Overriding this and setting fIsRawEvents == true!"
+             << std::endl;
+  }
 
-//********************************************************************
-void Measurement1D::ApplySmearingMatrix() {
-  //********************************************************************
+  fIsEnu1D = false;
+  if (fName.find("XSec_1DEnu") != std::string::npos) {
+    fIsEnu1D = true;
+    LOG(SAM) << "::" << fName << "::" << std::endl;
+    LOG(SAM) << "Found XSec Enu measurement, applying flux integrated scaling, "
+             "not flux averaged!"
+             << std::endl;
+  }
 
-  if (!fSmearMatrix) {
-    ERR(WRN) << fName
-             << ": attempted to apply smearing matrix, but none was set"
+  if (fIsEnu1D && fIsRawEvents) {
+    LOG(SAM) << "Found 1D Enu XSec distribution AND fIsRawEvents, is this "
+             "really correct?!"
              << std::endl;
-    return;
+    LOG(SAM) << "Check experiment constructor for " << fName
+             << " and correct this!" << std::endl;
+    LOG(SAM) << "I live in " << __FILE__ << ":" << __LINE__ << std::endl;
+    exit(-1);
   }
 
-  TH1D* unsmeared = (TH1D*)fMCHist->Clone();
-  TH1D* smeared = (TH1D*)fMCHist->Clone();
-  smeared->Reset();
+  fRW = rw;
 
-  // Loop over reconstructed bins
-  // true = row; reco = column
-  for (int rbin = 0; rbin < fSmearMatrix->GetNcols(); ++rbin) {
-    // Sum up the constributions from all true bins
-    double rBinVal = 0;
+  if (!fInput and !fIsJoint) SetupInputs(inputfile);
 
-    // Loop over true bins
-    for (int tbin = 0; tbin < fSmearMatrix->GetNrows(); ++tbin) {
-      rBinVal +=
-          (*fSmearMatrix)(tbin, rbin) * unsmeared->GetBinContent(tbin + 1);
-    }
-    smeared->SetBinContent(rbin + 1, rBinVal);
-  }
-  fMCHist = (TH1D*)smeared->Clone();
+  // Set Default Options
+  SetFitOptions(fDefaultTypes);
 
-  return;
-}
+  // Set Passed Options
+  SetFitOptions(type);
 
-/*
-   Statistic Functions - Outsources to StatUtils
-   */
+  // Still adding support for flat flux inputs
+  //  // Set Enu Flux Scaling
+  //  if (isFlatFluxFolding) this->Input()->ApplyFluxFolding(
+  //  this->defaultFluxHist );
 
-//********************************************************************
-int Measurement1D::GetNDOF() {
-  //********************************************************************
-  return fDataHist->GetNbinsX();  // - fMaskHist->Integral();
+  // FinaliseMeasurement();
 }
 
 //********************************************************************
-double Measurement1D::GetLikelihood() {
+void Measurement1D::SetupDefaultHist() {
   //********************************************************************
 
-  double stat = 0.0;
-
-  // If this is for a ratio, there is no data histogram to compare to!
-  if (fNoData || !fDataHist) return 0.;
-
-  // Fix weird masking bug
-  if (!fIsMask) {
-    if (fMaskHist) {
-      fMaskHist = NULL;
-    }
-  } else {
-    if (fMaskHist) {
-      PlotUtils::MaskBins(fMCHist, fMaskHist);
-    }
-  }
+  // Setup fMCHist
+  fMCHist = (TH1D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fName + "_MC").c_str(),
+                        (fName + "_MC" + fPlotTitles).c_str());
 
-  // Sort Initial Scaling
-  double scaleF = 0.0;
-  if (fMCHist->Integral(1, fMCHist->GetNbinsX(), "width")) {
-    scaleF = fDataHist->Integral(1, fDataHist->GetNbinsX(), "width") /
-             fMCHist->Integral(1, fMCHist->GetNbinsX(), "width");
-  }
+  // Setup fMCFine
+  Int_t nBins = fMCHist->GetNbinsX();
+  fMCFine = new TH1D(
+    (fName + "_MC_FINE").c_str(), (fName + "_MC_FINE" + fPlotTitles).c_str(),
+    nBins * 6, fMCHist->GetBinLowEdge(1), fMCHist->GetBinLowEdge(nBins + 1));
 
-  if (fIsShape) {
-    fMCHist->Scale(scaleF);
-    fMCFine->Scale(scaleF);
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, scaleF);
-  }
+  fMCStat = (TH1D*)fMCHist->Clone();
+  fMCStat->Reset();
 
-  // Get Chi2
-  if (fIsChi2) {
-    // If this isn't a diagonal matrix (i.e. it has a covariance supplied)
-    if (!fIsDiag) {
-      // If we don't want to get the chi2 from SVD decomp
-      if (!fIsChi2SVD) {
-        stat = StatUtils::GetChi2FromCov(fDataHist, fMCHist, covar, fMaskHist);
-      } else {
-        stat = StatUtils::GetChi2FromSVD(fDataHist, fMCHist, fFullCovar,
-                                         fMaskHist);
-      }
+  fMCHist->Reset();
+  fMCFine->Reset();
 
-    } else {
-      if (fIsRawEvents) {
-        stat = StatUtils::GetChi2FromEventRate(fDataHist, fMCHist, fMaskHist);
-      } else {
-        stat = StatUtils::GetChi2FromDiag(fDataHist, fMCHist, fMaskHist);
-      }
-    }
-  } else {
-    if (!fIsDiag) {
-      if (!fIsChi2SVD)
-        stat = StatUtils::GetLikelihoodFromCov(fDataHist, fMCHist, covar,
-                                               fMaskHist);
-      else
-        stat = StatUtils::GetLikelihoodFromSVD(fDataHist, fMCHist, fFullCovar,
-                                               fMaskHist);
-    } else {
-      if (fIsRawEvents)
-        stat = StatUtils::GetLikelihoodFromEventRate(fDataHist, fMCHist,
-                                                     fMaskHist);
-      else
-        stat = StatUtils::GetLikelihoodFromDiag(fDataHist, fMCHist, fMaskHist);
-    }
-  }
+  // Setup the NEUT Mode Array
+  PlotUtils::CreateNeutModeArray((TH1D*)fMCHist, (TH1**)fMCHist_PDG);
+  PlotUtils::ResetNeutModeArray((TH1**)fMCHist_PDG);
 
-  // Sort Penalty Terms
-  if (fAddNormPen) {
-    if (fNormError <= 0.0) {
-      ERR(WRN) << "Norm error for class " << fName << " is 0.0!" << endl;
-      ERR(WRN) << "Skipping norm penalty." << endl;
+  // Setup bin masks using sample name
+  if (fIsMask) {
+    std::string maskloc = FitPar::Config().GetParDIR(fName + ".mask");
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + fName + ".mask";
     }
 
-    double penalty =
-        (1. - fCurrentNorm) * (1. - fCurrentNorm) / (fNormError * fNormError);
-    stat += penalty;
+    SetBinMask(maskloc);
   }
 
-  // Return to normal scaling
-  if (fIsShape and !FitPar::Config().GetParB("saveshapescaling")) {
-    fMCHist->Scale(1. / scaleF);
-    fMCFine->Scale(1. / scaleF);
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, 1.0 / scaleF);
-  }
+  fMCHist_Modes = new TrueModeStack( (fName + "_MODES").c_str(), ("True Channels"), fMCHist);
+  SetAutoProcessTH1(fMCHist_Modes, kCMD_Reset, kCMD_Norm, kCMD_Write);
 
-  return stat;
+  return;
 }
 
+
+
+
+
 //********************************************************************
-void Measurement1D::SetFakeDataValues(std::string fakeOption) {
+void Measurement1D::SetDataValues(std::string dataFile) {
   //********************************************************************
 
-  // Reset things
-  if (fIsFakeData) {
-    this->ResetFakeData();
-  } else {
-    fIsFakeData = true;
-  }
-
-  // Make a copy of the original data histogram.
-  if (!(fDataOrig))
-    fDataOrig = (TH1D*)fDataHist->Clone((fName + "_data_original").c_str());
+  // Override this function if the input file isn't in a suitable format
+  LOG(SAM) << "Reading data from: " << dataFile.c_str() << std::endl;
+  fDataHist =
+    PlotUtils::GetTH1DFromFile(dataFile, (fName + "_data"), fPlotTitles);
+  fDataTrue = (TH1D*)fDataHist->Clone();
 
-  TH1D* tempData = (TH1D*)fDataHist->Clone();
-  TFile* fake = new TFile();
+  // Number of data points is number of bins
+  fNDataPointsX = fDataHist->GetXaxis()->GetNbins();
 
-  if (fakeOption.compare("MC") == 0) {
-    LOG(SAM) << "Setting fake data from MC " << std::endl;
-    fDataHist = (TH1D*)fMCHist->Clone((fName + "_MC").c_str());
-    if (fMCHist->Integral() == 0.0)
-      ERR(WRN) << fName << ": Invalid histogram" << std::endl;
-  } else {
-    fake = new TFile(fakeOption.c_str());
-    fDataHist = (TH1D*)fake->Get((fName + "_MC").c_str());
-  }
+  return;
+};
 
-  fDataHist->SetNameTitle((fName + "_FAKE").c_str(),
-                          (fName + fPlotTitles).c_str());
 
-  fDataTrue = (TH1D*)fDataHist->Clone();
-  fDataTrue->SetNameTitle((fName + "_FAKE_TRUE").c_str(),
-                          (fName + fPlotTitles).c_str());
 
-  int nbins = fDataHist->GetNbinsX();
-  double alpha_i = 0.0;
-  double alpha_j = 0.0;
 
-  for (int i = 0; i < nbins; i++) {
-    for (int j = 0; j < nbins; j++) {
-      alpha_i =
-          fDataHist->GetBinContent(i + 1) / tempData->GetBinContent(i + 1);
-      alpha_j =
-          fDataHist->GetBinContent(j + 1) / tempData->GetBinContent(j + 1);
 
-      (*this->covar)(i, j) = (1.0 / (alpha_i * alpha_j)) * (*this->covar)(i, j);
-      (*fFullCovar)(i, j) = alpha_i * alpha_j * (*fFullCovar)(i, j);
-    }
-  }
+//********************************************************************
+void Measurement1D::SetDataFromDatabase(std::string inhistfile,
+                                        std::string histname) {
+  //********************************************************************
 
-  (this->covar) = (TMatrixDSym*)fFullCovar->Clone();
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(nbins, LU.Invert().GetMatrixArray(), "");
+  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
+           << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile(
+                (GeneralUtils::GetTopLevelDir() + "/data/" + inhistfile), histname);
+  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
 
   return;
 };
 
 //********************************************************************
-void Measurement1D::ResetFakeData() {
+void Measurement1D::SetDataFromFile(std::string inhistfile,
+                                    std::string histname) {
   //********************************************************************
 
-  if (fIsFakeData)
-    if (fDataHist) delete fDataHist;
-  fDataHist = (TH1D*)fDataTrue->Clone((fName + "_FKDAT").c_str());
+  LOG(SAM) << "Filling histogram from " << inhistfile << "->" << histname
+           << std::endl;
+  fDataHist = PlotUtils::GetTH1DFromRootFile((inhistfile), histname);
+  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_data").c_str());
 
   return;
-}
+};
 
 //********************************************************************
-void Measurement1D::ResetData() {
+void Measurement1D::SetCovarMatrix(std::string covarFile) {
   //********************************************************************
 
-  if (fIsFakeData)
-    if (fDataHist) delete fDataHist;
-  fDataHist = (TH1D*)fDataTrue->Clone((fName + "_Data").c_str());
+  // Covariance function, only really used when reading in the MB Covariances.
 
-  fIsFakeData = false;
-}
+  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
 
-//********************************************************************
-void Measurement1D::ThrowCovariance() {
-  //********************************************************************
+  TH2D* covarPlot = new TH2D();
+  //  TH2D* decmpPlot = new TH2D();
+  TH2D* covarInvPlot = new TH2D();
+  TH2D* fFullCovarPlot = new TH2D();
+  std::string covName = "";
+  std::string covOption = FitPar::Config().GetParS("thrown_covariance");
+
+  if (fIsShape || fIsFree) covName = "shp_";
+  if (fIsDiag)
+    covName += "diag";
+  else
+    covName += "full";
 
-  // Take a fDecomposition and use it to throw the current dataset.
-  // Requires fDataTrue also be set incase used repeatedly.
+  covarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  covarInvPlot = (TH2D*)tempFile->Get((covName + "covinv").c_str());
 
-  delete fDataHist;
-  fDataHist = StatUtils::ThrowHistogram(fDataTrue, fFullCovar);
+  if (!covOption.compare("SUB"))
+    fFullCovarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  else if (!covOption.compare("FULL"))
+    fFullCovarPlot = (TH2D*)tempFile->Get("fullcov");
+  else
+    ERR(WRN) << "Incorrect thrown_covariance option in parameters."
+             << std::endl;
 
-  return;
-};
+  int dim = int(fDataHist->GetNbinsX());  //-this->masked->Integral());
+  int covdim = int(fDataHist->GetNbinsX());
 
-/*
-   Access Functions
-   */
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  fDecomp = new TMatrixDSym(dim);
 
-//********************************************************************
-std::vector<TH1*> Measurement1D::GetMCList() {
-  //********************************************************************
+  int row, column = 0;
+  row = 0;
+  column = 0;
+  for (Int_t i = 0; i < covdim; i++) {
+    // if (this->masked->GetBinContent(i+1) > 0) continue;
 
-  // If this isn't a NULL pointer, make the plot pretty!
-  if (!fMCHist) return std::vector<TH1*>(1, fMCHist);
+    for (Int_t j = 0; j < covdim; j++) {
+      //   if (this->masked->GetBinContent(j+1) > 0) continue;
 
-  std::ostringstream chi2;
-  chi2 << std::setprecision(5) << this->GetLikelihood();
+      (*this->covar)(row, column) = covarPlot->GetBinContent(i + 1, j + 1);
+      (*fFullCovar)(row, column) = fFullCovarPlot->GetBinContent(i + 1, j + 1);
 
-  int plotcolor = kRed;
-  if (FitPar::Config().GetParI("linecolour") > 0) {
-    plotcolor = FitPar::Config().GetParI("linecolour");
+      column++;
+    }
+    column = 0;
+    row++;
   }
 
-  int plotstyle = 1;
-  if (FitPar::Config().GetParI("linestyle") > 0) {
-    plotstyle = FitPar::Config().GetParI("linestyle");
+  // Set bin errors on data
+  if (!fIsDiag) {
+    StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar);
   }
 
-  int plotfillstyle = 0;
-  if (FitPar::Config().GetParI("fillstyle") > 0) {
-    plotfillstyle = FitPar::Config().GetParI("fillstyle");
-  }
+  // Get Deteriminant and inverse matrix
+  // fCovDet = this->covar->Determinant();
 
-  fMCHist->SetTitle(chi2.str().c_str());
-  fMCHist->SetLineWidth(3);
-  fMCHist->SetLineColor(plotcolor);
-  fMCHist->SetFillColor(plotcolor);
-  fMCHist->SetLineStyle(plotstyle);
-  fMCHist->SetFillStyle(plotfillstyle);
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
 
-  return std::vector<TH1*>(1, fMCHist);
+  return;
 };
 
 //********************************************************************
-std::vector<TH1*> Measurement1D::GetDataList() {
+// Sets the covariance matrix from a provided file in a text format
+// scale is a multiplicative pre-factor to apply in the case where the
+// covariance is given in some unit (e.g. 1E-38)
+void Measurement1D::SetCovarMatrixFromText(std::string covarFile, int dim,
+    double scale) {
   //********************************************************************
-  // If this isn't a NULL pointer, make the plot pretty!
-
-  if (!fDataHist) return std::vector<TH1*>(1, fDataHist);
-
-  fDataHist->SetLineWidth(2);
-  fDataHist->SetMarkerStyle(8);
-
-  fDataHist->SetLineColor(kBlack);
-
-  return std::vector<TH1*>(1, fDataHist);
-};
 
-//********************************************************************
-void Measurement1D::GetBinContents(std::vector<double>& cont,
-                                   std::vector<double>& err) {
-  //********************************************************************
+  // Make a counter to track the line number
+  int row = 0;
 
-  // Return a vector of the main bin contents
-  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
-    cont.push_back(fMCHist->GetBinContent(i + 1));
-    err.push_back(fMCHist->GetBinError(i + 1));
-  }
+  std::string line;
+  std::ifstream covarread(covarFile.c_str(), ifstream::in);
 
-  return;
-};
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  if (covarread.is_open())
+    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
+             << std::endl;
+  else
+    ERR(FTL) << "Covariance matrix provided is incorrect: " << covarFile
+             << std::endl;
 
-//********************************************************************
-std::vector<double> Measurement1D::GetXSec(std::string option) {
-  //********************************************************************
+  // Loop over the lines in the file
+  while (std::getline(covarread >> std::ws, line, '\n')) {
+    int column = 0;
 
-  std::vector<double> vals;
-  vals.push_back(0.0);
-  vals.push_back(0.0);
+    // Loop over entries and insert them into matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
 
-  bool getMC = !option.compare("MC");
-  bool getDT = !option.compare("DATA");
+    if (entries.size() <= 1) {
+      ERR(WRN) << "SetCovarMatrixFromText -> Covariance matrix only has <= 1 "
+               "entries on this line: "
+               << row << std::endl;
+    }
 
-  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
-    if (fDataHist->GetBinContent(i + 1) == 0.0 and
-        fDataHist->GetBinError(i + 1) == 0.0)
-      continue;
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      (*covar)(row, column) = *iter;
+      (*fFullCovar)(row, column) = *iter;
 
-    if (getMC) {
-      vals[0] += fMCHist->GetBinContent(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1);
-      vals[1] += fMCHist->GetBinError(i + 1) * fMCHist->GetBinError(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1);
-
-    } else if (getDT) {
-      vals[0] += fDataHist->GetBinContent(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1);
-      vals[1] += fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1);
+      column++;
     }
-  }
 
-  // If not diag Get the total error from the covariance
-  if (!fIsDiag and !fIsRawEvents and getDT and fFullCovar) {
-    vals[1] = 0.0;
-    for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
-      for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
-        vals[1] += (*fFullCovar)(i, j);
-      }
-    }
-    vals[1] = sqrt(vals[1]) * 1E-38;
+    row++;
   }
+  covarread.close();
 
-  return vals;
-}
+  // Scale the actualy covariance matrix by some multiplicative factor
+  (*fFullCovar) *= scale;
 
-/*
-   Write Functions
-   */
+  // Robust matrix inversion method
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  // THIS IS ACTUALLY THE INVERSE COVARIANCE MATRIXA AAAAARGH
+  delete this->covar;
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  // Now need to multiply by the scaling factor
+  // If the covariance
+  (*this->covar) *= 1. / (scale);
+
+  return;
+};
 
-// Save all the histograms at once
 //********************************************************************
-void Measurement1D::Write(std::string drawOpt) {
+void Measurement1D::SetCovarMatrixFromCorrText(std::string corrFile, int dim) {
   //********************************************************************
 
-  // If null pointer return
-  if (!fMCHist and !fDataHist) {
-    ERR(WRN) << fName << "Incomplete histogram set!" << std::endl;
-    return;
-  }
+  // Make a counter to track the line number
+  int row = 0;
 
-  //  FitPar::Config().out->cd();
+  std::string line;
+  std::ifstream corr(corrFile.c_str(), ifstream::in);
 
-  // Get Draw Options
-  drawOpt = FitPar::Config().GetParS("drawopts");
-  bool drawData = (drawOpt.find("DATA") != std::string::npos);
-  bool drawNormal = (drawOpt.find("MC") != std::string::npos);
-  bool drawEvents = (drawOpt.find("EVT") != std::string::npos);
-  bool drawFine = (drawOpt.find("FINE") != std::string::npos);
-  bool drawRatio = (drawOpt.find("RATIO") != std::string::npos);
-  bool drawModes = (drawOpt.find("MODES") != std::string::npos);
-  bool drawShape = (drawOpt.find("SHAPE") != std::string::npos);
-  //  bool residual = (drawOpt.find("RESIDUAL") != std::string::npos);
-  //  bool drawMatrix = (drawOpt.find("MATRIX") != std::string::npos);
-  bool drawXSec = (drawOpt.find("XSEC") != std::string::npos);
-  bool drawFlux = (drawOpt.find("FLUX") != std::string::npos);
-  bool drawMask = (drawOpt.find("MASK") != std::string::npos);
-  bool drawCov = (drawOpt.find("COV") != std::string::npos);
-  bool drawInvCov = (drawOpt.find("INVCOV") != std::string::npos);
-  bool drawDecomp = (drawOpt.find("DECOMP") != std::string::npos);
-  bool drawCanvPDG = (drawOpt.find("CANVPDG") != std::string::npos);
-  bool drawCanvMC = (drawOpt.find("CANVMC") != std::string::npos);
-
-  bool drawWeighted = (drawOpt.find("WGHT") != std::string::npos);
-
-  if (FitPar::Config().GetParB("EventManager")) {
-    drawFlux = false;
-    drawXSec = false;
-    drawEvents = false;
-  }
-
-  // Save standard plots
-  if (drawData) this->GetDataList().at(0)->Write();
-  if (drawNormal) this->GetMCList().at(0)->Write();
-
-  // Save only mc and data if splines
-  if (fEventType == 4 or fEventType == 3) {
-    return;
+  this->covar = new TMatrixDSym(dim);
+  this->fFullCovar = new TMatrixDSym(dim);
+  if (corr.is_open())
+    LOG(SAM) << "Reading and converting correlation matrix from file: "
+             << corrFile << std::endl;
+  else {
+    ERR(FTL) << "Correlation matrix provided is incorrect: " << corrFile
+             << std::endl;
+    exit(-1);
   }
 
-  // Draw Extra plots
-  if (drawFine) this->GetFineList().at(0)->Write();
-
-  if (fIsMask and drawMask)
-    fMaskHist->Write((fName + "_MSK").c_str());  //< save mask
+  while (std::getline(corr >> std::ws, line, '\n')) {
+    int column = 0;
 
-  if (drawFlux and GetFluxHistogram())
-    GetFluxHistogram()->Write();
-  if (drawXSec and GetXSecHistogram())
-    GetXSecHistogram()->Write();
-  if (drawEvents and GetEventHistogram())
-    GetEventHistogram()->Write();
+    // Loop over entries and insert them into matrix
+    // Multiply by the errors to get the covariance, rather than the correlation
+    // matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      double val = (*iter) * this->fDataHist->GetBinError(row + 1) * 1E38 *
+                   this->fDataHist->GetBinError(column + 1) * 1E38;
+      if (val == 0) {
+        ERR(FTL) << "Found a zero value in the covariance matrix, assuming "
+                 "this is an error!"
+                 << std::endl;
+        exit(-1);
+      }
 
-  if (fIsMask and drawMask and fMaskHist) {
-    fMaskHist->Write((fName + "_MSK").c_str());  //< save mask
-  }
+      (*this->covar)(row, column) = val;
+      (*this->fFullCovar)(row, column) = val;
 
-  // Save neut stack
-  if (drawModes) {
-    //    LOG(SAM) << "Writing MC Hist PDG" << std::endl;
-    THStack combo_fMCHist_PDG = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_PDG").c_str(), (TH1**)fMCHist_PDG, 0);
-    combo_fMCHist_PDG.Write();
-  }
+      column++;
+    }
 
-  if (fIsMask && drawMask && fMaskHist) {
-    fMaskHist->Write((this->fName + "_MSK").c_str());  //< save mask
+    row++;
   }
 
-  // Save Matrix plots
-  if (!fIsRawEvents && !fIsDiag && fFullCovar) {
-    if (drawCov && fFullCovar) {
-      TH2D cov = TH2D((*this->fFullCovar));
-      cov.SetNameTitle((this->fName + "_cov").c_str(),
-                       (this->fName + "_cov;Bins; Bins;").c_str());
-      cov.Write();
-    }
-
-    if (!drawInvCov && !covar) {
-      std::cout << "Missing invert! " << std::endl;
-    }
-    if (drawInvCov && covar) {
-      TH2D covinv = TH2D((*this->covar));
-      covinv.SetNameTitle((fName + "_covinv").c_str(),
-                          (fName + "_covinv;Bins; Bins;").c_str());
-      covinv.Write();
-    }
+  // Robust matrix inversion method
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  delete this->covar;
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
 
-    if (drawDecomp and fDecomp) {
-      TH2D covdec = TH2D((*fDecomp));
-      covdec.SetNameTitle((fName + "_covdec").c_str(),
-                          (fName + "_covdec;Bins; Bins;").c_str());
-      covdec.Write();
-    }
-  }
+  return;
+};
 
-  // Save ratio plots if required
-  if (drawRatio) {
-    // Needed for error bars
-    for (int i = 0; i < fMCHist->GetNbinsX() * fMCHist->GetNbinsY(); i++)
-      fMCHist->SetBinError(i + 1, 0.0);
 
-    fDataHist->GetSumw2();
-    fMCHist->GetSumw2();
 
-    // Create Ratio Histograms
-    TH1D* dataRatio = (TH1D*)fDataHist->Clone((fName + "_data_RATIO").c_str());
-    TH1D* mcRatio = (TH1D*)fMCHist->Clone((fName + "_MC_RATIO").c_str());
 
-    mcRatio->Divide(fMCHist);
-    dataRatio->Divide(fMCHist);
 
-    // Cancel bin errors on MC
-    for (int i = 0; i < mcRatio->GetNbinsX(); i++)
-      mcRatio->SetBinError(
-          i + 1, fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1));
 
-    mcRatio->SetMinimum(0);
-    mcRatio->SetMaximum(2);
-    dataRatio->SetMinimum(0);
-    dataRatio->SetMaximum(2);
+//********************************************************************
+// FullUnits refers to if we have "real" unscaled units in the covariance matrix, e.g. 1E-76.
+// If this is the case we need to scale it so that the chi2 contribution is correct
+// NUISANCE internally assumes the covariance matrix has units of 1E76
+void Measurement1D::SetCovarFromDataFile(std::string covarFile,
+    std::string covName, bool FullUnits) {
+  //********************************************************************
 
-    mcRatio->Write();
-    dataRatio->Write();
+  LOG(SAM) << "Getting covariance from " << covarFile << "->" << covName
+           << std::endl;
 
-    delete mcRatio;
-    delete dataRatio;
+  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
+  TH2D* covPlot = (TH2D*)tempFile->Get(covName.c_str());
+  covPlot->SetDirectory(0);
+  // Scale the covariance matrix if it comes in normal units
+  if (FullUnits) {
+    covPlot->Scale(1.E76);
   }
 
-  // Save Shape Plots if required
-  if (drawShape) {
-    // Create Shape Histogram
-    TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
+  int dim = covPlot->GetNbinsX();
+  fFullCovar = new TMatrixDSym(dim);
 
-    double shapeScale = 1.0;
-    if (fIsRawEvents) {
-      shapeScale = fDataHist->Integral() / fMCHist->Integral();
-    } else {
-      shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
+  for (int i = 0; i < dim; i++) {
+    for (int j = 0; j < dim; j++) {
+      (*fFullCovar)(i, j) = covPlot->GetBinContent(i + 1, j + 1);
     }
+  }
 
-    mcShape->Scale(shapeScale);
+  this->covar = (TMatrixDSym*)fFullCovar->Clone();
+  fDecomp = (TMatrixDSym*)fFullCovar->Clone();
 
-    std::stringstream ss;
-    ss << shapeScale;
-    mcShape->SetTitle(ss.str().c_str());
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
 
-    mcShape->SetLineWidth(3);
-    mcShape->SetLineStyle(7);  // dashes
+  TDecompChol LUChol = TDecompChol(*fDecomp);
+  LUChol.Decompose();
+  fDecomp = new TMatrixDSym(dim, LU.GetU().GetMatrixArray(), "");
 
-    mcShape->Write();
+  return;
+};
 
-    // Save shape ratios
-    if (drawRatio) {
-      // Needed for error bars
-      mcShape->GetSumw2();
+// //********************************************************************
+// void Measurement1D::SetBinMask(std::string maskFile) {
+//   //********************************************************************
 
-      // Create shape ratio histograms
-      TH1D* mcShapeRatio =
-          (TH1D*)mcShape->Clone((fName + "_MC_SHAPE_RATIO").c_str());
-      TH1D* dataShapeRatio =
-          (TH1D*)fDataHist->Clone((fName + "_data_SHAPE_RATIO").c_str());
+//   // Create a mask histogram.
+//   int nbins = fDataHist->GetNbinsX();
+//   fMaskHist =
+//     new TH1I((fName + "_fMaskHist").c_str(),
+//              (fName + "_fMaskHist; Bin; Mask?").c_str(), nbins, 0, nbins);
+//   std::string line;
+//   std::ifstream mask(maskFile.c_str(), ifstream::in);
+
+//   if (mask.is_open())
+//     LOG(SAM) << "Reading bin mask from file: " << maskFile << std::endl;
+//   else
+//     LOG(FTL) << " Cannot find mask file." << std::endl;
+
+//   while (std::getline(mask >> std::ws, line, '\n')) {
+//     std::vector<int> entries = GeneralUtils::ParseToInt(line, " ");
+
+//     // Skip lines with poorly formatted lines
+//     if (entries.size() < 2) {
+//       LOG(WRN) << "Measurement1D::SetBinMask(), couldn't parse line: " << line
+//                << std::endl;
+//       continue;
+//     }
+
+//     // The first index should be the bin number, the second should be the mask
+//     // value.
+//     fMaskHist->SetBinContent(entries[0], entries[1]);
+//   }
 
-      // Divide the histograms
-      mcShapeRatio->Divide(mcShape);
-      dataShapeRatio->Divide(mcShape);
+//   // Set masked data bins to zero
+//   PlotUtils::MaskBins(fDataHist, fMaskHist);
 
-      // Colour the shape ratio plots
-      mcShapeRatio->SetLineWidth(3);
-      mcShapeRatio->SetLineStyle(7);  // dashes
+//   return;
+// }
 
-      mcShapeRatio->Write();
-      dataShapeRatio->Write();
+// //********************************************************************
+// void Measurement1D::GetBinContents(std::vector<double>& cont,
+//                                    std::vector<double>& err) {
+//   //********************************************************************
 
-      delete mcShapeRatio;
-      delete dataShapeRatio;
-    }
+//   // Return a vector of the main bin contents
+//   for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+//     cont.push_back(fMCHist->GetBinContent(i + 1));
+//     err.push_back(fMCHist->GetBinError(i + 1));
+//   }
 
-    delete mcShape;
-  }
+//   return;
+// };
 
-  // Make a pretty PDG Canvas
-  if (drawCanvPDG) {
-    TCanvas* c1 = new TCanvas((fName + "_PDG_CANV").c_str(),
-                              (fName + "_PDG_CANV").c_str(), 800, 600);
 
-    fDataHist->Draw("E1");
-    fMCHist->Draw("HIST SAME");
+/*
+   XSec Functions
+   */
 
-    THStack combo_fMCHist_PDG = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_PDG").c_str(), (TH1**)fMCHist_PDG, 0);
-    combo_fMCHist_PDG.Draw("HIST SAME");
-    TLegend leg =
-        PlotUtils::GenerateStackLegend(combo_fMCHist_PDG, 0.6, 0.6, 0.9, 0.9);
-    fDataHist->Draw("E1 SAME");
+// //********************************************************************
+// void Measurement1D::SetFluxHistogram(std::string fluxFile, int minE, int
+// maxE,
+//     double fluxNorm) {
+//   //********************************************************************
 
-    //    leg.Draw("SAME");
-    c1->Write();
-    delete c1;
-  }
+//   // Note this expects the flux bins to be given in terms of MeV
+//   LOG(SAM) << "Reading flux from file: " << fluxFile << std::endl;
 
-  if (drawCanvMC) {
-    TCanvas* c1 = new TCanvas((fName + "_MC_CANV").c_str(),
-                              (fName + "_MC_CANV").c_str(), 800, 600);
-    c1->cd();
+//   TGraph f(fluxFile.c_str(), "%lg %lg");
 
-    fDataHist->Draw("E1");
-    fMCHist->Draw("SAME HIST");
+//   fFluxHist =
+//     new TH1D((fName + "_flux").c_str(), (fName + "; E_{#nu} (GeV)").c_str(),
+//         f.GetN() - 1, minE, maxE);
 
-    TH1D* mcShape = (TH1D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
-    double shapeScale =
-        fDataHist->Integral("width") / fMCHist->Integral("width");
+//   Double_t* yVal = f.GetY();
 
-    mcShape->Scale(shapeScale);
-    mcShape->SetLineStyle(7);
+//   for (int i = 0; i < fFluxHist->GetNbinsX(); ++i)
+//     fFluxHist->SetBinContent(i + 1, yVal[i] * fluxNorm);
+// };
 
-    mcShape->Draw("SAME HIST");
+// //********************************************************************
+// double Measurement1D::TotalIntegratedFlux(std::string intOpt, double low,
+//     double high) {
+//   //********************************************************************
 
-    TLegend* leg = new TLegend(0.6, 0.6, 0.9, 0.9);
-    leg->AddEntry(fDataHist, (fName + " Data").c_str(), "ep");
-    leg->AddEntry(fMCHist, (fName + " MC").c_str(), "l");
-    leg->AddEntry(mcShape, (fName + " Shape").c_str(), "l");
+//   if (fInput->GetType() == kGiBUU) {
+//     return 1.0;
+//   }
 
-    leg->Draw("SAME");
+//   // The default case of low = -9999.9 and high = -9999.9
+//   if (low == -9999.9) low = this->EnuMin;
+//   if (high == -9999.9) high = this->EnuMax;
 
-    c1->Write();
-    delete c1;
-  }
+//   int minBin = fFluxHist->GetXaxis()->FindBin(low);
+//   int maxBin = fFluxHist->GetXaxis()->FindBin(high);
 
-  if (drawWeighted) {
-    fMCWeighted->Write();
-  }
+//   // Get integral over custom range
+//   double integral = fFluxHist->Integral(minBin, maxBin + 1, intOpt.c_str());
 
-  // Returning
-  LOG(SAM) << "Written Histograms: " << fName << std::endl;
-  return;
-};
+//   return integral;
+// };
 
-// ********************************************
-// Returns the NEUT mode stack
-THStack Measurement1D::GetModeStack() {
-  // ********************************************
-  THStack combo_hist = PlotUtils::GetNeutModeStack((fName + "_MC_PDG").c_str(),
-                                                   (TH1**)fMCHist_PDG, 0);
-  return combo_hist;
-}
diff --git a/src/FitBase/Measurement1D.h b/src/FitBase/Measurement1D.h
index 9e7b8b5..4effc6a 100644
--- a/src/FitBase/Measurement1D.h
+++ b/src/FitBase/Measurement1D.h
@@ -1,269 +1,630 @@
-// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+// Copyright 2016 L. Pickering, P towell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MEASUREMENT_1D_H_SEEN
 #define MEASUREMENT_1D_H_SEEN
 
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
 #include <math.h>
 #include <stdlib.h>
 #include <deque>
 #include <iomanip>
 #include <iostream>
 #include <numeric>
 #include <sstream>
 #include <string>
 
 // ROOT includes
 #include <TArrayF.h>
 #include <TCanvas.h>
 #include <TCut.h>
 #include <TDecompChol.h>
 #include <TDecompSVD.h>
 #include <TGraph.h>
 #include <TGraphErrors.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <TMatrixDSym.h>
 #include <TROOT.h>
 #include <TSystem.h>
 
 // External data fit includes
 #include "FitEvent.h"
 #include "FitParameters.h"
 #include "FitUtils.h"
 #include "MeasurementBase.h"
 #include "PlotUtils.h"
 #include "StatUtils.h"
 
-#include "InputHandler.h"
 #include "SignalDef.h"
+#include "MeasurementVariableBox.h"
+#include "MeasurementVariableBox1D.h"
+
+namespace NUISANCE {
+namespace FitBase {
+
+}
+}
 
 //********************************************************************
-//! 1D Measurement base class. Histogram handling is done in this base layer.
+/// 1D Measurement base class. Histogram handling is done in this base layer.
 class Measurement1D : public MeasurementBase {
-  //********************************************************************
+//********************************************************************
 
- public:
+public:
   /*
     Constructor/Deconstuctor
   */
-
-  //! Default Constructor
   Measurement1D(void);
-
-  //! Default destructor
   virtual ~Measurement1D(void);
 
-  //! Initialise values to NULL
-  void Init(void);
-
-  //! Setup the measurement with input values. This automatically handles
-  //! parsing the fit type and data.
-  virtual void SetupMeasurement(std::string input, std::string type,
-                                FitWeight* rw, std::string fkdt);
-
-  //! Setup the default MC histograms from the currently set fDataHist.
-  virtual void SetupDefaultHist(void);
+  /*
+    Setup Functions
+  */
 
-  //! Set fit options by parsing type
+  /// \brief Setup all configs once initialised
+  ///
+  /// Should be called after all configs have been setup inside fSettings container.
+  /// Handles the processing of inputs and setting up of types.
+  /// Replaces the old 'SetupMeasurement' function.
+  void FinaliseSampleSettings();
+
+  /// \brief Creates the 1D data distribution given the binning provided.
+  virtual void CreateDataHistogram(int dimx, double* binx);
+
+  /// \brief Read 1D data inputs from a text file.
+  ///
+  /// Inputfile should have the format: \n
+  /// low_binedge_1    bin_content_1  bin_error_1 \n
+  /// low_binedge_2    bin_content_2  bin_error_2 \n
+  /// ....             ....           ....        \n
+  /// high_bin_edge_N  0.0            0.0
+  virtual void SetDataFromTextFile(std::string datafile);
+
+  /// \brief Read 1D data inputs from a root file.
+  ///
+  /// inhistfile specifies the path to the root file
+  /// histname specifies the name of the histogram.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ';' so that: \n
+  /// 'myhistfile.root;myhistname' \n
+  /// will also work.
+  virtual void SetDataFromRootFile(std::string inhistfile, std::string histname = "");
+
+
+  /// \brief Setup a default empty data histogram
+  ///
+  /// Only used for flattree creators.
+  virtual void SetEmptyData();
+
+  /// \brief Set data bin errors to sqrt(entries)
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Sets the data errors as the sqrt of the bin contents
+  /// Should be use for counting experiments
+  virtual void SetPoissonErrors();
+
+  /// \brief Make diagonal covariance from data
+  ///
+  /// \warning If no histogram passed, data must be setup first!
+  /// Setup the covariance inputs by taking the data histogram
+  /// errors and setting up a diagonal covariance matrix.
+  ///
+  /// If no data is supplied, fDataHist is used if already set.
+  virtual void SetCovarFromDiagonal(TH1D* data = NULL);
+
+  /// \brief Read the data covariance from a text file.
+  ///
+  /// Inputfile should have the format: \n
+  /// covariance_11  covariance_12  covariance_13 ... \n
+  /// covariance_21  covariance_22  covariance_23 ... \n
+  /// ...            ...            ...           ... \n
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data covariance from a ROOT file.
+  ///
+  /// - covfile specifies the full path to the file
+  /// - histname specifies the name of the covariance object. Both TMatrixDSym and TH2D are supported.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarFromRootFile(std::string covfile, std::string histname="");
+
+  /// \brief Read the inverted data covariance from a text file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarInvertFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the inverted data covariance from a ROOT file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarInvertFromRootFile(std::string covfile, std::string histname="");
+
+  /// \brief Read the data correlations from a text file.
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCorrelationFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data correlations from a ROOT file.
+  ///
+  /// \warning REQUIRES DATA TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCorrelationFromRootFile(std::string covfile, std::string histname="");
+
+
+  /// \brief Read the cholesky decomposed covariance from a text file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCholDecompFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the cholesky decomposed covariance from a ROOT file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCholDecompFromRootFile(std::string covfile, std::string histname="");
+
+
+  /// \brief Scale the data by some scale factor
+  virtual void ScaleData(double scale);
+
+
+  /// \brief Scale the data error bars by some scale factor
+  virtual void ScaleDataErrors(double scale);
+
+
+  /// \brief Scale the covariaince and its invert/decomp by some scale factor.
+  virtual void ScaleCovar(double scale);
+
+
+
+  /// \brief Setup a bin masking histogram and apply masking to data
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Reads in a list of bins in a text file to be masked. Format is: \n
+  /// bin_index_1  1 \n
+  /// bin_index_2  1 \n
+  /// bin_index_3  1 \n
+  ///
+  /// If 0 is given then a bin entry will NOT be masked. So for example: \n\n
+  /// 1  1 \n
+  /// 2  1 \n
+  /// 3  0 \n
+  /// 4  1 \n\n
+  /// Will mask only the 1st, 2nd, and 4th bins.
+  ///
+  /// Masking can be turned on by specifiying the MASK option when creating a sample.
+  /// When this is passed NUISANCE will look in the following locations for the mask file:
+  /// - FitPar::Config().GetParS(fName + ".mask")
+  /// - "data/masks/" + fName + ".mask";
+  virtual void SetBinMask(std::string maskfile);
+
+  
+  /// \brief Set the current fit options from a string.
+  ///
+  /// This is called twice for each sample, once to set the default
+  /// and once to set the current setting (if anything other than default given)
+  ///
+  /// For this to work properly it requires the default and allowed types to be
+  /// set correctly. These should be specified as a string listing options.
+  ///
+  /// To split up options so that NUISANCE can automatically detect ones that
+  /// are conflicting. Any options seperated with the '/' symbol are non conflicting
+  /// and can be given together, whereas any seperated with the ',' symbol cannot
+  /// be specified by the end user at the same time.
+  ///
+  /// Default Type Examples:
+  /// - DIAG/FIX = Default option will be a diagonal covariance, with FIXED norm.
+  /// - MASK/SHAPE = Default option will be a masked hist, with SHAPE always on.
+  ///
+  /// Allowed Type examples:
+  /// - 'FULL/DIAG/NORM/MASK' = Any of these options can be specified.
+  /// - 'FULL,FREE,SHAPE/MASK/NORM' = User can give either FULL, FREE, or SHAPE as on option.
+  /// MASK and NORM can also be included as options.
   virtual void SetFitOptions(std::string opt);
 
-  //! Setup the data values from a text file
-  virtual void SetDataValues(std::string dataFile);
 
-  //! Setup the data values by reading in a histogram from a TFile
-  virtual void SetDataFromFile(std::string inhistfile, std::string histname);
-
-  //! Setup the data by reading in a histogram from the database.
-  virtual void SetDataFromDatabase(std::string inhistfile,
-                                   std::string histname);
+  /// \brief Final constructor setup
+  /// \warning Should be called right at the end of the constructor.
+  ///
+  /// Contains a series of checks to ensure the data and inputs have been setup.
+  /// Also creates the MC histograms needed for fitting.
+  void FinaliseMeasurement();
 
-  //! Read the covariance matrix from a root file (automatically grabs plot
-  //! "covar")
-  virtual void SetCovarMatrix(std::string covarFile);
 
-  //! Read the correlation matrix from a text file given the covar size and
-  //! convert to covariance matrix
-  virtual void SetCovarMatrixFromText(std::string covarFile, int dim,
-                                      double scale = 1.0);
-  //
-  //! Read the covariance matrix from a text file given the covar size
-  virtual void SetCovarMatrixFromCorrText(std::string covarFile, int dim);
 
-  //! Set the covariance from a custom root file
-  //! FullUnits refers to if the covariance has "real" unscaled units, e.g.
-  //! 1E-76
-  //! If that is the case we need to scale it to make sure the extracted chi2 is
-  //! correct
-  virtual void SetCovarFromDataFile(std::string covarFile, std::string covName,
-                                    bool FullUnits = false);
 
-  //! Set the smearing matrix from a text file given the size of the matrix
+  /*
+    Smearing
+  */
+  /// \brief Read in smearing matrix from file
+  ///
+  /// Set the smearing matrix from a text file given the size of the matrix
   virtual void SetSmearingMatrix(std::string smearfile, int truedim,
                                  int recodim);
 
-  //! Set the bin mask from a text file
-  virtual void SetBinMask(std::string maskFile);
+  /// \brief Apply smearing to MC true to get MC reco
+  ///
+  /// Apply smearing matrix to fMCHist using fSmearingMatrix
+  virtual void ApplySmearingMatrix(void);
+
 
-  // //! Set the flux histogram from a ROOT file
-  // virtual void SetFluxHistogram(std::string fluxFile, int minE, int maxE,
-  //                               double fluxNorm);
 
-  // //! Get the total integrated flux between this samples energy range
-  // virtual double TotalIntegratedFlux(std::string intOpt = "width",
-  //                                    double low = -9999.9,
-  //                                    double high = -9999.9);
+  /*
+    Reconfigure Functions
+  */
 
-  //! Reset histograms to zero
+  /// \brief Create a Measurement1D box
+  ///
+  /// Creates a new 1D variable box containing just fXVar.
+  ///
+  /// This box is the bare minimum required by the JointFCN when
+  /// running fast reconfigures during a routine.
+  /// If for some reason a sample needs extra variables to be saved then
+  /// it should override this function creating its own MeasurementVariableBox
+  /// that contains the extra variables.
+  virtual MeasurementVariableBox* CreateBox() {return new MeasurementVariableBox1D();};
+
+  /// \brief Reset all MC histograms
+  ///
+  /// Resets all standard histograms and those registered to auto
+  /// process to zero.
+  ///
+  /// If extra histograms are not included in auto processing, then they must be reset
+  /// by overriding this function and doing it manually if required.
   virtual void ResetAll(void);
 
-  //! Fill histograms using fXVar,Weight
+  /// \brief Fill MC Histograms from XVar
+  ///
+  /// Fill standard histograms using fXVar, Weight read from the variable box.
+  ///
+  /// WARNING : Any extra MC histograms need to be filled by overriding this function,
+  /// even if they have been set to auto process.
   virtual void FillHistograms(void);
 
-  //! Scale to XSec Prediction
+  // \brief Convert event rates to final histogram
+  ///
+  /// Apply standard scaling procedure to standard mc histograms to convert from
+  /// raw events to xsec prediction.
+  ///
+  /// If any distributions have been set to auto process
+  /// that is done during this function call, and a differential xsec is assumed.
+  /// If that is not the case this function must be overriden.
   virtual void ScaleEvents(void);
 
-  //! Apply normalisation scale after reconfigure
+  /// \brief Scale MC by a factor=1/norm
+  ///
+  /// Apply a simple normalisation scaling if the option FREE or a norm_parameter
+  /// has been specified in the NUISANCE routine.
   virtual void ApplyNormScale(double norm);
 
-  //! Apply smearing matrix to fMCHist
-  virtual void ApplySmearingMatrix(void);
 
-  //! Get the current Number of degrees of freedom accounting for bin masking.
+  /*
+    Statistical Functions
+  */
+
+  /// \brief Get Number of degrees of freedom
+  ///
+  /// Returns the number bins inside the data histogram accounting for
+  /// any bin masking applied.
   virtual int GetNDOF(void);
 
-  //! Get Likelihood of iteration
+  /// \brief Return Data/MC Likelihood at current state
+  ///
+  /// Returns the likelihood of the data given the current MC prediction.
+  /// Diferent likelihoods definitions are used depending on the FitOptions.
   virtual double GetLikelihood(void);
 
-  //! Set the fake data values from either a file, or MC using fakeOption="MC"
+
+  /*
+    Fake Data
+  */
+
+  /// \brief Set the fake data values from either a file, or MC
+  ///
+  /// - Setting from a file "path": \n
+  /// When reading from a file the full path must be given to a standard
+  /// nuisance output. The standard MC histogram should have a name that matches
+  /// this sample for it to be read in.
+  /// \n\n
+  /// - Setting from "MC": \n
+  /// If the MC option is given the current MC prediction is used as fake data.
   virtual void SetFakeDataValues(std::string fakeOption);
 
-  //! Reset the fake data back to original fake data (Reset to before
-  //! ThrowCovariance was called)
+  /// \brief Reset fake data back to starting fake data
+  ///
+  /// Reset the fake data back to original fake data (Reset back to before
+  /// ThrowCovariance was first called)
   virtual void ResetFakeData(void);
 
-  //! Reset the fake data back to the true original dataset for this sample
+  /// \brief Reset fake data back to original data
+  ///
+  /// Reset the data histogram back to the true original dataset for this sample
+  /// before any fake data was defined.
   virtual void ResetData(void);
 
-  //! Generate fake data by throwing the current fDataHist using the covariance.
-  //! Can be used on fake MC data or just the original dataset.
+  /// \brief Generate fake data by throwing the covariance.
+  ///
+  /// Can be used on fake MC data or just the original dataset.
+  /// Call ResetFakeData or ResetData to return to values before the throw.
   virtual void ThrowCovariance(void);
 
-  // Get MC Histogram Stack
-  virtual THStack GetModeStack(void);
-
-  /// Get Histogram Functions
-  inline TH1D* GetMCHistogram(void) { return fMCHist; };
-  inline TH1D* GetDataHistogram(void) { return fDataHist; };
 
-  virtual std::vector<TH1*> GetMCList(void);
-  virtual std::vector<TH1*> GetDataList(void);
+  /*
+    Access Functions
+  */
 
+  /// \brief Returns nicely formatted MC Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - linecolor
+  /// - linestyle
+  /// - linewidth
+  /// - fillcolor
+  /// - fillstyle
+  ///
+  /// So to have a sample line colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// linecolor="2" linestyle="7"  linewidth="2" />
+  virtual TH1D* GetMCHistogram(void);
+
+  /// \brief Returns nicely formatted data Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - datacolor
+  /// - datastyle
+  /// - datawidth
+  ///
+  /// So to have a sample data colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// datacolor="2" datastyle="7"  datawidth="2" />
+  virtual TH1D* GetDataHistogram(void);
+
+  /// \brief Returns a list of all MC histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetMCList(void) {
+    return std::vector<TH1*>(1, GetMCHistogram());
+  }
+
+  /// \brief Returns a list of all Data histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetDataList(void) {
+    return std::vector<TH1*>(1, GetDataHistogram());
+  }
+
+  /// \brief Returns a list of all Mask histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
   inline virtual std::vector<TH1*> GetMaskList(void) {
     return std::vector<TH1*>(1, fMaskHist);
   };
 
+  /// \brief Returns a list of all Fine histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
   inline virtual std::vector<TH1*> GetFineList(void) {
     return std::vector<TH1*>(1, fMCFine);
   };
 
-  //! Get the bin contents and errors from fMCHist
-  virtual void GetBinContents(std::vector<double>& cont,
-                              std::vector<double>& err);
 
-  //! Get the covariance matrix as a pretty plot
-  inline virtual TH2D GetCovarMatrix(void) { return TH2D(*covar); };
+  /*
+    Write Functions
+  */
+  /// \brief Save the current state to the current TFile directory \n
+  ///
+  /// Data/MC are both saved by default.
+  /// A range of other histograms can be saved by setting the
+  /// config option 'drawopts'.
+  ///
+  /// Possible options: \n
+  /// - FINE    = Write Fine Histogram \n
+  /// - WEIGHTS = Write Weighted MC Histogram (before scaling) \n
+  /// - FLUX    = Write Flux Histogram from MC Input \n
+  /// - EVT     = Write Event Histogram from MC Input \n
+  /// - XSEC    = Write XSec Histogram from MC Input \n
+  /// - MASK    = Write Mask Histogram \n
+  /// - COV     = Write Covariance Histogram \n
+  /// - INVCOV  = Write Inverted Covariance Histogram \n
+  /// - DECMOP  = Write Decomp. Covariance Histogram \n
+  /// - RESIDUAL= Write Resudial Histograms \n
+  /// - RATIO   = Write Data/MC Ratio Histograms \n
+  /// - SHAPE   = Write MC Shape Histograms norm. to Data \n
+  /// - CANVMC  = Build MC Canvas Showing Data, MC, Shape \n
+  /// - MODES   = Write PDG Stack \n
+  /// - CANVPDG = Build MC Canvas Showing Data, PDGStack \n
+  ///
+  /// So to save a range of these in parameters/config.xml set: \n
+  /// <config drawopts='FINE/COV/SHAPE/RATIO' />
+  virtual void Write(std::string drawOpt);
+
+
 
-  //! Return the integrated XSec for this sample, options define whether data or
-  //! MC is returned.
-  virtual std::vector<double> GetXSec(std::string opt);
+  virtual void WriteRatioPlot();
 
-  //! Save the current state to the current TFile directory
-  virtual void Write(std::string drawOpt);
 
-  //! array of histograms to handle fMCHist for each interaction channel.
-  // TODO (P.Stowell) Figure out why I put mcHist as unprotected! :S
-  TH1D* fMCHist_PDG[61];
-
- protected:
-  // data histograms
-  TH1D* fDataHist;  //!< default data histogram
-  TH1D* fDataOrig;  //!< histogram to store original data before throws.
-  TH1D* fDataTrue;  //!< histogram to store true dataset
-
-  // Fake Data Flag
-  bool
-      fIsFakeData;  //!< Flag: whether the current data is actually fake from MC
-  std::string fakeDataFile;  //!< Input fake data file
-
-  // The histogram into which the measurement will be filled
-  TH1D* fMCHist;  //!< default MC Histogram used in the chi2 fits
-  TH1D* fMCFine;  //!< finely binned MC histogram
-  TH1D* fMCStat;  //!< histogram with unweighted events to properly calculate
-                  //! statistical error on MC
-  TH1D* fMCWeighted;  //!< Weighted histogram before xsec scaling
-
-  TH1I* fMaskHist;  //!< Mask histogram for neglecting specific bins
-
-  std::string fPlotTitles;  //!< Plot title x and y for the histograms
-
-  // The covariance matrix and its fDecomposition
-  TMatrixDSym* covar;       //!< Inverted Covariance
-  TMatrixDSym* fFullCovar;  //!< Full Covariance
-  TMatrixDSym* fDecomp;     //!< Decomposed Covariance
-  TMatrixDSym* fCorrel;     //!< Correlation Matrix
-  TMatrixD* fSmearMatrix;   //!< Smearing matrix (note, this is not symmetric,
-                            //! and also in general not square)
-  double fCovDet;           //!< Determinant of the covariance
-  double fNormError;        //!< Sample norm error
-  std::string fFitType;
 
-  // Arrays for data entries
-  Double_t* fXBins;       //!< xBin edges
-  Double_t* fDataValues;  //!< data bin contents
-  Double_t* fDataErrors;  //!< data bin errors
-  Int_t fNDataPointsX;    //!< number of data points
+
+  virtual void WriteShapePlot();
+  virtual void WriteShapeRatioPlot();
+
+
+
+
+  //*
+  // OLD DEFUNCTIONS
+  //
+
+  /// OLD FUNCTION
+  virtual void SetupMeasurement(std::string input, std::string type,
+                                FitWeight* rw, std::string fkdt);
+
+  /// OLD FUNCTION
+  virtual void SetupDefaultHist(void);
+
+  /// OLD FUNCTION
+  virtual void SetDataValues(std::string dataFile);
+
+  /// OLD FUNCTION
+  virtual void SetDataFromFile(std::string inhistfile, std::string histname);
+  /// OLD FUNCTION
+  virtual void SetDataFromDatabase(std::string inhistfile,
+                                   std::string histname);
+
+  /// OLD FUNCTION
+  virtual void SetCovarMatrix(std::string covarFile);
+  /// OLD FUNCTION
+  virtual void SetCovarMatrixFromText(std::string covarFile, int dim,
+                                      double scale = 1.0);
+  /// OLD FUNCTION
+  virtual void SetCovarMatrixFromCorrText(std::string covarFile, int dim);
+
+
+  /// OLD FUNCTION
+  virtual void SetCovarFromDataFile(std::string covarFile, std::string covName,
+                                    bool FullUnits = false);
+
+
+  /// OLD FUNCTION
+  // virtual THStack GetModeStack(void);
+
+protected:
+
+  // Data
+  TH1D* fDataHist;  ///< default data histogram
+  TH1D* fDataOrig;  ///< histogram to store original data before throws.
+  TH1D* fDataTrue;  ///< histogram to store true dataset
+  std::string fPlotTitles;  ///< Plot title x and y for the histograms
+
+
+  // MC
+  TH1D* fMCHist;     ///< default MC Histogram used in the chi2 fits
+  TH1D* fMCFine;     ///< finely binned MC histogram
+  TH1D* fMCStat;     ///< histogram with unweighted events to properly calculate
+  TH1D* fMCWeighted; ///< Weighted histogram before xsec scaling
+
+  TH1I* fMaskHist;   ///< Mask histogram for neglecting specific bins
+  TMatrixD* fSmearMatrix;   ///< Smearing matrix (note, this is not symmetric)
+
+  TrueModeStack* fMCHist_Modes; ///< Optional True Mode Stack
+
+
+  // Statistical
+  TMatrixDSym* covar;       ///< Inverted Covariance
+  TMatrixDSym* fFullCovar;  ///< Full Covariance
+  TMatrixDSym* fDecomp;     ///< Decomposed Covariance
+  TMatrixDSym* fCorrel;     ///< Correlation Matrix
+
+  TMatrixDSym* fCovar;    ///< New FullCovar
+  TMatrixDSym* fInvert;   ///< New covar
+
+  double fNormError;        ///< Sample norm error
+
+
+  // Fake Data
+  bool fIsFakeData;            ///< Flag: is the current data fake from MC
+  std::string fFakeDataInput;  ///< Input fake data file path
+  TFile* fFakeDataFile;        ///< Input fake data file
+
 
   // Fit specific flags
-  bool fIsShape;      //!< Flag: Perform Shape-only fit
-  bool fIsFree;       //!< Flag: Perform normalisation free fit
-  bool fIsDiag;       //!< Flag: only include uncorrelated diagonal errors
-  bool fIsMask;       //!< Flag: Apply bin masking
-  bool fIsRawEvents;  //!< Flag: Are bin contents just event rates
-  bool fIsEnu1D;      //!< Flag: Perform Flux Unfolded Scaling
-  bool fIsChi2SVD;    //!< Flag: Use alternative Chi2 SVD Method (Do not use)
-  bool fAddNormPen;   //!< Flag: Add a normalisation penalty term to the chi2.
-  bool fIsFix;        //!< Flag for keeping norm fixed
-  bool fIsFull;       //!< Flag for using full covariaince
-  bool fIsDifXSec;    //!< Flag for creating a dif xsec
-  bool fIsChi2;       //!< Flag for using Chi2 over LL methods
-
-  std::string fAllowedTypes;  //!< Fit Types Possible
-  std::string fDefaultTypes;  //!< Starting Default Fit Types
-
-  size_t NSignal;
+  std::string fFitType;       ///< Current fit type
+  std::string fAllowedTypes;  ///< Fit Types Possible
+  std::string fDefaultTypes;  ///< Starting Default Fit Types
+
+  bool fIsShape;      ///< Flag : Perform Shape-only fit
+  bool fIsFree;       ///< Flag : Perform normalisation free fit
+  bool fIsDiag;       ///< Flag : only include uncorrelated diagonal errors
+  bool fIsMask;       ///< Flag : Apply bin masking
+  bool fIsRawEvents;  ///< Flag : Are bin contents just event rates
+  bool fIsEnu1D;      ///< Flag : Perform Flux Unfolded Scaling
+  bool fIsChi2SVD;    ///< Flag : Use alternative Chi2 SVD Method (Do not use)
+  bool fAddNormPen;   ///< Flag : Add a normalisation penalty term to the chi2.
+  bool fIsFix;        ///< Flag : keeping norm fixed
+  bool fIsFull;       ///< Flag : using full covariaince
+  bool fIsDifXSec;    ///< Flag : creating a dif xsec
+  bool fIsChi2;       ///< Flag : using Chi2 over LL methods
+  bool fIsSmeared;    ///< Flag : Apply smearing?
+
+
+
+
+  /// OLD STUFF TO REMOVE
+  TH1D* fMCHist_PDG[61]; ///< REMOVE OLD MC PDG Plot
+
+  // Arrays for data entries
+  Double_t* fXBins;       ///< REMOVE xBin edges
+  Double_t* fDataValues;  ///< REMOVE data bin contents
+  Double_t* fDataErrors;  ///< REMOVE data bin errors
+  Int_t fNDataPointsX;    ///< REMOVE number of data points
+
 };
 
 /*! @} */
 #endif
diff --git a/src/FitBase/Measurement2D.cxx b/src/FitBase/Measurement2D.cxx
index 4d349b4..b2640c5 100644
--- a/src/FitBase/Measurement2D.cxx
+++ b/src/FitBase/Measurement2D.cxx
@@ -1,1332 +1,1937 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "Measurement2D.h"
 #include "TDecompChol.h"
 
+
+//********************************************************************
+Measurement2D::Measurement2D(void) {
 //********************************************************************
-Measurement2D::Measurement2D() {
-  //********************************************************************
 
   covar = NULL;
   fDecomp = NULL;
   fFullCovar = NULL;
 
   fMCHist = NULL;
   fMCFine = NULL;
   fDataHist = NULL;
 
   fMCHist_X = NULL;
   fMCHist_Y = NULL;
   fDataHist_X = NULL;
   fDataHist_Y = NULL;
 
   fMaskHist = NULL;
   fMapHist = NULL;
   fDataOrig = NULL;
   fDataTrue = NULL;
   fMCWeighted = NULL;
 
   fDefaultTypes = "FIX/FULL/CHI2";
   fAllowedTypes =
-      "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/FITPROJX/"
-      "FITPROJY";
+    "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/FITPROJX/"
+    "FITPROJY";
 
   fIsFix = false;
   fIsShape = false;
   fIsFree = false;
 
   fIsDiag = false;
   fIsFull = false;
 
   fAddNormPen = false;
   fIsMask = false;
   fIsChi2SVD = false;
 
   fIsRawEvents = false;
   fIsDifXSec = false;
   fIsEnu = false;
-};
+
+
+  // XSec Scalings
+  fScaleFactor = -1.0;
+  fCurrentNorm = 1.0;
+
+  // Histograms
+  fDataHist = NULL;
+  fDataTrue = NULL;
+
+  fMCHist = NULL;
+  fMCFine = NULL;
+  fMCWeighted = NULL;
+
+  fMaskHist = NULL;
+
+  // Covar
+  covar = NULL;
+  fFullCovar = NULL;
+
+  fCovar  = NULL;
+  fInvert = NULL;
+  fDecomp = NULL;
+
+  // Fake Data
+  fFakeDataInput = "";
+  fFakeDataFile  = NULL;
+
+  // Options
+  fDefaultTypes = "FIX/FULL/CHI2";
+  fAllowedTypes =
+    "FIX,FREE,SHAPE/FULL,DIAG/CHI2/NORM/ENUCORR/Q2CORR/ENU1D/MASK";
+
+  fIsFix = false;
+  fIsShape = false;
+  fIsFree = false;
+  fIsDiag = false;
+  fIsFull = false;
+  fAddNormPen = false;
+  fIsMask = false;
+  fIsChi2SVD = false;
+  fIsRawEvents = false;
+  fIsDifXSec = false;
+  fIsEnu1D = false;
+
+  // Inputs
+  fInput = NULL;
+  fRW = NULL;
+
+  // Extra Histograms
+  fMCHist_Modes = NULL;
+
+}
 
 //********************************************************************
-Measurement2D::~Measurement2D(){
-    //********************************************************************
-};
+Measurement2D::~Measurement2D(void) {
+//********************************************************************
+
+  if (fDataHist)   delete fDataHist;
+  if (fDataTrue)   delete fDataTrue;
+  if (fMCHist)     delete fMCHist;
+  if (fMCFine)     delete fMCFine;
+  if (fMCWeighted) delete fMCWeighted;
+  if (fMaskHist)   delete fMaskHist;
+  if (covar)       delete covar;
+  if (fFullCovar)  delete fFullCovar;
+  if (fCovar)      delete fCovar;
+  if (fInvert)     delete fInvert;
+  if (fDecomp)     delete fDecomp;
+
+}
 
-/*
-  Setup Functions
-*/
 //********************************************************************
-void Measurement2D::SetupMeasurement(std::string inputfile, std::string type,
-                                     FitWeight* rw, std::string fkdt) {
-  //********************************************************************
+void Measurement2D::FinaliseSampleSettings() {
+//********************************************************************
 
-  // Check if name contains Evt, indicating that it is a raw number of events
-  // measurements and should thus be treated as once
-  fIsRawEvents = false;
-  if ((fName.find("Evt") != std::string::npos) && fIsRawEvents == false) {
+  MeasurementBase::FinaliseSampleSettings();
+
+  // Setup naming + renaming
+  fName = fSettings.GetName();
+  fSettings.SetS("originalname", fName);
+  if (fSettings.Has("rename")) {
+    fName = fSettings.GetS("rename");
+    fSettings.SetS("name", fName);
+  }
+
+  // Setup all other options
+  LOG(SAM) << "Finalising Sample Settings: " << fName << std::endl;
+
+  if ((fSettings.GetS("originalname").find("Evt") != std::string::npos)) {
     fIsRawEvents = true;
-    LOG(SAM) << "Found event rate measurement but fIsRawEvents == false!"
-             << std::endl;
-    LOG(SAM) << "Overriding this and setting fIsRawEvents == true!"
+    LOG(SAM) << "Found event rate measurement but using poisson likelihoods."
              << std::endl;
   }
 
-  fIsEnu = false;
-  if ((fName.find("XSec") != std::string::npos) &&
-      (fName.find("Enu") != std::string::npos)) {
-    fIsEnu = true;
+  if (fSettings.GetS("originalname").find("XSec_1DEnu") != std::string::npos) {
+    fIsEnu1D = true;
     LOG(SAM) << "::" << fName << "::" << std::endl;
     LOG(SAM) << "Found XSec Enu measurement, applying flux integrated scaling, "
-                "not flux averaged!"
-             << std::endl;
-    if (FitPar::Config().GetParB("EventManager")) {
-      ERR(FTL) << "Enu Measurements do not yet work with the Event Manager!"
-               << std::endl;
-      ERR(FTL) << "If you want decent flux unfolded results please run in "
-                  "series mode (-q EventManager=0)"
-               << std::endl;
-      sleep(2);
-    }
+             << "not flux averaged!" << std::endl;
   }
 
-  if (fIsEnu && fIsRawEvents) {
+  if (fIsEnu1D && fIsRawEvents) {
     LOG(SAM) << "Found 1D Enu XSec distribution AND fIsRawEvents, is this "
-                "really correct?!"
+             "really correct?!"
              << std::endl;
     LOG(SAM) << "Check experiment constructor for " << fName
              << " and correct this!" << std::endl;
     LOG(SAM) << "I live in " << __FILE__ << ":" << __LINE__ << std::endl;
     exit(-1);
   }
 
-  // Reset everything to NULL
-  fRW = rw;
+  if (!fRW) fRW = FitBase::GetRW();
+  if (!fInput) SetupInputs(fSettings.GetS("input"));
 
-  // Setting up 2D Inputs
-  this->SetupInputs(inputfile);
+  // Setup options
+  SetFitOptions(fDefaultTypes); // defaults
+  SetFitOptions(fSettings.GetS("type")); // user specified
 
-  // Set Default Options
-  SetFitOptions(fDefaultTypes);
+  EnuMin = GeneralUtils::StrToDbl(fSettings.GetS("enu_min"));
+  EnuMax = GeneralUtils::StrToDbl(fSettings.GetS("enu_max"));
+
+  if (fAddNormPen) {
+    if (fNormError <= 0.0) {
+      ERR(WRN) << "Norm error for class " << fName << " is 0.0!" << std::endl;
+      ERR(WRN) << "If you want to use it please add fNormError=VAL" << std::endl;
+      throw;
+    }
+  }
 
-  // Set Passed Options
-  SetFitOptions(type);
 }
 
-//********************************************************************
-void Measurement2D::SetupDefaultHist() {
-  //********************************************************************
+void Measurement2D::CreateDataHistogram(int dimx, double* binx, int dimy, double* biny) {
+  if (fDataHist) delete fDataHist;
 
-  // Setup fMCHist
-  fMCHist = (TH2D*)fDataHist->Clone();
-  fMCHist->SetNameTitle((fName + "_MC").c_str(),
-                        (fName + "_MC" + fPlotTitles).c_str());
+  LOG(SAM) << "Creating Data Histogram dim : " << dimx << " " << dimy << std::endl;
 
-  // Setup fMCFine
-  Int_t nBinsX = fMCHist->GetNbinsX();
-  Int_t nBinsY = fMCHist->GetNbinsY();
-  fMCFine = new TH2D((fName + "_MC_FINE").c_str(),
-                     (fName + "_MC_FINE" + fPlotTitles).c_str(), nBinsX * 3,
-                     fMCHist->GetXaxis()->GetBinLowEdge(1),
-                     fMCHist->GetXaxis()->GetBinLowEdge(nBinsX + 1), nBinsY * 3,
-                     fMCHist->GetYaxis()->GetBinLowEdge(1),
-                     fMCHist->GetYaxis()->GetBinLowEdge(nBinsY + 1));
+  fDataHist = new TH2D( (fSettings.GetName() + "_data").c_str(), (fSettings.GetFullTitles()).c_str(),
+                        dimx - 1, binx, dimy - 1, biny );
 
-  // Setup the NEUT Mode Array
-  PlotUtils::CreateNeutModeArray(fMCHist, (TH1**)fMCHist_PDG);
+}
 
-  // Setup bin masks using sample name
-  if (fIsMask) {
-    std::string maskloc = FitPar::Config().GetParDIR(fName + ".mask");
-    if (maskloc.empty()) {
-      maskloc = FitPar::GetDataBase() + "/masks/" + fName + ".mask";
+void Measurement2D::SetDataFromTextFile(std::string datfile) {
+  // fDataHist = PlotUtils::GetTH2DFromTextFile(datfile,"");
+}
+
+void Measurement2D::SetDataFromRootFile(std::string datfile, std::string histname) {
+  fDataHist = PlotUtils::GetTH2DFromRootFile(datfile, histname);
+}
+
+void Measurement2D::SetDataValuesFromTextFile(std::string datfile, TH2D* hist) {
+
+  LOG(SAM) << "Setting data values from text file" << std::endl;
+  if (!hist) hist = fDataHist;
+
+  // Read TH2D From textfile
+  TH2D* valhist = (TH2D*) hist->Clone();
+  valhist->Reset();
+  PlotUtils::Set2DHistFromText(datfile, valhist, 1.0, true);
+
+ LOG(SAM) << " -> Filling values from read hist." << std::endl;
+  for (int i = 0; i < valhist->GetNbinsX(); i++) {
+    for (int j = 0; j < valhist->GetNbinsY(); j++) {
+      hist->SetBinContent(i + 1, j + 1, valhist->GetBinContent(i + 1, j + 1));
     }
+  }
+  LOG(SAM) << " --> Done" << std::endl;
+}
 
-    SetBinMask(maskloc);
+void Measurement2D::SetDataErrorsFromTextFile(std::string datfile, TH2D* hist) {
+  LOG(SAM) << "Setting data errors from text file" << std::endl;
+
+  if (!hist) hist = fDataHist;
+
+  // Read TH2D From textfile
+  TH2D* valhist = (TH2D*) hist->Clone();
+  valhist->Reset();
+  PlotUtils::Set2DHistFromText(datfile, valhist, 1.0);
+
+  // Fill Errors
+ LOG(SAM) << " -> Filling errors from read hist." << std::endl;
+
+  for (int i = 0; i < valhist->GetNbinsX(); i++) {
+    for (int j = 0; j < valhist->GetNbinsY(); j++) {
+      hist->SetBinError(i + 1, j + 1, valhist->GetBinContent(i + 1, j + 1));
+    }
   }
+  LOG(SAM) << " --> Done" << std::endl;
+
 
-  return;
 }
 
-//********************************************************************
-void Measurement2D::SetFitOptions(std::string opt) {
-  //********************************************************************
+void Measurement2D::SetMapValuesFromText(std::string dataFile) {
 
-  // Do nothing if set DEFAULT
-  if (opt == "DEFAULT") return;
+  TH2D* hist = fDataHist;
+  std::vector<double> edgex;
+  std::vector<double> edgey;
 
-  // CHECK Conflicting Fit Options
-  std::vector<std::string> fit_option_allow =
-      GeneralUtils::ParseToStr(fAllowedTypes, "/");
-  for (UInt_t i = 0; i < fit_option_allow.size(); i++) {
-    std::vector<std::string> fit_option_section =
-        GeneralUtils::ParseToStr(fit_option_allow.at(i), ",");
-    bool found_option = false;
+  for (int i = 0; i <= hist->GetNbinsX(); i++) edgex.push_back(hist->GetXaxis()->GetBinLowEdge(i+1));
+  for (int i = 0; i <= hist->GetNbinsY(); i++) edgey.push_back(hist->GetYaxis()->GetBinLowEdge(i+1));
 
-    for (UInt_t j = 0; j < fit_option_section.size(); j++) {
-      std::string av_opt = fit_option_section.at(j);
 
-      if (!found_option and opt.find(av_opt) != std::string::npos) {
-        found_option = true;
+  fMapHist = new TH2I((fName + "_map").c_str(), (fName + fPlotTitles).c_str(),
+                      edgex.size()-1, &edgex[0], edgey.size()-1, &edgey[0]);
 
-      } else if (found_option and opt.find(av_opt) != std::string::npos) {
-        ERR(FTL) << "ERROR: Conflicting fit options provided: " << opt
-                 << std::endl;
-        ERR(FTL) << "Conflicting group = " << fit_option_section.at(i)
-                 << std::endl;
-        ERR(FTL) << "You should only supply one of these options in card file."
-                 << std::endl;
-        exit(-1);
-      }
-    }
-  }
+  LOG(SAM) << "Reading map from: " << dataFile << std::endl;
+  PlotUtils::Set2DHistFromText(dataFile, fMapHist, 1.0);
 
-  // Check all options are allowed
-  std::vector<std::string> fit_options_input =
-      GeneralUtils::ParseToStr(opt, "/");
-  for (UInt_t i = 0; i < fit_options_input.size(); i++) {
-    if (fAllowedTypes.find(fit_options_input.at(i)) == std::string::npos) {
-      ERR(FTL) << "ERROR: Fit Option '" << fit_options_input.at(i)
-               << "' Provided is not allowed for this measurement."
-               << std::endl;
-      ERR(FTL) << "Fit Options should be provided as a '/' seperated list "
-                  "(e.g. FREE/DIAG/NORM)"
-               << std::endl;
-      ERR(FTL) << "Available options for " << fName << " are '" << fAllowedTypes
-               << "'" << std::endl;
+}
 
-      exit(-1);
-    }
+//********************************************************************
+void Measurement2D::SetPoissonErrors() {
+//********************************************************************
+
+  if (!fDataHist) {
+    ERR(FTL) << "Need a data hist to setup possion errors! " << std::endl;
+    ERR(FTL) << "Setup Data First!" << std::endl;
+    throw;
   }
 
-  // Set TYPE
-  fFitType = opt;
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, sqrt(fDataHist->GetBinContent(i + 1)));
+  }
+}
 
-  // FIX,SHAPE,FREE
-  if (opt.find("FIX") != std::string::npos) {
-    fIsFree = fIsShape = false;
-    fIsFix = true;
-  } else if (opt.find("SHAPE") != std::string::npos) {
-    fIsFree = fIsFix = false;
-    fIsShape = true;
-  } else if (opt.find("FREE") != std::string::npos) {
-    fIsFix = fIsShape = false;
-    fIsFree = true;
+//********************************************************************
+void Measurement2D::SetCovarFromDiagonal(TH2D* data) {
+//********************************************************************
+
+  if (!data and fDataHist) {
+    data = fDataHist;
   }
 
-  // DIAG,FULL (or default to full)
-  if (opt.find("DIAG") != std::string::npos) {
-    fIsDiag = true;
-    fIsFull = false;
-  } else if (opt.find("FULL") != std::string::npos) {
-    fIsDiag = false;
-    fIsFull = true;
+  if (data) {
+    LOG(SAM) << "Setting diagonal covariance for: " << data->GetName() << std::endl;
+    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(data);
+    covar      = StatUtils::GetInvert(fFullCovar);
+    fDecomp    = StatUtils::GetDecomp(fFullCovar);
+  } else {
+    ERR(FTL) << "No data input provided to set diagonal covar from!" << std::endl;
+
   }
 
-  // CHI2/LL (OTHERS?)
-  if (opt.find("LOG") != std::string::npos)
-    fIsChi2 = false;
-  else
-    fIsChi2 = true;
+  // if (!fIsDiag) {
+  //   ERR(FTL) << "SetCovarMatrixFromDiag called for measurement "
+  //            << "that is not set as diagonal." << std::endl;
+  //   throw;
+  // }
 
-  // EXTRAS
-  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
-  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
-  if (opt.find("ENU1D") != std::string::npos) fIsEnu = true;
-  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
-  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+}
 
-  fIsProjFitX = (opt.find("FITPROJX") != std::string::npos);
-  fIsProjFitY = (opt.find("FITPROJY") != std::string::npos);
+//********************************************************************
+void Measurement2D::SetCovarFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  return;
-};
+  if (dim == -1) {
+    dim = this->GetNDOF(false);
+  }
+
+  LOG(SAM) << "Reading covariance from text file: " << covfile << std::endl;
+  fFullCovar = StatUtils::GetCovarFromTextFile(covfile, dim);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
+
+}
 
 //********************************************************************
-void Measurement2D::SetDataValues(std::string dataFile, std::string TH2Dname) {
-  //********************************************************************
+void Measurement2D::SetCovarFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-  if (dataFile.find(".root") == std::string::npos) {
-    ERR(FTL) << "Error! " << dataFile << " is not a .root file" << std::endl;
-    ERR(FTL) << "Currently only .root file reading is supported (MiniBooNE "
-                "CC1pi+ 2D), but implementing .txt should be dirt easy"
-             << std::endl;
-    ERR(FTL) << "See me at " << __FILE__ << ":" << __LINE__ << std::endl;
-    exit(-1);
+  LOG(SAM) << "Reading covariance from text file: " << covfile << ";" << histname << std::endl;
+  fFullCovar = StatUtils::GetCovarFromRootFile(covfile, histname);
+  covar      = StatUtils::GetInvert(fFullCovar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
 
-  } else {
-    TFile* inFile = new TFile(dataFile.c_str(), "READ");
-    fDataHist = (TH2D*)(inFile->Get(TH2Dname.c_str())->Clone());
-    fDataHist->SetDirectory(0);
+}
 
-    fDataHist->SetNameTitle((fName + "_data").c_str(),
-                            (fName + "_MC" + fPlotTitles).c_str());
+//********************************************************************
+void Measurement2D::SetCovarInvertFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-    delete inFile;
+  if (dim == -1) {
+    dim = this->GetNDOF(false);
   }
 
-  return;
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << std::endl;
+  covar       = StatUtils::GetCovarFromTextFile(covfile, dim);
+  fFullCovar  = StatUtils::GetInvert(covar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
+
 }
 
 //********************************************************************
-void Measurement2D::SetDataValues(std::string dataFile, double dataNorm,
-                                  std::string errorFile, double errorNorm) {
-  //********************************************************************
+void Measurement2D::SetCovarInvertFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-  // Make a counter to track the line number
-  int yBin = 0;
+  LOG(SAM) << "Reading inverted covariance from text file: " << covfile << ";" << histname << std::endl;
+  covar      = StatUtils::GetCovarFromRootFile(covfile, histname);
+  fFullCovar = StatUtils::GetInvert(covar);
+  fDecomp    = StatUtils::GetDecomp(fFullCovar);
 
-  std::string line;
-  std::ifstream data(dataFile.c_str(), ifstream::in);
+}
 
-  fDataHist = new TH2D((fName + "_data").c_str(), (fName + fPlotTitles).c_str(),
-                       fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
+//********************************************************************
+void Measurement2D::SetCorrelationFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-  if (data.is_open())
-    LOG(SAM) << "Reading data from: " << dataFile.c_str() << std::endl;
+  if (dim == -1) dim = this->GetNDOF(false);
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << dim << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromTextFile(covfile, dim);
 
-  while (std::getline(data >> std::ws, line, '\n')) {
-    int xBin = 0;
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
+  }
 
-    // Loop over entries and insert them into the histogram
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      fDataHist->SetBinContent(xBin + 1, yBin + 1, (*iter) * dataNorm);
-      xBin++;
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(dim);
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
     }
-    yBin++;
   }
 
-  yBin = 0;
-  std::ifstream error(errorFile.c_str(), ifstream::in);
-
-  if (error.is_open())
-    LOG(SAM) << "Reading errors from: " << errorFile.c_str() << std::endl;
-
-  while (std::getline(error >> std::ws, line, '\n')) {
-    int xBin = 0;
-
-    // Loop over entries and insert them into the histogram
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      fDataHist->SetBinError(xBin + 1, yBin + 1, (*iter) * errorNorm);
-      xBin++;
-    }
-    yBin++;
-  }
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
 
-  return;
-};
+  delete correlation;
+}
 
 //********************************************************************
-void Measurement2D::SetDataValuesFromText(std::string dataFile,
-                                          double dataNorm) {
-  //********************************************************************
-
-  fDataHist = new TH2D((fName + "_data").c_str(), (fName + fPlotTitles).c_str(),
-                       fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
-
-  LOG(SAM) << "Reading data from: " << dataFile << std::endl;
-  PlotUtils::Set2DHistFromText(dataFile, fDataHist, dataNorm, true);
-
-  return;
-};
-
+void Measurement2D::SetCorrelationFromRootFile(std::string covfile, std::string histname) {
 //********************************************************************
-void Measurement2D::SetCovarMatrix(std::string covarFile) {
-  //********************************************************************
-
-  // Used to read a covariance matrix from a root file
-  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
-
-  // Make plots that we want
-  TH2D* covarPlot = new TH2D();
-  //  TH2D* decmpPlot = new TH2D();
-  TH2D* covarInvPlot = new TH2D();
-  TH2D* fFullCovarPlot = new TH2D();
-
-  // Get covariance options for fake data studies
-  std::string covName = "";
-  std::string covOption = FitPar::Config().GetParS("throw_covariance");
-
-  // Which matrix to get?
-  if (fIsShape || fIsFree) covName = "shp_";
-  if (fIsDiag)
-    covName += "diag";
-  else
-    covName += "full";
-
-  covarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
-  covarInvPlot = (TH2D*)tempFile->Get((covName + "covinv").c_str());
-
-  // Throw either the sub matrix or the full matrix
-  if (!covOption.compare("SUB"))
-    fFullCovarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
-  else if (!covOption.compare("FULL"))
-    fFullCovarPlot = (TH2D*)tempFile->Get("fullcov");
-  else
-    ERR(WRN) << " Incorrect thrown_covariance option in parameters."
-             << std::endl;
-
-  // Bin masking?
-  int dim = int(fDataHist->GetNbinsX());  //-this->masked->Integral());
-  int covdim = int(fDataHist->GetNbinsX());
-
-  // Make new covars
-  this->covar = new TMatrixDSym(dim);
-  fFullCovar = new TMatrixDSym(dim);
-  fDecomp = new TMatrixDSym(dim);
 
-  // Full covariance values
-  int row, column = 0;
-  row = 0;
-  column = 0;
-  for (Int_t i = 0; i < covdim; i++) {
-    // masking can be dodgy
-    // if (this->masked->GetBinContent(i+1) > 0) continue;
-    for (Int_t j = 0; j < covdim; j++) {
-      //   if (this->masked->GetBinContent(j+1) > 0) continue;
-      (*this->covar)(row, column) = covarPlot->GetBinContent(i + 1, j + 1);
-      (*fFullCovar)(row, column) = fFullCovarPlot->GetBinContent(i + 1, j + 1);
+  LOG(SAM) << "Reading data correlations from text file: " << covfile << ";" << histname << std::endl;
+  TMatrixDSym* correlation = StatUtils::GetCovarFromRootFile(covfile, histname);
 
-      column++;
-    }
-    column = 0;
-    row++;
+  if (!fDataHist) {
+    ERR(FTL) << "Trying to set correlations from text file but there is no data to build it from. \n"
+             << "In constructor make sure data is set before SetCorrelationFromTextFile is called. \n" << std::endl;
+    throw;
   }
 
-  // Set bin errors on data
-  if (!fIsDiag) {
-    for (Int_t i = 0; i < fDataHist->GetNbinsX(); i++) {
-      fDataHist->SetBinError(
-          i + 1, sqrt((covarPlot->GetBinContent(i + 1, i + 1))) * 1E-38);
+  // Fill covar from data errors and correlations
+  fFullCovar = new TMatrixDSym(fDataHist->GetNbinsX());
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
+      (*fFullCovar)(i, j) = (*correlation)(i, j) * fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(j + 1) * 1.E76;
     }
   }
 
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+  // Fill other covars.
+  covar   = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
 
-  tempFile->Close();
-  delete tempFile;
+  delete correlation;
+}
 
-  return;
-};
 
 //********************************************************************
-void Measurement2D::SetCovarMatrixFromText(std::string covarFile, int dim) {
-  //********************************************************************
-
-  // Make a counter to track the line number
-  int row = 0;
-
-  std::string line;
-  std::ifstream covar(covarFile.c_str(), ifstream::in);
-
-  this->covar = new TMatrixDSym(dim);
-  fFullCovar = new TMatrixDSym(dim);
-  if (covar.is_open())
-    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
-             << std::endl;
-
-  while (std::getline(covar >> std::ws, line, '\n')) {
-    int column = 0;
-
-    // Loop over entries and insert them into matrix
-    // Multiply by the errors to get the covariance, rather than the correlation
-    // matrix
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      double val = (*iter) * fDataHist->GetBinError(row + 1) * 1E38 *
-                   fDataHist->GetBinError(column + 1) * 1E38;
-      (*this->covar)(row, column) = val;
-      (*fFullCovar)(row, column) = val;
-
-      column++;
-    }
+void Measurement2D::SetCholDecompFromTextFile(std::string covfile, int dim) {
+//********************************************************************
 
-    row++;
+  if (dim == -1) {
+    dim = this->GetNDOF(false);
   }
 
-  // Robust matrix inversion method
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
-
-  return;
-};
-
-//********************************************************************
-void Measurement2D::SetCovarMatrixFromChol(std::string covarFile, int dim) {
-  //********************************************************************
+  LOG(SAM) << "Reading cholesky from text file: " << covfile << " " << dim << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromTextFile(covfile, dim, dim);
 
-  // Make a counter to track the line number
-  int row = 0;
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
+  trans->T();
+  (*trans) *= (*temp);
 
-  std::string line;
-  std::ifstream covarread(covarFile.c_str(), ifstream::in);
+  fFullCovar  = new TMatrixDSym(dim, trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
 
-  TMatrixD* newcov = new TMatrixD(dim, dim);
+  delete temp;
+  delete trans;
 
-  if (covarread.is_open())
-    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
-             << std::endl;
-  while (std::getline(covarread >> std::ws, line, '\n')) {
-    int column = 0;
+}
 
-    // Loop over entries and insert them into matrix
-    // Multiply by the errors to get the covariance, rather than the correlation
-    // matrix
-    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
-    for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++) {
-      (*newcov)(row, column) = *iter;
-      column++;
-    }
+//********************************************************************
+void Measurement2D::SetCholDecompFromRootFile(std::string covfile, std::string histname) {
+//********************************************************************
 
-    row++;
-  }
-  covarread.close();
+  LOG(SAM) << "Reading cholesky decomp from root file: " << covfile << ";" << histname << std::endl;
+  TMatrixD* temp = StatUtils::GetMatrixFromRootFile(covfile, histname);
 
-  // Form full covariance
-  TMatrixD* trans = (TMatrixD*)(newcov)->Clone();
+  TMatrixD* trans = (TMatrixD*)temp->Clone();
   trans->T();
-  (*trans) *= (*newcov);
+  (*trans) *= (*temp);
 
-  fFullCovar = new TMatrixDSym(dim, trans->GetMatrixArray(), "");
+  fFullCovar  = new TMatrixDSym(temp->GetNrows(), trans->GetMatrixArray(), "");
+  covar       = StatUtils::GetInvert(fFullCovar);
+  fDecomp     = StatUtils::GetDecomp(fFullCovar);
 
-  delete newcov;
+  delete temp;
   delete trans;
+}
 
-  // Robust matrix inversion method
-  TDecompChol LU = TDecompChol(*this->fFullCovar);
-  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
 
-  return;
-};
+//********************************************************************
+void Measurement2D::ScaleData(double scale) {
+//********************************************************************
+  fDataHist->Scale(scale);
+}
 
-// virtual void SetMaskValuesFromText(std::string dataFile);
 
 //********************************************************************
-void Measurement2D::SetMapValuesFromText(std::string dataFile) {
-  //********************************************************************
+void Measurement2D::ScaleDataErrors(double scale) {
+//********************************************************************
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
+    for (int j = 0; j < fDataHist->GetNbinsY(); j++) {
+      fDataHist->SetBinError(i + 1, j + 1, fDataHist->GetBinError(i + 1, j + 1) * scale);
+    }
+  }
+}
 
-  fMapHist = new TH2I((fName + "_map").c_str(), (fName + fPlotTitles).c_str(),
-                      fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
 
-  LOG(SAM) << "Reading map from: " << dataFile << std::endl;
-  PlotUtils::Set2DHistFromText(dataFile, fMapHist, 1.0);
 
-  return;
-};
+//********************************************************************
+void Measurement2D::ScaleCovar(double scale) {
+//********************************************************************
+  (*fFullCovar) *= scale;
+  (*covar) *= 1.0 / scale;
+  (*fDecomp) *= sqrt(scale);
+}
+
 
 //********************************************************************
-void Measurement2D::SetBinMask(std::string maskFile) {
-  //********************************************************************
+void Measurement2D::SetBinMask(std::string maskfile) {
+//********************************************************************
 
-  // Create a mask histogram.
-  int nbinsX = fDataHist->GetNbinsX();
-  int nbinsY = fDataHist->GetNbinsY();
+  if (!fIsMask) return;
+  LOG(SAM) << "Reading bin mask from file: " << maskfile << std::endl;
 
-  fMaskHist = new TH2I((fName + "_fMaskHist").c_str(),
-                       (fName + "_fMaskHist; Bin; Mask?").c_str(), nbinsX, 0,
-                       nbinsX, nbinsY, 0, nbinsY);
-  //  int row ,column= 0;
+  // Create a mask histogram with dim of data
+  int nbinsx = fDataHist->GetNbinsX();
+  int nbinxy = fDataHist->GetNbinsY();
+  fMaskHist =
+    new TH2I((fSettings.GetName() + "_BINMASK").c_str(),
+             (fSettings.GetName() + "_BINMASK; Bin; Mask?").c_str(), nbinsx, 0, nbinsx, nbinxy, 0, nbinxy);
   std::string line;
-  std::ifstream mask(maskFile.c_str(), ifstream::in);
+  std::ifstream mask(maskfile.c_str(), ifstream::in);
 
-  if (mask.is_open())
-    LOG(SAM) << "Reading bin mask from file: " << maskFile << std::endl;
-  else
-    ERR(WRN) << " Cannot find mask file." << std::endl;
+  if (!mask.is_open()) {
+    LOG(FTL) << " Cannot find mask file." << std::endl;
+    throw;
+  }
 
   while (std::getline(mask >> std::ws, line, '\n')) {
     std::vector<int> entries = GeneralUtils::ParseToInt(line, " ");
 
     // Skip lines with poorly formatted lines
-    if (entries.size() < 3) {
+    if (entries.size() < 2) {
       LOG(WRN) << "Measurement2D::SetBinMask(), couldn't parse line: " << line
                << std::endl;
       continue;
     }
 
-    // The indices should be x, y, value
-    fMaskHist->SetBinContent(entries[0], entries[1], entries[2]);
+    // The first index should be the bin number, the second should be the mask
+    // value.
+    int val = 0;
+    if (entries[2] > 0) val = 1;
+    fMaskHist->SetBinContent(entries[0], entries[1], val);
   }
 
-  // Set masked data bins to zero
+  // Apply masking by setting masked data bins to zero
   PlotUtils::MaskBins(fDataHist, fMaskHist);
 
+
   return;
 }
 
-/*
-    XSec Functions
-*/
-// //********************************************************************
-// void Measurement2D::SetFluxHistogram(std::string fluxFile, int minE, int
-// maxE, double fluxNorm){
-// //********************************************************************
 
-//   // Note this expects the flux bins to be given in terms of MeV
-//   // Used to read in the flux from a text file
-//   LOG(SAM) << "Reading flux from file: " << fluxFile << std::endl;
 
-//   TGraph *f = new TGraph(fluxFile.c_str(),"%lg %lg");
+//********************************************************************
+void Measurement2D::FinaliseMeasurement() {
+//********************************************************************
 
-//   fFluxHist = new TH1D((fName+"_flux").c_str(), (fName+";E_{#nu}
-//   (GeV)").c_str(), f->GetN()-1, minE, maxE);
+  LOG(SAM) << "Finalising Measurement: " << fName << std::endl;
 
-//   // Get graph points
-//   Double_t *yVal = f->GetY();
+  // Make sure data is setup
+  if (!fDataHist) {
+    ERR(FTL) << "No data has been setup inside " << fName << " constructor!" << std::endl;
+    throw;
+  }
 
-//   // Fill flux histogram from graph
-//   for (int i = 0; i<fFluxHist->GetNbinsX(); ++i)
-//     fFluxHist->SetBinContent(i+1, yVal[i]*fluxNorm);
+  // Make sure covariances are setup
+  if (!fFullCovar) {
+    SetCovarFromDiagonal(fDataHist);
+  }
 
-//   delete f;
+  if (!covar) {
+    covar = StatUtils::GetInvert(fFullCovar);
+  }
 
-// };
+  if (!fDecomp) {
+    fDecomp = StatUtils::GetDecomp(fFullCovar);
+  }
 
-// //********************************************************************
-// double Measurement2D::TotalIntegratedFlux(std::string intOpt, double low,
-// double high){
-// //********************************************************************
+  // Setup fMCHist from data
+  fMCHist = (TH2D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fSettings.GetName() + "_MC").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCHist->Reset();
 
-//   if(GetInput()->GetType() == kGiBUU){
-//     return 1.0;
-//   }
+  // Setup fMCFine
+  fMCFine = new TH2D("mcfine", "mcfine", fDataHist->GetNbinsX() * 6,
+                     fMCHist->GetXaxis()->GetBinLowEdge(1),
+                     fMCHist->GetXaxis()->GetBinLowEdge(fDataHist->GetNbinsX() + 1),
+                     fDataHist->GetNbinsY() * 6,
+                     fMCHist->GetYaxis()->GetBinLowEdge(1),
+                     fMCHist->GetYaxis()->GetBinLowEdge(fDataHist->GetNbinsY() + 1));
 
-//   // Return the integrated flux between two energy values
-//   // If non passed return it between the experimental flux
-//   if (low == -9999.9)  low  = this->EnuMin;
-//   if (high == -9999.9) high = this->EnuMax;
+  fMCFine->SetNameTitle((fSettings.GetName() + "_MC_FINE").c_str(),
+                        (fSettings.GetFullTitles()).c_str());
+  fMCFine->Reset();
 
-//   // Get bin integers
-//   int minBin = fFluxHist->GetXaxis()->FindBin(low);
-//   int maxBin = fFluxHist->GetXaxis()->FindBin(high);
+  // Setup MC Stat
+  fMCStat = (TH2D*)fMCHist->Clone();
+  fMCStat->Reset();
 
-//   // Find integral
-//   double integral = fFluxHist->Integral(minBin, maxBin+1, intOpt.c_str());
+  // Search drawopts for possible types to include by default
+  std::string drawopts = FitPar::Config().GetParS("drawopts");
+  if (drawopts.find("MODES") != std::string::npos) {
+    fMCHist_Modes = new TrueModeStack( (fSettings.GetName() + "_MODES").c_str(),
+                                       ("True Channels"), fMCHist);
+    SetAutoProcessTH1(fMCHist_Modes);
+  }
 
-//   return integral;
+  // Setup bin masks using sample name
+  if (fIsMask) {
 
-// };
+    std::string curname  = fName;
+    std::string origname = fSettings.GetS("originalname");
 
-/*
-  Reconfigure LOOP
-*/
+    // Check rename.mask
+    std::string maskloc = FitPar::Config().GetParDIR(curname + ".mask");
 
-//********************************************************************
-void Measurement2D::ResetAll() {
-  //********************************************************************
+    // Check origname.mask
+    if (maskloc.empty()) maskloc = FitPar::Config().GetParDIR(origname + ".mask");
 
-  // Simple function to reset the mc Histograms incase that is all that is
-  // needed.
+    // Check database
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + origname + ".mask";
+    }
 
-  // Clear histograms
-  fMCHist->Reset();
-  fMCFine->Reset();
+    // Setup Bin Mask
+    SetBinMask(maskloc);
+  }
 
-  return;
-};
+  if (fScaleFactor < 0) {
+    ERR(FTL) << "I found a negative fScaleFactor in " << __FILE__ << ":" << __LINE__ << std::endl;
+    ERR(FTL) << "fScaleFactor = " << fScaleFactor << std::endl;
+    ERR(FTL) << "EXITING" << std::endl;
+    throw;
+  }
 
-//********************************************************************
-void Measurement2D::FillHistograms() {
-  //********************************************************************
+  // Create and fill Weighted Histogram
+  if (!fMCWeighted) {
 
-  if (Signal) {
-    fMCHist->Fill(fXVar, fYVar, Weight);
-    fMCFine->Fill(fXVar, fYVar, Weight);
+    fMCWeighted = (TH2D*)fMCHist->Clone();
+    fMCWeighted->SetNameTitle((fName + "_MCWGHTS").c_str(),
+                              (fName + "_MCWGHTS" + fPlotTitles).c_str());
+    fMCWeighted->GetYaxis()->SetTitle("Weighted Events");
 
-    PlotUtils::FillNeutModeArray((TH2D**)fMCHist_PDG, Mode, fXVar, fYVar,
-                                 Weight);
   }
 
-  return;
+
 }
 
 //********************************************************************
-void Measurement2D::ScaleEvents() {
+void Measurement2D::SetFitOptions(std::string opt) {
+//********************************************************************
+
+  // Do nothing if default given
+  if (opt == "DEFAULT") return;
+
+  // CHECK Conflicting Fit Options
+  std::vector<std::string> fit_option_allow =
+    GeneralUtils::ParseToStr(fAllowedTypes, "/");
+
+  for (UInt_t i = 0; i < fit_option_allow.size(); i++) {
+    std::vector<std::string> fit_option_section =
+      GeneralUtils::ParseToStr(fit_option_allow.at(i), ",");
+
+    bool found_option = false;
+
+    for (UInt_t j = 0; j < fit_option_section.size(); j++) {
+      std::string av_opt = fit_option_section.at(j);
+
+      if (!found_option and opt.find(av_opt) != std::string::npos) {
+        found_option = true;
+
+      } else if (found_option and opt.find(av_opt) != std::string::npos) {
+        ERR(FTL) << "ERROR: Conflicting fit options provided: "
+                 << opt << std::endl
+                 << "Conflicting group = " << fit_option_section.at(i) << std::endl
+                 << "You should only supply one of these options in card file." << std::endl;
+        throw;
+      }
+    }
+  }
+
+  // Check all options are allowed
+  std::vector<std::string> fit_options_input =
+    GeneralUtils::ParseToStr(opt, "/");
+  for (UInt_t i = 0; i < fit_options_input.size(); i++) {
+    if (fAllowedTypes.find(fit_options_input.at(i)) == std::string::npos) {
+      ERR(FTL) << "ERROR: Fit Option '" << fit_options_input.at(i)
+               << "' Provided is not allowed for this measurement."
+               << std::endl;
+      ERR(FTL) << "Fit Options should be provided as a '/' seperated list "
+               "(e.g. FREE/DIAG/NORM)"
+               << std::endl;
+      ERR(FTL) << "Available options for " << fName << " are '" << fAllowedTypes
+               << "'" << std::endl;
+
+      throw;
+    }
+  }
+
+  // Set TYPE
+  fFitType = opt;
+
+  // FIX,SHAPE,FREE
+  if (opt.find("FIX") != std::string::npos) {
+    fIsFree = fIsShape = false;
+    fIsFix = true;
+  } else if (opt.find("SHAPE") != std::string::npos) {
+    fIsFree = fIsFix = false;
+    fIsShape = true;
+  } else if (opt.find("FREE") != std::string::npos) {
+    fIsFix = fIsShape = false;
+    fIsFree = true;
+  }
+
+  // DIAG,FULL (or default to full)
+  if (opt.find("DIAG") != std::string::npos) {
+    fIsDiag = true;
+    fIsFull = false;
+  } else if (opt.find("FULL") != std::string::npos) {
+    fIsDiag = false;
+    fIsFull = true;
+  }
+
+  // CHI2/LL (OTHERS?)
+  if (opt.find("LOG") != std::string::npos) {
+    fIsChi2 = false;
+
+    ERR(FTL) << "No other LIKELIHOODS properly supported!" << std::endl;
+    ERR(FTL) << "Try to use a chi2!" << std::endl;
+    throw;
+
+  } else {
+    fIsChi2 = true;
+  }
+
+  // EXTRAS
+  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
+  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
+  if (opt.find("ENU1D") != std::string::npos) fIsEnu1D = true;
+  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
+  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+
+  // Set TYPE
+  fFitType = opt;
+
+  // FIX,SHAPE,FREE
+  if (opt.find("FIX") != std::string::npos) {
+    fIsFree = fIsShape = false;
+    fIsFix = true;
+  } else if (opt.find("SHAPE") != std::string::npos) {
+    fIsFree = fIsFix = false;
+    fIsShape = true;
+  } else if (opt.find("FREE") != std::string::npos) {
+    fIsFix = fIsShape = false;
+    fIsFree = true;
+  }
+
+  // DIAG,FULL (or default to full)
+  if (opt.find("DIAG") != std::string::npos) {
+    fIsDiag = true;
+    fIsFull = false;
+  } else if (opt.find("FULL") != std::string::npos) {
+    fIsDiag = false;
+    fIsFull = true;
+  }
+
+  // CHI2/LL (OTHERS?)
+  if (opt.find("LOG") != std::string::npos)
+    fIsChi2 = false;
+  else
+    fIsChi2 = true;
+
+  // EXTRAS
+  if (opt.find("RAW") != std::string::npos) fIsRawEvents = true;
+  if (opt.find("DIF") != std::string::npos) fIsDifXSec = true;
+  if (opt.find("ENU1D") != std::string::npos) fIsEnu = true;
+  if (opt.find("NORM") != std::string::npos) fAddNormPen = true;
+  if (opt.find("MASK") != std::string::npos) fIsMask = true;
+
+  fIsProjFitX = (opt.find("FITPROJX") != std::string::npos);
+  fIsProjFitY = (opt.find("FITPROJY") != std::string::npos);
+
+  return;
+};
+
+
+/*
+   Reconfigure LOOP
+*/
+//********************************************************************
+void Measurement2D::ResetAll() {
+//********************************************************************
+
+  fMCHist->Reset();
+  fMCFine->Reset();
+  fMCStat->Reset();
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::FillHistograms() {
   //********************************************************************
 
-  if (fMCWeighted) delete fMCWeighted;
+  if (Signal) {
+    fMCHist->Fill(fXVar, fYVar, Weight);
+    fMCFine->Fill(fXVar, fYVar, Weight);
+    fMCStat->Fill(fXVar, fYVar, 1.0);
+
+    if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, fXVar, fYVar, Weight);
+  }
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::ScaleEvents() {
+//********************************************************************
+
+  // Fill MCWeighted;
+  // for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+  // fMCWeighted->SetBinContent(i + 1, fMCHist->GetBinContent(i + 1));
+  // fMCWeighted->SetBinError(i + 1,   fMCHist->GetBinError(i + 1));
+  // }
+
+
+  // Setup Stat ratios for MC and MC Fine
+  double* statratio     = new double[fMCHist->GetNbinsX()];
+  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
+    if (fMCHist->GetBinContent(i + 1) != 0) {
+      statratio[i] = fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1);
+    } else {
+      statratio[i] = 0.0;
+    }
+  }
+
+  double* statratiofine = new double[fMCFine->GetNbinsX()];
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    if (fMCFine->GetBinContent(i + 1) != 0) {
+      statratiofine[i] = fMCFine->GetBinError(i + 1) / fMCFine->GetBinContent(i + 1);
+    } else {
+      statratiofine[i] = 0.0;
+    }
+  }
 
-  fMCWeighted = (TH2D*)fMCHist->Clone();
-  fMCWeighted->SetNameTitle((fName + "_MC_WGHTS").c_str(),
-                            (fName + "_MC_WGHTS" + fPlotTitles).c_str());
-  fMCWeighted->GetYaxis()->SetTitle("Weighted Events");
 
-  if (fIsEnu) {  // If we have Enu we need to do flux integration bin by bin
+  // Scaling for raw event rates
+  if (fIsRawEvents) {
+    double datamcratio = fDataHist->Integral() / fMCHist->Integral();
+
+    fMCHist->Scale(datamcratio);
+    fMCFine->Scale(datamcratio);
+
+    if (fMCHist_Modes) fMCHist_Modes->Scale(datamcratio);
+
+    // Scaling for XSec as function of Enu
+  } else if (fIsEnu1D) {
 
-    // This assumes we have the Enu on the x-axis
-    // fairly trivial to make the change but only MiniBooNE 2D CC1pi+ has Enu in
-    // a 2D
     PlotUtils::FluxUnfoldedScaling(fMCHist, GetFluxHistogram(),
                                    GetEventHistogram(), fScaleFactor);
+
     PlotUtils::FluxUnfoldedScaling(fMCFine, GetFluxHistogram(),
                                    GetEventHistogram(), fScaleFactor);
 
-  } else {  // Else we just do normal scaling
 
-    // Scale bin errors correctly
-    fMCHist->GetSumw2();
-    fMCFine->GetSumw2();
+    // if (fMCHist_Modes) {
+    // PlotUtils::FluxUnfoldedScaling(fMCHist_Modes, GetFluxHistogram(),
+    // GetEventHistogram(), fScaleFactor,
+    // fNEvents);
+    // }
 
-    // Final Scaling factors
+    // Any other differential scaling
+  } else {
     fMCHist->Scale(fScaleFactor, "width");
     fMCFine->Scale(fScaleFactor, "width");
 
-    PlotUtils::ScaleNeutModeArray((TH1**)this->fMCHist_PDG, fScaleFactor,
-                                  "width");
+    // if (fMCHist_Modes) fMCHist_Modes->Scale(fScaleFactor, "width");
+  }
+
+
+  // Proper error scaling - ROOT Freaks out with xsec weights sometimes
+  for (int i = 0; i < fMCStat->GetNbinsX(); i++) {
+    fMCHist->SetBinError(i + 1, fMCHist->GetBinContent(i + 1) * statratio[i]);
+  }
+
+  for (int i = 0; i < fMCFine->GetNbinsX(); i++) {
+    fMCFine->SetBinError(i + 1, fMCFine->GetBinContent(i + 1) * statratiofine[i]);
   }
 
+
+  // Clean up
+  delete statratio;
+  delete statratiofine;
+
   return;
 };
 
 //********************************************************************
 void Measurement2D::ApplyNormScale(double norm) {
-  //********************************************************************
+//********************************************************************
 
   fCurrentNorm = norm;
 
-  double scale = 0.0;
-  if (norm > 0.0) scale = 1.0 / norm;
-
-  fMCHist->Scale(scale);
-  fMCFine->Scale(scale);
-
-  PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, scale);
+  fMCHist->Scale(1.0 / norm);
+  fMCFine->Scale(1.0 / norm);
 
   return;
 };
 
+
+
 /*
-  Statistic Functions - Outsources to StatUtils
+   Statistic Functions - Outsources to StatUtils
 */
+
 //********************************************************************
-int Measurement2D::GetNDOF() {
+int Measurement2D::GetNDOF(bool applymasking) {
   //********************************************************************
+  // return fDataHist->GetNbinsX() - fMaskHist->Integral();
 
   // Just incase it has gone...
   if (!fDataHist) return 0;
 
   int nDOF = 0;
 
   // If datahist has no errors make sure we don't include those bins as they are
   // not data points
   for (int xBin = 0; xBin < fDataHist->GetNbinsX() + 1; ++xBin) {
     for (int yBin = 0; yBin < fDataHist->GetNbinsY() + 1; ++yBin) {
-      if (fDataHist->GetBinContent(xBin, yBin) != 0 &&
-          fDataHist->GetBinError(xBin, yBin) != 0)
+      if (fDataHist->GetBinContent(xBin, yBin) != 0)
         ++nDOF;
     }
   }
 
   // Account for possible bin masking
   int nMasked = 0;
   if (fMaskHist and fIsMask)
     if (fMaskHist->Integral() > 0)
       for (int xBin = 0; xBin < fMaskHist->GetNbinsX() + 1; ++xBin)
         for (int yBin = 0; yBin < fMaskHist->GetNbinsY() + 1; ++yBin)
           if (fMaskHist->GetBinContent(xBin, yBin) > 0.5) ++nMasked;
 
   // Take away those masked DOF
-  nDOF -= nMasked;
+  if (applymasking) {
+    nDOF -= nMasked;
+  }
 
   return nDOF;
 }
 
 //********************************************************************
 double Measurement2D::GetLikelihood() {
-  //********************************************************************
+//********************************************************************
+
+  // If this is for a ratio, there is no data histogram to compare to!
+  if (fNoData || !fDataHist) return 0.;
 
   // Fix weird masking bug
   if (!fIsMask) {
     if (fMaskHist) {
       fMaskHist = NULL;
     }
   } else {
     if (fMaskHist) {
       PlotUtils::MaskBins(fMCHist, fMaskHist);
     }
   }
 
   //  if (fIsProjFitX or fIsProjFitY) return GetProjectedChi2();
 
   // Scale up the results to match each other (Not using width might be
   // inconsistent with Meas1D)
   double scaleF = fDataHist->Integral() / fMCHist->Integral();
   if (fIsShape) {
     fMCHist->Scale(scaleF);
     fMCFine->Scale(scaleF);
     PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, scaleF);
   }
 
   if (!fMapHist) {
     fMapHist = StatUtils::GenerateMap(fDataHist);
   }
 
   // Get the chi2 from either covar or diagonals
-  double chi2;
+  double chi2 = 0.0;
 
   if (fIsChi2) {
     if (fIsDiag) {
       chi2 =
-          StatUtils::GetChi2FromDiag(fDataHist, fMCHist, fMapHist, fMaskHist);
+        StatUtils::GetChi2FromDiag(fDataHist, fMCHist, fMapHist, fMaskHist);
     } else {
       chi2 = StatUtils::GetChi2FromCov(fDataHist, fMCHist, covar, fMapHist,
                                        fMaskHist);
     }
-  } else {
-    if (fIsDiag) {
-      chi2 = StatUtils::GetLikelihoodFromDiag(fDataHist, fMCHist, fMapHist,
-                                              fMaskHist);
-    } else {
-      chi2 = StatUtils::GetLikelihoodFromCov(fDataHist, fMCHist, covar,
-                                             fMapHist, fMaskHist);
-    }
   }
 
   // Add a normal penalty term
   if (fAddNormPen) {
     chi2 +=
-        (1 - (fCurrentNorm)) * (1 - (fCurrentNorm)) / (fNormError * fNormError);
+      (1 - (fCurrentNorm)) * (1 - (fCurrentNorm)) / (fNormError * fNormError);
     LOG(REC) << "Norm penalty = "
              << (1 - (fCurrentNorm)) * (1 - (fCurrentNorm)) /
-                    (fNormError * fNormError)
+             (fNormError * fNormError)
              << std::endl;
   }
 
   // Adjust the shape back to where it was.
   if (fIsShape and !FitPar::Config().GetParB("saveshapescaling")) {
     fMCHist->Scale(1. / scaleF);
     fMCFine->Scale(1. / scaleF);
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, 1.0 / scaleF);
   }
 
-  LOG(REC) << fName + " Chi2 = " << chi2 << " \n";
-
   return chi2;
-};
-
-// //********************************************************************
-// double Measurement2D::GetProjectedChi2(){
-// //********************************************************************
-
-//   PlotUtils::MatchEmptfYBins(fDataHist,fMCHist);
-
-//   fMCHist_X = PlotUtils::GetProjectionX(fMCHist, fMaskHist);
-//   fMCHist_Y = PlotUtils::GetProjectionY(fMCHist, fMaskHist);
-
-//   fDataHist_X = PlotUtils::GetProjectionX(fDataHist, fMaskHist);
-//   fDataHist_Y = PlotUtils::GetProjectionY(fDataHist, fMaskHist);
-
-//   // Depending on the option either the rate of only X or only Y is used.
-
-//   // If using Y rate, scale X to match data and vice versa
-//   // Note: Projection will have already accounted for masking.
-//   if (fIsProjFitY) fMCHist_X->Scale(PlotUtils::GetDataMCRatio(fDataHist_X,
-//   fMCHist_X));
-//   if (fIsProjFitX) fMCHist_Y->Scale(PlotUtils::GetDataMCRatio(fDataHist_Y,
-//   fMCHist_Y));
-
-//   // Now get individual chi2 from each
-//   double chi2X = StatUtils::GetChi2FromDiag(fDataHist_X, fMCHist_X);
-//   double chi2Y = StatUtils::GetChi2FromDiag(fDataHist_Y, fMCHist_Y);
-
-//   double chi2 = chi2X  + chi2Y;
-
-//   fMCHist_X->SetTitle(Form("%d", chi2X));
-//   fMCHist_Y->SetTitle(Form("%d", chi2Y));
+}
 
-//   return chi2;
-// }
 
 /*
-  Fake Data
+  Fake Data Functions
 */
 //********************************************************************
 void Measurement2D::SetFakeDataValues(std::string fakeOption) {
-  //********************************************************************
+//********************************************************************
+
+  // Setup original/datatrue
+  TH2D* tempdata = (TH2D*) fDataHist->Clone();
+
+  if (!fIsFakeData) {
+    fIsFakeData = true;
+
+    // Make a copy of the original data histogram.
+    if (!fDataOrig) fDataOrig = (TH2D*)fDataHist->Clone((fName + "_data_original").c_str());
+
+  } else {
+    ResetFakeData();
 
-  // This is the original data
-  if (!(fDataOrig))
-    fDataOrig = (TH2D*)fDataHist->Clone((fName + "_data_original").c_str());
-  TH2D* tempData = (TH2D*)fDataHist->Clone();
+  }
 
-  TFile* fake = new TFile();
+  // Setup Inputs
+  fFakeDataInput = fakeOption;
+  LOG(SAM) << "Setting fake data from : " << fFakeDataInput << std::endl;
 
-  if (fakeOption.compare("MC") == 0) {
-    LOG(SAM) << fName << "Setting fake data from MC " << std::endl;
+  // From MC
+  if (fFakeDataInput.compare("MC") == 0) {
     fDataHist = (TH2D*)fMCHist->Clone((fName + "_MC").c_str());
-    if (fMCHist->Integral() == 0.0)
-      LOG(SAM) << fName << "Invalid histogram" << std::endl;
+
+    // Fake File
   } else {
-    fake = new TFile(fakeOption.c_str());
-    fDataHist = (TH2D*)fake->Get((fName + "_MC").c_str());
+    if (!fFakeDataFile) fFakeDataFile = new TFile(fFakeDataInput.c_str(), "READ");
+    fDataHist = (TH2D*)fFakeDataFile->Get((fName + "_MC").c_str());
+
   }
 
+  // Setup Data Hist
   fDataHist->SetNameTitle((fName + "_FAKE").c_str(),
                           (fName + fPlotTitles).c_str());
 
-  int nbins_x = fDataHist->GetNbinsX();
-  int nbins_y = fDataHist->GetNbinsY();
-  double alpha_i = 0.0;
+  // Replace Data True
+  if (fDataTrue) delete fDataTrue;
+  fDataTrue = (TH2D*)fDataHist->Clone();
+  fDataTrue->SetNameTitle((fName + "_FAKE_TRUE").c_str(),
+                          (fName + fPlotTitles).c_str());
+
 
-  for (int i = 0; i < nbins_x; i++) {
-    for (int j = 0; j < nbins_y; j++) {
-      if (tempData->GetBinContent(i + 1, j + 1) == 0.0) continue;
+  // Make a new covariance for fake data hist.
+  int nbins = fDataHist->GetNbinsX() * fDataHist->GetNbinsY();
+  double alpha_i = 0.0;
+  double alpha_j = 0.0;
+
+  for (int i = 0; i < nbins; i++) {
+    for (int j = 0; j < nbins; j++) {
+      if (tempdata->GetBinContent(i + 1) && tempdata->GetBinContent(j + 1)) {
+        alpha_i = fDataHist->GetBinContent(i + 1) / tempdata->GetBinContent(i + 1);
+        alpha_j = fDataHist->GetBinContent(j + 1) / tempdata->GetBinContent(j + 1);
+      } else {
+        alpha_i = 0.0;
+        alpha_j = 0.0;
+      }
 
-      alpha_i = fDataHist->GetBinContent(i + 1, j + 1) /
-                fDataOrig->GetBinContent(i + 1, j + 1);
-      fDataHist->SetBinError(i + 1, j + 1,
-                             alpha_i * fDataOrig->GetBinError(i + 1, j + 1));
+      (*fFullCovar)(i, j) = alpha_i * alpha_j * (*fFullCovar)(i, j);
     }
   }
-  fDataTrue = (TH2D*)fDataHist->Clone();
 
-  fake->Close();
-  delete fake;
+  // Setup Covariances
+  if (covar) delete covar;
+  covar   = StatUtils::GetInvert(fFullCovar);
+
+  if (fDecomp) delete fDecomp;
+  fDecomp = StatUtils::GetInvert(fFullCovar);
+
+  delete tempdata;
 
   return;
 };
 
-// virtual void ResetFakeData();
-// virtual void ResetData();
+//********************************************************************
+void Measurement2D::ResetFakeData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH2D*)fDataTrue->Clone((fSettings.GetName() + "_FKDAT").c_str());
+  }
+
+}
+
+//********************************************************************
+void Measurement2D::ResetData() {
+//********************************************************************
+
+  if (fIsFakeData) {
+    if (fDataHist) delete fDataHist;
+    fDataHist = (TH2D*)fDataOrig->Clone((fSettings.GetName() + "_data").c_str());
+  }
+
+  fIsFakeData = false;
+}
 
 //********************************************************************
 void Measurement2D::ThrowCovariance() {
-  //********************************************************************
+//********************************************************************
+
+  // Take a fDecomposition and use it to throw the current dataset.
+  // Requires fDataTrue also be set incase used repeatedly.
+
+  if (fDataHist) delete fDataHist;
+  fDataHist = StatUtils::ThrowHistogram(fDataTrue, fFullCovar);
 
   return;
 };
 
 /*
-    Access Functions
+   Access Functions
 */
+
+//********************************************************************
+TH2D* Measurement2D::GetMCHistogram() {
 //********************************************************************
-std::vector<TH1*> Measurement2D::GetMCList() {
-  //********************************************************************
 
-  // If this isn't a NULL pointer, make the plot pretty!
-  if (!fMCHist) return std::vector<TH1*>(1, fMCHist);
+  if (!fMCHist) return fMCHist;
 
   std::ostringstream chi2;
   chi2 << std::setprecision(5) << this->GetLikelihood();
 
-  int plotcolor = kRed;
-  if (FitPar::Config().GetParI("linecolour") > 0) {
-    plotcolor = FitPar::Config().GetParI("linecolour");
-  }
+  int linecolor = kRed;
+  int linestyle = 1;
+  int linewidth = 1;
 
-  int plotstyle = 1;
-  if (FitPar::Config().GetParI("linestyle") > 0) {
-    plotstyle = FitPar::Config().GetParI("linestyle");
-  }
+  int fillcolor = 0;
+  int fillstyle = 1001;
 
-  int plotfillstyle = 0;
-  if (FitPar::Config().GetParI("fillstyle") > 0) {
-    plotfillstyle = FitPar::Config().GetParI("fillstyle");
-  }
+  if (fSettings.Has("linecolor")) linecolor = fSettings.GetI("linecolor");
+  if (fSettings.Has("linestyle")) linestyle = fSettings.GetI("linestyle");
+  if (fSettings.Has("linewidth")) linewidth = fSettings.GetI("linewidth");
 
-  LOG(SAM) << fName << " chi2 = " << GetLikelihood() << std::endl;
+  if (fSettings.Has("fillcolor")) fillcolor = fSettings.GetI("fillcolor");
+  if (fSettings.Has("fillstyle")) fillstyle = fSettings.GetI("fillstyle");
 
   fMCHist->SetTitle(chi2.str().c_str());
-  fMCHist->SetLineWidth(2);
-  fMCHist->SetLineColor(plotcolor);
-  fMCHist->SetFillColor(plotcolor);
-  fMCHist->SetLineStyle(plotstyle);
-  fMCHist->SetFillStyle(plotfillstyle);
 
-  return std::vector<TH1*>(1, fMCHist);
+  fMCHist->SetLineColor(linecolor);
+  fMCHist->SetLineStyle(linestyle);
+  fMCHist->SetLineWidth(linewidth);
+
+  fMCHist->SetFillColor(fillcolor);
+  fMCHist->SetFillStyle(fillstyle);
+
+  return fMCHist;
 };
 
 //********************************************************************
-std::vector<TH1*> Measurement2D::GetDataList() {
-  //********************************************************************
+TH2D* Measurement2D::GetDataHistogram() {
+//********************************************************************
 
-  // If this isn't a NULL pointer, make the plot pretty!
+  if (!fDataHist) return fDataHist;
 
-  if (!fDataHist) return std::vector<TH1*>(1, fDataHist);
+  int datacolor = kBlack;
+  int datastyle = 1;
+  int datawidth = 1;
 
-  fDataHist->SetLineWidth(2);
-  fDataHist->SetLineColor(kBlue);
+  if (fSettings.Has("datacolor")) datacolor = fSettings.GetI("datacolor");
+  if (fSettings.Has("datastyle")) datastyle = fSettings.GetI("datastyle");
+  if (fSettings.Has("datawidth")) datawidth = fSettings.GetI("datawidth");
 
-  return std::vector<TH1*>(1, fDataHist);
+  fDataHist->SetLineColor(datacolor);
+  fDataHist->SetLineWidth(datawidth);
+  fDataHist->SetMarkerStyle(datastyle);
+
+  return fDataHist;
 };
 
-//********************************************************************
-void Measurement2D::GetBinContents(std::vector<double>& cont,
-                                   std::vector<double>& err) {
-  //********************************************************************
 
-  int count = 0;
-  for (int i = 0; i < (fMCHist->GetNbinsX() + 2) * (fMCHist->GetNbinsY() + 2);
-       i++) {
-    cont.push_back(fMCHist->GetBinContent(i));
-    err.push_back(fMCHist->GetBinError(i));
-    count++;
-  }
-  return;
-};
+/*
+   Write Functions
+*/
 
+// Save all the histograms at once
+//********************************************************************
+void Measurement2D::Write(std::string drawOpt) {
 //********************************************************************
-std::vector<double> Measurement2D::GetXSec(std::string option) {
-  //********************************************************************
 
-  std::vector<double> vals;
-  vals.push_back(0.0);
-  vals.push_back(0.0);
+  // Get Draw Options
+  drawOpt = FitPar::Config().GetParS("drawopts");
 
-  bool getMC = !option.compare("MC");
-  bool getDT = !option.compare("DATA");
+  // Write Data/MC
+  GetDataList().at(0)->Write();
+  GetMCList().at(0)->Write();
 
-  for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
-    if (fDataHist->GetBinContent(i + 1) == 0.0 and
-        fDataHist->GetBinError(i + 1) == 0.0)
-      continue;
+  // Write Fine Histogram
+  if (drawOpt.find("FINE") != std::string::npos)
+    GetFineList().at(0)->Write();
+
+  // Write Weighted Histogram
+  if (drawOpt.find("WEIGHTS") != std::string::npos && fMCWeighted)
+    fMCWeighted->Write();
+
+
+  // Save Flux/Evt if no event manager
+  if (!FitPar::Config().GetParB("EventManager")) {
+
+    if (drawOpt.find("FLUX") != std::string::npos && GetFluxHistogram())
+      GetFluxHistogram()->Write();
+
+    if (drawOpt.find("EVT") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
+
+    if (drawOpt.find("XSEC") != std::string::npos && GetEventHistogram())
+      GetEventHistogram()->Write();
 
-    if (getMC) {
-      vals[0] += fMCHist->GetBinContent(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1);
-      vals[1] += fMCHist->GetBinError(i + 1) * fMCHist->GetBinError(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1) *
-                 fMCHist->GetXaxis()->GetBinWidth(i + 1);
-
-    } else if (getDT) {
-      vals[0] += fDataHist->GetBinContent(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1);
-      vals[1] += fDataHist->GetBinError(i + 1) * fDataHist->GetBinError(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1) *
-                 fDataHist->GetXaxis()->GetBinWidth(i + 1);
-    }
   }
 
-  // If not diag Get the total error from the covariance
-  if (!fIsDiag and getDT) {
-    vals[1] = 0.0;
-    for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
-      for (int j = 0; j < fDataHist->GetNbinsX(); j++) {
-        vals[1] += (*fFullCovar)(i, j);
-      }
-    }
-    vals[1] = sqrt(vals[1]) * 1E-38;
+  // Write Mask
+  if (fIsMask && (drawOpt.find("MASK") != std::string::npos)) {
+    fMaskHist->Write();
   }
 
-  return vals;
-}
 
-/*
-  Write Functions
-*/
+  // Write Covariances
+  if (drawOpt.find("COV") != std::string::npos && fFullCovar) {
+    PlotUtils::GetFullCovarPlot(fFullCovar, fSettings.GetName());
+  }
 
-//********************************************************************
-void Measurement2D::Write(std::string drawOpt) {
-  //********************************************************************
+  if (drawOpt.find("INVCOV") != std::string::npos && covar) {
+    PlotUtils::GetInvCovarPlot(covar, fSettings.GetName());
+  }
 
+  if (drawOpt.find("DECOMP") != std::string::npos && fDecomp) {
+    PlotUtils::GetDecompCovarPlot(fDecomp, fSettings.GetName());
+  }
+
+  // // Likelihood residual plots
+  // if (drawOpt.find("RESIDUAL") != std::string::npos) {
+  //   WriteResidualPlots();
+  // }
+
+
+  // // RATIO
+  // if (drawOpt.find("CANVMC") != std::string::npos) {
+  //   TCanvas* c1 = WriteMCCanvas(fDataHist, fMCHist);
+  //   c1->Write();
+  //   delete c1;
+  // }
+
+  // // PDG
+  // if (drawOpt.find("CANVPDG") != std::string::npos && fMCHist_Modes) {
+  //   TCanvas* c2 = WritePDGCanvas(fDataHist, fMCHist, fMCHist_Modes);
+  //   c2->Write();
+  //   delete c2;
+  // }
+
+  // Write Extra Histograms
+  AutoWriteExtraTH1();
+  WriteExtraHistograms();
+
+  /// 2D VERSION
   // If null pointer return
   if (!fMCHist and !fDataHist) {
     LOG(SAM) << fName << "Incomplete histogram set!" << std::endl;
     return;
   }
 
   //  FitPar::Config().out->cd();
 
   // Get Draw Options
   drawOpt = FitPar::Config().GetParS("drawopts");
   bool drawData = (drawOpt.find("DATA") != std::string::npos);
   bool drawNormal = (drawOpt.find("MC") != std::string::npos);
   bool drawEvents = (drawOpt.find("EVT") != std::string::npos);
   bool drawXSec = (drawOpt.find("XSEC") != std::string::npos);
   bool drawFine = (drawOpt.find("FINE") != std::string::npos);
   bool drawRatio = (drawOpt.find("RATIO") != std::string::npos);
-  bool drawModes = (drawOpt.find("MODES") != std::string::npos);
+  // bool drawModes = (drawOpt.find("MODES") != std::string::npos);
   bool drawShape = (drawOpt.find("SHAPE") != std::string::npos);
   bool residual = (drawOpt.find("RESIDUAL") != std::string::npos);
   bool drawMatrix = (drawOpt.find("MATRIX") != std::string::npos);
   bool drawFlux = (drawOpt.find("FLUX") != std::string::npos);
   bool drawMask = (drawOpt.find("MASK") != std::string::npos);
   bool drawMap = (drawOpt.find("MAP") != std::string::npos);
   bool drawProj = (drawOpt.find("PROJ") != std::string::npos);
   // bool drawCanvPDG = (drawOpt.find("CANVPDG") != std::string::npos);
   bool drawCov = (drawOpt.find("COV") != std::string::npos);
   bool drawSliceCanvYMC = (drawOpt.find("CANVYMC") != std::string::npos);
   bool drawWeighted = (drawOpt.find("WGHT") != std::string::npos);
 
   if (FitPar::Config().GetParB("EventManager")) {
     drawFlux = false;
     drawXSec = false;
     drawEvents = false;
   }
 
+  if (fMaskHist) fMaskHist->Write();
+
   // Save standard plots
   if (drawData) this->GetDataList().at(0)->Write();
   if (drawNormal) this->GetMCList().at(0)->Write();
 
   if (drawCov) {
     TH2D(*fFullCovar).Write((fName + "_COV").c_str());
   }
 
   if (drawOpt.find("INVCOV") != std::string::npos) {
     TH2D(*covar).Write((fName + "_INVCOV").c_str());
   }
 
   // Generate a simple map
   if (!fMapHist) fMapHist = StatUtils::GenerateMap(fDataHist);
 
   // Convert to 1D Lists
   TH1D* data_1D = StatUtils::MapToTH1D(fDataHist, fMapHist);
   TH1D* mc_1D = StatUtils::MapToTH1D(fMCHist, fMapHist);
   TH1I* mask_1D = StatUtils::MapToMask(fMaskHist, fMapHist);
 
   data_1D->Write();
   mc_1D->Write();
 
   if (mask_1D) {
     mask_1D->Write();
 
     TMatrixDSym* calc_cov =
-        StatUtils::ApplyInvertedMatrixMasking(covar, mask_1D);
+      StatUtils::ApplyInvertedMatrixMasking(covar, mask_1D);
     TH1D* calc_data = StatUtils::ApplyHistogramMasking(data_1D, mask_1D);
     TH1D* calc_mc = StatUtils::ApplyHistogramMasking(mc_1D, mask_1D);
 
     TH2D* bin_cov = new TH2D(*calc_cov);
 
     bin_cov->Write();
     calc_data->Write();
     calc_mc->Write();
 
     delete mask_1D;
     delete calc_cov;
     delete calc_data;
     delete calc_mc;
     delete bin_cov;
   }
 
   delete data_1D;
   delete mc_1D;
 
   // Save only mc and data if splines
   if (fEventType == 4 or fEventType == 3) {
     return;
   }
 
   // Draw Extra plots
   if (drawFine) this->GetFineList().at(0)->Write();
   if (drawFlux and GetFluxHistogram()) {
     GetFluxHistogram()->Write();
   }
   if (drawEvents and GetEventHistogram()) {
     GetEventHistogram()->Write();
   }
   if (fIsMask and drawMask) {
     fMaskHist->Write((fName + "_MSK").c_str());  //< save mask
   }
   if (drawMap) fMapHist->Write((fName + "_MAP").c_str());  //< save map
 
-  // Save neut stack
-  if (drawModes) {
-    THStack combo_fMCHist_PDG = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_PDG").c_str(), (TH1**)fMCHist_PDG, 0);
-    combo_fMCHist_PDG.Write();
-  }
+  // // Save neut stack
+  // if (drawModes) {
+  //   THStack combo_fMCHist_PDG = PlotUtils::GetNeutModeStack(
+  //                                 (fName + "_MC_PDG").c_str(), (TH1**)fMCHist_PDG, 0);
+  //   combo_fMCHist_PDG.Write();
+  // }
 
   // Save Matrix plots
   if (drawMatrix and fFullCovar and covar and fDecomp) {
     TH2D cov = TH2D((*fFullCovar));
     cov.SetNameTitle((fName + "_cov").c_str(),
                      (fName + "_cov;Bins; Bins;").c_str());
     cov.Write();
 
     TH2D covinv = TH2D((*this->covar));
     covinv.SetNameTitle((fName + "_covinv").c_str(),
                         (fName + "_cov;Bins; Bins;").c_str());
     covinv.Write();
 
     TH2D covdec = TH2D((*fDecomp));
     covdec.SetNameTitle((fName + "_covdec").c_str(),
                         (fName + "_cov;Bins; Bins;").c_str());
     covdec.Write();
   }
 
   // Save ratio plots if required
   if (drawRatio) {
     // Needed for error bars
     for (int i = 0; i < fMCHist->GetNbinsX() * fMCHist->GetNbinsY(); i++)
       fMCHist->SetBinError(i + 1, 0.0);
 
     fDataHist->GetSumw2();
     fMCHist->GetSumw2();
 
     // Create Ratio Histograms
     TH2D* dataRatio = (TH2D*)fDataHist->Clone((fName + "_data_RATIO").c_str());
     TH2D* mcRatio = (TH2D*)fMCHist->Clone((fName + "_MC_RATIO").c_str());
 
     mcRatio->Divide(fMCHist);
     dataRatio->Divide(fMCHist);
 
     // Cancel bin errors on MC
     for (int i = 0; i < mcRatio->GetNbinsX() * mcRatio->GetNbinsY(); i++) {
       mcRatio->SetBinError(
-          i + 1, fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1));
+        i + 1, fMCHist->GetBinError(i + 1) / fMCHist->GetBinContent(i + 1));
     }
 
     mcRatio->SetMinimum(0);
     mcRatio->SetMaximum(2);
     dataRatio->SetMinimum(0);
     dataRatio->SetMaximum(2);
 
     mcRatio->Write();
     dataRatio->Write();
 
     delete mcRatio;
     delete dataRatio;
   }
 
   // Save Shape Plots if required
   if (drawShape) {
     // Create Shape Histogram
     TH2D* mcShape = (TH2D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
 
     double shapeScale = 1.0;
     if (fIsRawEvents) {
       shapeScale = fDataHist->Integral() / fMCHist->Integral();
     } else {
       shapeScale = fDataHist->Integral("width") / fMCHist->Integral("width");
     }
 
     mcShape->Scale(shapeScale);
 
     mcShape->SetLineWidth(3);
     mcShape->SetLineStyle(7);  // dashes
 
     mcShape->Write();
 
     // Save shape ratios
     if (drawRatio) {
       // Needed for error bars
       mcShape->GetSumw2();
 
       // Create shape ratio histograms
       TH2D* mcShapeRatio =
-          (TH2D*)mcShape->Clone((fName + "_MC_SHAPE_RATIO").c_str());
+        (TH2D*)mcShape->Clone((fName + "_MC_SHAPE_RATIO").c_str());
       TH2D* dataShapeRatio =
-          (TH2D*)fDataHist->Clone((fName + "_data_SHAPE_RATIO").c_str());
+        (TH2D*)fDataHist->Clone((fName + "_data_SHAPE_RATIO").c_str());
 
       // Divide the histograms
       mcShapeRatio->Divide(mcShape);
       dataShapeRatio->Divide(mcShape);
 
       // Colour the shape ratio plots
       mcShapeRatio->SetLineWidth(3);
       mcShapeRatio->SetLineStyle(7);  // dashes
 
       mcShapeRatio->Write();
       dataShapeRatio->Write();
 
       delete mcShapeRatio;
       delete dataShapeRatio;
     }
 
     delete mcShape;
   }
 
   // Save residual calculations of what contributed to the chi2 values.
   if (residual) {
   }
 
   if (fIsProjFitX or fIsProjFitY or drawProj) {
     // If not already made, make the projections
     if (!fMCHist_X) {
       PlotUtils::MatchEmptyBins(fDataHist, fMCHist);
 
       fMCHist_X = PlotUtils::GetProjectionX(fMCHist, fMaskHist);
       fMCHist_Y = PlotUtils::GetProjectionY(fMCHist, fMaskHist);
 
       fDataHist_X = PlotUtils::GetProjectionX(fDataHist, fMaskHist);
       fDataHist_Y = PlotUtils::GetProjectionY(fDataHist, fMaskHist);
 
       double chi2X = StatUtils::GetChi2FromDiag(fDataHist_X, fMCHist_X);
       double chi2Y = StatUtils::GetChi2FromDiag(fDataHist_Y, fMCHist_Y);
 
       fMCHist_X->SetTitle(Form("%f", chi2X));
       fMCHist_Y->SetTitle(Form("%f", chi2Y));
     }
 
     // Save the histograms
     fDataHist_X->Write();
     fMCHist_X->Write();
 
     fDataHist_Y->Write();
     fMCHist_Y->Write();
   }
 
   if (drawSliceCanvYMC or true) {
     TCanvas* c1 = new TCanvas((fName + "_MC_CANV_Y").c_str(),
                               (fName + "_MC_CANV_Y").c_str(), 800, 600);
 
     c1->Divide(int(sqrt(fDataHist->GetNbinsY() + 1)),
                int(sqrt(fDataHist->GetNbinsY() + 1)));
     TH2D* mcShape = (TH2D*)fMCHist->Clone((fName + "_MC_SHAPE").c_str());
     double shapeScale =
-        fDataHist->Integral("width") / fMCHist->Integral("width");
+      fDataHist->Integral("width") / fMCHist->Integral("width");
     mcShape->Scale(shapeScale);
     mcShape->SetLineStyle(7);
 
     c1->cd(1);
     TLegend* leg = new TLegend(0.6, 0.6, 0.9, 0.9);
     leg->AddEntry(fDataHist, (fName + " Data").c_str(), "ep");
     leg->AddEntry(fMCHist, (fName + " MC").c_str(), "l");
     leg->AddEntry(mcShape, (fName + " Shape").c_str(), "l");
     leg->Draw("SAME");
 
     /*
     // Make Y slices
     for (int i = 0; i < fDataHist->GetNbinY(); i++){
 
       c1->cd(i+2);
       TH1D* fDataHist_SliceY = PlotUtils::GetSliceY(fDataHist, i);
       fDataHist_SliceY->Draw("E1");
 
       TH1D* fMCHist_SliceY = PlotUtils::GetSliceY(fMCHist, i);
       fMCHist_SliceY->Draw("SAME HIST C");
 
       TH1D* mcShape_SliceY = PlotUtils::GetSliceY(mcShape, i);
       mcShape_SliceY->Draw("SAME HIST C");
     }
     */
     c1->Write();
   }
 
   if (drawWeighted) {
     fMCWeighted->Write();
   }
 
   // Returning
   LOG(SAM) << "Written Histograms: " << fName << std::endl;
   return;
-};
 
-THStack Measurement2D::GetModeStack() {
-  THStack combo_hist = PlotUtils::GetNeutModeStack((fName + "_MC_PDG").c_str(),
-                                                   (TH1**)fMCHist_PDG, 0);
-  return combo_hist;
+  // Returning
+  LOG(SAM) << "Written Histograms: " << fName << std::endl;
+  return;
+}
+
+
+
+/*
+  Setup Functions
+*/
+//********************************************************************
+void Measurement2D::SetupMeasurement(std::string inputfile, std::string type,
+                                     FitWeight* rw, std::string fkdt) {
+//********************************************************************
+
+  // Check if name contains Evt, indicating that it is a raw number of events
+  // measurements and should thus be treated as once
+  fIsRawEvents = false;
+  if ((fName.find("Evt") != std::string::npos) && fIsRawEvents == false) {
+    fIsRawEvents = true;
+    LOG(SAM) << "Found event rate measurement but fIsRawEvents == false!"
+             << std::endl;
+    LOG(SAM) << "Overriding this and setting fIsRawEvents == true!"
+             << std::endl;
+  }
+
+  fIsEnu = false;
+  if ((fName.find("XSec") != std::string::npos) &&
+      (fName.find("Enu") != std::string::npos)) {
+    fIsEnu = true;
+    LOG(SAM) << "::" << fName << "::" << std::endl;
+    LOG(SAM) << "Found XSec Enu measurement, applying flux integrated scaling, "
+             "not flux averaged!"
+             << std::endl;
+    if (FitPar::Config().GetParB("EventManager")) {
+      ERR(FTL) << "Enu Measurements do not yet work with the Event Manager!"
+               << std::endl;
+      ERR(FTL) << "If you want decent flux unfolded results please run in "
+               "series mode (-q EventManager=0)"
+               << std::endl;
+      sleep(2);
+    }
+  }
+
+  if (fIsEnu && fIsRawEvents) {
+    LOG(SAM) << "Found 1D Enu XSec distribution AND fIsRawEvents, is this "
+             "really correct?!"
+             << std::endl;
+    LOG(SAM) << "Check experiment constructor for " << fName
+             << " and correct this!" << std::endl;
+    LOG(SAM) << "I live in " << __FILE__ << ":" << __LINE__ << std::endl;
+    exit(-1);
+  }
+
+  // Reset everything to NULL
+  fRW = rw;
+
+  // Setting up 2D Inputs
+  this->SetupInputs(inputfile);
+
+  // Set Default Options
+  SetFitOptions(fDefaultTypes);
+
+  // Set Passed Options
+  SetFitOptions(type);
 }
+
+//********************************************************************
+void Measurement2D::SetupDefaultHist() {
+  //********************************************************************
+
+  // Setup fMCHist
+  fMCHist = (TH2D*)fDataHist->Clone();
+  fMCHist->SetNameTitle((fName + "_MC").c_str(),
+                        (fName + "_MC" + fPlotTitles).c_str());
+
+  // Setup fMCFine
+  Int_t nBinsX = fMCHist->GetNbinsX();
+  Int_t nBinsY = fMCHist->GetNbinsY();
+  fMCFine = new TH2D((fName + "_MC_FINE").c_str(),
+                     (fName + "_MC_FINE" + fPlotTitles).c_str(), nBinsX * 3,
+                     fMCHist->GetXaxis()->GetBinLowEdge(1),
+                     fMCHist->GetXaxis()->GetBinLowEdge(nBinsX + 1), nBinsY * 3,
+                     fMCHist->GetYaxis()->GetBinLowEdge(1),
+                     fMCHist->GetYaxis()->GetBinLowEdge(nBinsY + 1));
+
+  // Setup MC Stat
+  fMCStat = (TH2D*)fMCHist->Clone();
+  fMCStat->Reset();
+
+
+  // Setup the NEUT Mode Array
+  PlotUtils::CreateNeutModeArray(fMCHist, (TH1**)fMCHist_PDG);
+
+  // Setup bin masks using sample name
+  if (fIsMask) {
+    std::string maskloc = FitPar::Config().GetParDIR(fName + ".mask");
+    if (maskloc.empty()) {
+      maskloc = FitPar::GetDataBase() + "/masks/" + fName + ".mask";
+    }
+
+    SetBinMask(maskloc);
+  }
+
+  return;
+}
+
+
+//********************************************************************
+void Measurement2D::SetDataValues(std::string dataFile, std::string TH2Dname) {
+  //********************************************************************
+
+  if (dataFile.find(".root") == std::string::npos) {
+    ERR(FTL) << "Error! " << dataFile << " is not a .root file" << std::endl;
+    ERR(FTL) << "Currently only .root file reading is supported (MiniBooNE "
+             "CC1pi+ 2D), but implementing .txt should be dirt easy"
+             << std::endl;
+    ERR(FTL) << "See me at " << __FILE__ << ":" << __LINE__ << std::endl;
+    exit(-1);
+
+  } else {
+    TFile* inFile = new TFile(dataFile.c_str(), "READ");
+    fDataHist = (TH2D*)(inFile->Get(TH2Dname.c_str())->Clone());
+    fDataHist->SetDirectory(0);
+
+    fDataHist->SetNameTitle((fName + "_data").c_str(),
+                            (fName + "_MC" + fPlotTitles).c_str());
+
+    delete inFile;
+  }
+
+  return;
+}
+
+//********************************************************************
+void Measurement2D::SetDataValues(std::string dataFile, double dataNorm,
+                                  std::string errorFile, double errorNorm) {
+  //********************************************************************
+
+  // Make a counter to track the line number
+  int yBin = 0;
+
+  std::string line;
+  std::ifstream data(dataFile.c_str(), ifstream::in);
+
+  fDataHist = new TH2D((fName + "_data").c_str(), (fName + fPlotTitles).c_str(),
+                       fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
+
+  if (data.is_open())
+    LOG(SAM) << "Reading data from: " << dataFile.c_str() << std::endl;
+
+  while (std::getline(data >> std::ws, line, '\n')) {
+    int xBin = 0;
+
+    // Loop over entries and insert them into the histogram
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      fDataHist->SetBinContent(xBin + 1, yBin + 1, (*iter) * dataNorm);
+      xBin++;
+    }
+    yBin++;
+  }
+
+  yBin = 0;
+  std::ifstream error(errorFile.c_str(), ifstream::in);
+
+  if (error.is_open())
+    LOG(SAM) << "Reading errors from: " << errorFile.c_str() << std::endl;
+
+  while (std::getline(error >> std::ws, line, '\n')) {
+    int xBin = 0;
+
+    // Loop over entries and insert them into the histogram
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      fDataHist->SetBinError(xBin + 1, yBin + 1, (*iter) * errorNorm);
+      xBin++;
+    }
+    yBin++;
+  }
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::SetDataValuesFromText(std::string dataFile,
+    double dataNorm) {
+  //********************************************************************
+
+  fDataHist = new TH2D((fName + "_data").c_str(), (fName + fPlotTitles).c_str(),
+                       fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
+
+  LOG(SAM) << "Reading data from: " << dataFile << std::endl;
+  PlotUtils::Set2DHistFromText(dataFile, fDataHist, dataNorm, true);
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::SetCovarMatrix(std::string covarFile) {
+  //********************************************************************
+
+  // Used to read a covariance matrix from a root file
+  TFile* tempFile = new TFile(covarFile.c_str(), "READ");
+
+  // Make plots that we want
+  TH2D* covarPlot = new TH2D();
+  //  TH2D* decmpPlot = new TH2D();
+  TH2D* covarInvPlot = new TH2D();
+  TH2D* fFullCovarPlot = new TH2D();
+
+  // Get covariance options for fake data studies
+  std::string covName = "";
+  std::string covOption = FitPar::Config().GetParS("throw_covariance");
+
+  // Which matrix to get?
+  if (fIsShape || fIsFree) covName = "shp_";
+  if (fIsDiag)
+    covName += "diag";
+  else
+    covName += "full";
+
+  covarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  covarInvPlot = (TH2D*)tempFile->Get((covName + "covinv").c_str());
+
+  // Throw either the sub matrix or the full matrix
+  if (!covOption.compare("SUB"))
+    fFullCovarPlot = (TH2D*)tempFile->Get((covName + "cov").c_str());
+  else if (!covOption.compare("FULL"))
+    fFullCovarPlot = (TH2D*)tempFile->Get("fullcov");
+  else
+    ERR(WRN) << " Incorrect thrown_covariance option in parameters."
+             << std::endl;
+
+  // Bin masking?
+  int dim = int(fDataHist->GetNbinsX());  //-this->masked->Integral());
+  int covdim = int(fDataHist->GetNbinsX());
+
+  // Make new covars
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  fDecomp = new TMatrixDSym(dim);
+
+  // Full covariance values
+  int row, column = 0;
+  row = 0;
+  column = 0;
+  for (Int_t i = 0; i < covdim; i++) {
+    // masking can be dodgy
+    // if (this->masked->GetBinContent(i+1) > 0) continue;
+    for (Int_t j = 0; j < covdim; j++) {
+      //   if (this->masked->GetBinContent(j+1) > 0) continue;
+      (*this->covar)(row, column) = covarPlot->GetBinContent(i + 1, j + 1);
+      (*fFullCovar)(row, column) = fFullCovarPlot->GetBinContent(i + 1, j + 1);
+
+      column++;
+    }
+    column = 0;
+    row++;
+  }
+
+  // Set bin errors on data
+  if (!fIsDiag) {
+    for (Int_t i = 0; i < fDataHist->GetNbinsX(); i++) {
+      fDataHist->SetBinError(
+        i + 1, sqrt((covarPlot->GetBinContent(i + 1, i + 1))) * 1E-38);
+    }
+  }
+
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  tempFile->Close();
+  delete tempFile;
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::SetCovarMatrixFromText(std::string covarFile, int dim) {
+  //********************************************************************
+
+  // Make a counter to track the line number
+  int row = 0;
+
+  std::string line;
+  std::ifstream covar(covarFile.c_str(), ifstream::in);
+
+  this->covar = new TMatrixDSym(dim);
+  fFullCovar = new TMatrixDSym(dim);
+  if (covar.is_open())
+    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
+             << std::endl;
+
+  while (std::getline(covar >> std::ws, line, '\n')) {
+    int column = 0;
+
+    // Loop over entries and insert them into matrix
+    // Multiply by the errors to get the covariance, rather than the correlation
+    // matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      double val = (*iter) * fDataHist->GetBinError(row + 1) * 1E38 *
+                   fDataHist->GetBinError(column + 1) * 1E38;
+      (*this->covar)(row, column) = val;
+      (*fFullCovar)(row, column) = val;
+
+      column++;
+    }
+
+    row++;
+  }
+
+  // Robust matrix inversion method
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  return;
+};
+
+//********************************************************************
+void Measurement2D::SetCovarMatrixFromChol(std::string covarFile, int dim) {
+  //********************************************************************
+
+  // Make a counter to track the line number
+  int row = 0;
+
+  std::string line;
+  std::ifstream covarread(covarFile.c_str(), ifstream::in);
+
+  TMatrixD* newcov = new TMatrixD(dim, dim);
+
+  if (covarread.is_open())
+    LOG(SAM) << "Reading covariance matrix from file: " << covarFile
+             << std::endl;
+  while (std::getline(covarread >> std::ws, line, '\n')) {
+    int column = 0;
+
+    // Loop over entries and insert them into matrix
+    // Multiply by the errors to get the covariance, rather than the correlation
+    // matrix
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+      (*newcov)(row, column) = *iter;
+      column++;
+    }
+
+    row++;
+  }
+  covarread.close();
+
+  // Form full covariance
+  TMatrixD* trans = (TMatrixD*)(newcov)->Clone();
+  trans->T();
+  (*trans) *= (*newcov);
+
+  fFullCovar = new TMatrixDSym(dim, trans->GetMatrixArray(), "");
+
+  delete newcov;
+  delete trans;
+
+  // Robust matrix inversion method
+  TDecompChol LU = TDecompChol(*this->fFullCovar);
+  this->covar = new TMatrixDSym(dim, LU.Invert().GetMatrixArray(), "");
+
+  return;
+};
+
+// //********************************************************************
+// void Measurement2D::SetMapValuesFromText(std::string dataFile) {
+// //********************************************************************
+
+//   fMapHist = new TH2I((fName + "_map").c_str(), (fName + fPlotTitles).c_str(),
+//                       fNDataPointsX - 1, fXBins, fNDataPointsY - 1, fYBins);
+
+//   LOG(SAM) << "Reading map from: " << dataFile << std::endl;
+//   PlotUtils::Set2DHistFromText(dataFile, fMapHist, 1.0);
+
+//   return;
+// };
+
+
diff --git a/src/FitBase/Measurement2D.h b/src/FitBase/Measurement2D.h
index b683437..43d3771 100644
--- a/src/FitBase/Measurement2D.h
+++ b/src/FitBase/Measurement2D.h
@@ -1,263 +1,633 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MEASUREMENT_2D_HXX_SEEN
 #define MEASUREMENT_2D_HXX_SEEN
 
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
 #include <math.h>
 #include <stdlib.h>
 #include <deque>
 #include <fstream>
 #include <iomanip>
 #include <iostream>
 #include <numeric>
 #include <sstream>
 #include <string>
 
 // ROOT includes
 #include <TArrayF.h>
 #include <TDecompSVD.h>
 #include <TGraph.h>
 #include <TGraphErrors.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <TMatrixDSym.h>
 #include <TROOT.h>
 #include <TSystem.h>
 
 // External data fit includes
 #include "FitEvent.h"
 #include "FitParameters.h"
 #include "FitUtils.h"
 #include "MeasurementBase.h"
 #include "PlotUtils.h"
 #include "SignalDef.h"
 #include "StatUtils.h"
+#include "MeasurementVariableBox2D.h"
 
 //********************************************************************
 //! 2D Measurement base class. Histogram handling is done in this base layer.
 class Measurement2D : public MeasurementBase {
   //********************************************************************
 
- public:
+public:
   /*
     Constructor/Deconstuctor
   */
 
   //! Default Constructor
   Measurement2D();
 
   //! Default Destructor
   virtual ~Measurement2D();
 
   /*
     Setup Functions
   */
 
-  //! Intial setup of common measurement variables. Parse input files, types,
-  //! etc.
-  virtual void SetupMeasurement(std::string input, std::string type,
-                                FitWeight* rw, std::string fkdt);
+  /// \brief Setup all configs once initialised
+  ///
+  /// Should be called after all configs have been setup inside fSettings container.
+  /// Handles the processing of inputs and setting up of types.
+  /// Replaces the old 'SetupMeasurement' function.
+  void FinaliseSampleSettings();
+
+  /// \brief Creates the 2D data distribution given the binning provided.
+  virtual void CreateDataHistogram(int dimx, double* binx, int dimy, double* biny);
+
+
+  /// \brief Set Data Histogram from a list of contents in a text file
+  ///
+  /// Assumes the format: \n
+  /// x_low_1  y_low_1  cont_11  err_11 \n
+  /// x_low_1  y_low_2  cont_12  err_12 \n
+  /// x_low_2  y_low_1  cont_21  err_21 \n
+  /// x_low_2  y_low_2  cont_22  err_22 \n
+  /// x_low_2  y_low_3  cont_23  err_23 \n
+  /// x_low_3  y_low_2  cont_32  err_32 \n
+  virtual void SetDataFromTextFile(std::string datfile);
+
+
+  /// \brief Set Data Histogram from a TH2D in a file
+  ///
+  /// - datfile = Full path to data file
+  /// - histname = Name of histogram
+  ///
+  /// If histname not given it assumes that datfile
+  /// is in the format: \n
+  /// 'file.root;histname'
+  virtual void SetDataFromRootFile(std::string datfile, std::string histname="");
+
+
+  /// \brief Set data values from a 2D array in text file
+  ///
+  /// \warning requires DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Assumes form: \n
+  /// cont_11 cont_12 ... cont_1N \n
+  /// cont_21 cont_22 ... cont_2N \n
+  /// ...     ...     ... ...     \n
+  /// cont_N1 cont_N2 ... cont_NN \n
+  virtual void SetDataValuesFromTextFile(std::string datfile, TH2D* hist = NULL);
+
+
+  /// \brief Set data errors from a 2D array in text file
+  ///
+  /// \warning requires DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Assumes form: \n
+  /// errs_11 errs_12 ... errs_1N \n
+  /// errs_21 errs_22 ... errs_2N \n
+  /// ...     ...     ... ...     \n
+  /// errs_N1 errs_N2 ... errs_NN \n
+  virtual void SetDataErrorsFromTextFile(std::string datfile, TH2D* hist = NULL);
+
+
+  /// \brief Set data bin errors to sqrt(entries)
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Sets the data errors as the sqrt of the bin contents
+  /// Should be use for counting experiments
+  virtual void SetPoissonErrors();
+
+  /// \brief Make diagonal covariance from data
+  ///
+  /// \warning If no histogram passed, data must be setup first!
+  /// Setup the covariance inputs by taking the data histogram
+  /// errors and setting up a diagonal covariance matrix.
+  ///
+  /// If no data is supplied, fDataHist is used if already set.
+  virtual void SetCovarFromDiagonal(TH2D* data = NULL);
+
+  /// \brief Read the data covariance from a text file.
+  ///
+  /// Inputfile should have the format: \n
+  /// covariance_11  covariance_12  covariance_13 ... \n
+  /// covariance_21  covariance_22  covariance_23 ... \n
+  /// ...            ...            ...           ... \n
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data covariance from a ROOT file.
+  ///
+  /// - covfile specifies the full path to the file
+  /// - histname specifies the name of the covariance object. Both TMatrixDSym and TH2D are supported.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarFromRootFile(std::string covfile, std::string histname="");
+
+  /// \brief Read the inverted data covariance from a text file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCovarInvertFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the inverted data covariance from a ROOT file.
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCovarInvertFromRootFile(std::string covfile, std::string histname="");
+
+  /// \brief Read the data correlations from a text file.
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCorrelationFromTextFile(std::string covfile, int dim = -1);
+
+  /// \brief Read the data correlations from a ROOT file.
+  ///
+  /// \warning REQUIRES DATA TO BE SET FIRST
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCorrelationFromRootFile(std::string covfile, std::string histname="");
+
+
+  /// \brief Read the cholesky decomposed covariance from a text file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromTextFile.
+  ///
+  /// If no dimensions are given, it is assumed from the number
+  /// entries in the first line of covfile.
+  virtual void SetCholDecompFromTextFile(std::string covfile, int dim = -1);
+
+
+  /// \brief Read the cholesky decomposed covariance from a ROOT file and turn it into a covariance
+  ///
+  /// Inputfile should have similar format to that shown
+  /// in SetCovarFromRootFile.
+  ///
+  /// If no histogram name is given the inhistfile value
+  /// is automatically parsed with ; so that: \n
+  /// mycovfile.root;myhistname \n
+  /// will also work.
+  virtual void SetCholDecompFromRootFile(std::string covfile, std::string histname="");
+
+
+  /// \brief Read the map values from a text file
+  ///
+  /// \warning Requires DATA hist to be set beforehand.
+  /// Format should be a 2D array of mappings. 
+  /// -1 indicates empty bins. \n
+  /// e.g.: \n
+  ///  1  2  3  4  5 \n
+  /// -1  6  7  8  9 \n
+  /// -1 -1 10 11 -1 \n
+  virtual void SetMapValuesFromText(std::string dataFile);
 
-  //! Setup the default mc Hist given a data histogram
-  virtual void SetupDefaultHist();
 
-  //! Parse the fit type to get fit options
+  /// \brief Scale the data by some scale factor
+  virtual void ScaleData(double scale);
+
+
+  /// \brief Scale the data error bars by some scale factor
+  virtual void ScaleDataErrors(double scale);
+
+
+  /// \brief Scale the covariaince and its invert/decomp by some scale factor.
+  virtual void ScaleCovar(double scale);
+
+
+  /// \brief Setup a bin masking histogram and apply masking to data
+  ///
+  /// \warning REQUIRES DATA HISTOGRAM TO BE SET FIRST
+  ///
+  /// Reads in a list of bins in a text file to be masked. Format is: \n
+  /// bin_index_x_1 bin_index_y_1 1 \n
+  /// bin_index_x_2 bin_index_y_2 1 \n
+  /// bin_index_x_3 bin_index_y_3 1 \n
+  ///
+  /// If 0 is given then a bin entry will NOT be masked. So for example: \n\n
+  /// 1 1  1 \n
+  /// 2 0 1 \n
+  /// 3 4 0 \n
+  /// 4 0 1 \n\n
+  /// Will mask only the (1,1), (2,0), and (4,0) bins.
+  ///
+  /// Masking can be turned on by specifiying the MASK option when creating a sample.
+  /// When this is passed NUISANCE will look in the following locations for the mask file:
+  /// - FitPar::Config().GetParS(fName + ".mask")
+  /// - "data/masks/" + fName + ".mask";
+  virtual void SetBinMask(std::string maskfile);
+
+  /// \brief Set the current fit options from a string.
+  ///
+  /// This is called twice for each sample, once to set the default
+  /// and once to set the current setting (if anything other than default given)
+  ///
+  /// For this to work properly it requires the default and allowed types to be
+  /// set correctly. These should be specified as a string listing options.
+  ///
+  /// To split up options so that NUISANCE can automatically detect ones that
+  /// are conflicting. Any options seperated with the '/' symbol are non conflicting
+  /// and can be given together, whereas any seperated with the ',' symbol cannot
+  /// be specified by the end user at the same time.
+  ///
+  /// Default Type Examples:
+  /// - DIAG/FIX = Default option will be a diagonal covariance, with FIXED norm.
+  /// - MASK/SHAPE = Default option will be a masked hist, with SHAPE always on.
+  ///
+  /// Allowed Type examples:
+  /// - 'FULL/DIAG/NORM/MASK' = Any of these options can be specified.
+  /// - 'FULL,FREE,SHAPE/MASK/NORM' = User can give either FULL, FREE, or SHAPE as on option.
+  /// MASK and NORM can also be included as options.
   virtual void SetFitOptions(std::string opt);
 
-  //! Set the data values and errors from two files
-  virtual void SetDataValues(std::string dataFile, double dataNorm,
-                             std::string errorFile, double errorNorm);
-  virtual void SetDataValues(std::string dataFile, std::string TH2Dname);
+  /// \brief Final constructor setup
+  /// \warning Should be called right at the end of the constructor.
+  ///
+  /// Contains a series of checks to ensure the data and inputs have been setup.
+  /// Also creates the MC histograms needed for fitting.
+  void FinaliseMeasurement();
 
-  //! Set the data values only from a text file
-  virtual void SetDataValuesFromText(std::string dataFile, double norm);
-
-  //! Read a covariance matrix from a file (Default name "covar" in file)
-  virtual void SetCovarMatrix(std::string covarFile);
 
-  //! Set the covariance matrix from a text file
-  virtual void SetCovarMatrixFromText(std::string covarFile, int dim);
 
-  //! Set the covariance matrix from a text file containing the cholesky
-  //! fDecomposition
-  virtual void SetCovarMatrixFromChol(std::string covarFile, int dim);
-
-  // virtual void SetMaskValuesFromText(std::string dataFile);
+  /*
+    Reconfigure
+  */
 
-  //! Read in a histogram 2Dto1D map from a text file
-  virtual void SetMapValuesFromText(std::string dataFile);
+  /// \brief Create a Measurement1D box
+  ///
+  /// Creates a new 1D variable box containing just fXVar.
+  ///
+  /// This box is the bare minimum required by the JointFCN when
+  /// running fast reconfigures during a routine.
+  /// If for some reason a sample needs extra variables to be saved then
+  /// it should override this function creating its own MeasurementVariableBox
+  /// that contains the extra variables.
+  virtual MeasurementVariableBox* CreateBox() {return new MeasurementVariableBox2D();};
+
+  /// \brief Reset all MC histograms
+  ///
+  /// Resets all standard histograms and those registered to auto
+  /// process to zero.
+  ///
+  /// If extra histograms are not included in auto processing, then they must be reset
+  /// by overriding this function and doing it manually if required.
+  virtual void ResetAll(void);
+
+  /// \brief Fill MC Histograms from XVar, YVar
+  ///
+  /// Fill standard histograms using fXVar, fYVar, Weight read from the variable box.
+  ///
+  /// WARNING : Any extra MC histograms need to be filled by overriding this function,
+  /// even if they have been set to auto process.
+  virtual void FillHistograms(void);
+
+  // \brief Convert event rates to final histogram
+  ///
+  /// Apply standard scaling procedure to standard mc histograms to convert from
+  /// raw events to xsec prediction.
+  ///
+  /// If any distributions have been set to auto process
+  /// that is done during this function call, and a differential xsec is assumed.
+  /// If that is not the case this function must be overriden.
+  virtual void ScaleEvents(void);
+
+  /// \brief Scale MC by a factor=1/norm
+  ///
+  /// Apply a simple normalisation scaling if the option FREE or a norm_parameter
+  /// has been specified in the NUISANCE routine.
+  virtual void ApplyNormScale(double norm);
 
-  //! Set the bin mask for a 2D histogram (list: bini, binj, MaskFlag)
-  virtual void SetBinMask(std::string maskFile);
 
-  // virtual void ReadHistogramFile();
 
   /*
-    XSec Functions
+    Statistical Functions
   */
-  // // ! Set the flux from a text file
-  // virtual void SetFluxHistogram(std::string fluxFile, int minE, int maxE,
-  // double fluxNorm);
 
-  // //! Get the integrated flux between this measurements energy ranges
-  // virtual double TotalIntegratedFlux(std::string intOpt="width",double
-  // low=-9999.9, double high=-9999.9);
+  /// \brief Get Number of degrees of freedom
+  ///
+  /// Returns the number bins inside the data histogram accounting for
+  /// any bin masking applied.
+  virtual int GetNDOF(bool applymasking=true);
 
-  /*
-    Reconfigure LOOP
-  */
+  /// \brief Return Data/MC Likelihood at current state
+  ///
+  /// Returns the likelihood of the data given the current MC prediction.
+  /// Diferent likelihoods definitions are used depending on the FitOptions.
+  virtual double GetLikelihood(void);
 
-  //! Reset the MC Histograms to zero
-  virtual void ResetAll();
 
-  //! Fill the histograms given fXVar, fYVar, and Weight for this event
-  virtual void FillHistograms();
 
-  //! Apply event scaling to XSec values after reconfigure has been called
-  virtual void ScaleEvents();
 
-  //! Apply a normalisation scale in free normalisation fits after reconfigure
-  //! has been called
-  virtual void ApplyNormScale(double norm);
 
   /*
-    Statistic Functions - Outsources to StatUtils
-   */
+    Fake Data
+  */
+
+  /// \brief Set the fake data values from either a file, or MC
+  ///
+  /// - Setting from a file "path": \n
+  /// When reading from a file the full path must be given to a standard
+  /// nuisance output. The standard MC histogram should have a name that matches
+  /// this sample for it to be read in.
+  /// \n\n
+  /// - Setting from "MC": \n
+  /// If the MC option is given the current MC prediction is used as fake data.
+  virtual void SetFakeDataValues(std::string fakeOption);
 
-  //! Get the Number of degrees of freedom accounting for bin masking
-  virtual int GetNDOF();
+  /// \brief Reset fake data back to starting fake data
+  ///
+  /// Reset the fake data back to original fake data (Reset back to before
+  /// ThrowCovariance was first called)
+  virtual void ResetFakeData(void);
 
-  //! Get the likelihood at current state
-  virtual double GetLikelihood();
+  /// \brief Reset fake data back to original data
+  ///
+  /// Reset the data histogram back to the true original dataset for this sample
+  /// before any fake data was defined.
+  virtual void ResetData(void);
+
+  /// \brief Generate fake data by throwing the covariance.
+  ///
+  /// Can be used on fake MC data or just the original dataset.
+  /// Call ResetFakeData or ResetData to return to values before the throw.
+  virtual void ThrowCovariance(void);
 
-  /*
-    Fake Data Functions
-  */
 
-  //! Set fake data values from MC. Use external file, or current MC prediction
-  //! using option "MC"
-  virtual void SetFakeDataValues(std::string fakeOption);
-  // virtual void ResetFakeData();
-  // virtual void ResetData();
 
-  //! Use the covariance to throw fake data from the current fDataHist
-  virtual void ThrowCovariance();
 
-  virtual THStack GetModeStack();
 
   /*
     Access Functions
   */
 
-  TH2D* GetMCHistogram() { return fMCHist; };
-  TH2D* GetDataHistogram() { return fDataHist; };
-
-  virtual std::vector<TH1*> GetMCList();
-  virtual std::vector<TH1*> GetDataList();
-  virtual std::vector<TH1*> GetMaskList() {
+  /// \brief Returns nicely formatted MC Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - linecolor
+  /// - linestyle
+  /// - linewidth
+  /// - fillcolor
+  /// - fillstyle
+  ///
+  /// So to have a sample line colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// linecolor="2" linestyle="7"  linewidth="2" />
+  virtual TH2D* GetMCHistogram(void);
+
+  /// \brief Returns nicely formatted data Histogram
+  ///
+  /// Format options can also be given in the samplesettings:
+  /// - datacolor
+  /// - datastyle
+  /// - datawidth
+  ///
+  /// So to have a sample data colored differently in the xml cardfile put: \n
+  /// <sample name="MiniBooNE_CCQE_XSec_1DQ2_nu" input="NEUT:input.root"
+  /// datacolor="2" datastyle="7"  datawidth="2" />
+  virtual TH2D* GetDataHistogram(void);
+
+  /// \brief Returns a list of all MC histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetMCList(void) {
+    return std::vector<TH1*>(1, GetMCHistogram());
+  }
+
+  /// \brief Returns a list of all Data histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetDataList(void) {
+    return std::vector<TH1*>(1, GetDataHistogram());
+  }
+
+  /// \brief Returns a list of all Mask histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetMaskList(void) {
     return std::vector<TH1*>(1, fMaskHist);
   };
-  virtual std::vector<TH1*> GetFineList() {
+
+  /// \brief Returns a list of all Fine histograms.
+  ///
+  /// Override this if you have extra histograms that need to be
+  /// accessed outside of the Measurement1D class.
+  inline virtual std::vector<TH1*> GetFineList(void) {
     return std::vector<TH1*>(1, fMCFine);
   };
 
-  //! Get bin contents and errors from fMCHist and fill a vector with them
-  virtual void GetBinContents(std::vector<double>& cont,
-                              std::vector<double>& err);
-
-  //! Get covariance matrix as a pretty plot
-  virtual TH2D GetCovarMatrix() { return TH2D(*covar); };
-
-  //! Get Integrated XSec (option flags whether to get data or MC)
-  virtual std::vector<double> GetXSec(std::string option);
 
   /*
     Write Functions
   */
-
-  //! Save Histograms to the current directory
+  /// \brief Save the current state to the current TFile directory \n
+  ///
+  /// Data/MC are both saved by default.
+  /// A range of other histograms can be saved by setting the
+  /// config option 'drawopts'.
+  ///
+  /// Possible options: \n
+  /// - FINE    = Write Fine Histogram \n
+  /// - WEIGHTS = Write Weighted MC Histogram (before scaling) \n
+  /// - FLUX    = Write Flux Histogram from MC Input \n
+  /// - EVT     = Write Event Histogram from MC Input \n
+  /// - XSEC    = Write XSec Histogram from MC Input \n
+  /// - MASK    = Write Mask Histogram \n
+  /// - COV     = Write Covariance Histogram \n
+  /// - INVCOV  = Write Inverted Covariance Histogram \n
+  /// - DECMOP  = Write Decomp. Covariance Histogram \n
+  /// - RESIDUAL= Write Resudial Histograms \n
+  /// - RATIO   = Write Data/MC Ratio Histograms \n
+  /// - SHAPE   = Write MC Shape Histograms norm. to Data \n
+  /// - CANVMC  = Build MC Canvas Showing Data, MC, Shape \n
+  /// - MODES   = Write PDG Stack \n
+  /// - CANVPDG = Build MC Canvas Showing Data, PDGStack \n
+  ///
+  /// So to save a range of these in parameters/config.xml set: \n
+  /// <config drawopts='FINE/COV/SHAPE/RATIO' />
   virtual void Write(std::string drawOpt);
 
- protected:
+
+
+
+
+
+  //////// OLD FUNCTIONS ////////////
+
+
+  //! Intial setup of common measurement variables. Parse input files, types,
+  //! etc.
+  virtual void SetupMeasurement(std::string input, std::string type,
+                                FitWeight* rw, std::string fkdt);
+
+  //! Setup the default mc Hist given a data histogram
+  virtual void SetupDefaultHist();
+
+  //! Set the data values and errors from two files
+  virtual void SetDataValues(std::string dataFile, double dataNorm,
+                             std::string errorFile, double errorNorm);
+  virtual void SetDataValues(std::string dataFile, std::string TH2Dname);
+
+  //! Set the data values only from a text file
+  virtual void SetDataValuesFromText(std::string dataFile, double norm);
+
+  //! Read a covariance matrix from a file (Default name "covar" in file)
+  virtual void SetCovarMatrix(std::string covarFile);
+
+  //! Set the covariance matrix from a text file
+  virtual void SetCovarMatrixFromText(std::string covarFile, int dim);
+
+  //! Set the covariance matrix from a text file containing the cholesky
+  //! fDecomposition
+  virtual void SetCovarMatrixFromChol(std::string covarFile, int dim);
+
+protected:
   // The data histograms
   TH2D* fDataHist;    //!< default data histogram (use in chi2 calculations)
   TH2D* fDataOrig;    //!< histogram to store original data before throws.
   TH2D* fDataTrue;    //!< histogram to store true dataset
   TH1D* fDataHist_X;  //!< Projections onto X of the fDataHist
   TH1D* fDataHist_Y;  //!< Projections onto Y of the fDataHist
 
   // The MC histograms
   TH2D* fMCHist;          //!< MC Histogram (used in chi2 calculations)
   TH2D* fMCFine;          //!< Finely binned MC Histogram
   TH2D* fMCHist_PDG[61];  //!< MC Histograms for each interaction mode
   TH1D* fMCHist_X;        //!< Projections onto X of the fMCHist
   TH1D* fMCHist_Y;        //!< Projections onto Y of the fMCHist
   TH2D* fMCWeighted;      //!< Raw Event Weights
+  TH2D* fMCStat;
 
   TH2I* fMaskHist;  //!< mask histogram for the data
   TH2I* fMapHist;   //!< map histogram used to convert 2D to 1D distributions
 
   bool fIsFakeData;          //!< is current data actually fake
   std::string fakeDataFile;  //!< MC fake data input file
 
   std::string fPlotTitles;  //!< X and Y plot titles.
   std::string fFitType;
   std::string fDefaultTypes;  //!< Default Fit Options
   std::string fAllowedTypes;  //!< Any allowed Fit Options
 
   TMatrixDSym* covar;       //!< inverted covariance matrix
   TMatrixDSym* fFullCovar;  //!< covariance matrix
   TMatrixDSym* fDecomp;     //!< fDecomposed covariance matrix
   TMatrixDSym* fCorrel;     //!< correlation matrix
   double fCovDet;           //!< covariance deteriminant
   double fNormError;        //!< Normalisation on the error on the data
 
   Double_t* fXBins;     //!< X Bin Edges
   Double_t* fYBins;     //!< Y Bin Edges
   Int_t fNDataPointsX;  //!< Number of X data points
   Int_t fNDataPointsY;  //!< NUmber of Y data points
 
   // Fit specific flags
   bool fIsShape;      //!< Flag: Perform shape-only fit
   bool fIsFree;       //!< Flag: Perform normalisation free fit
   bool fIsDiag;       //!< Flag: Only use diagonal bin errors in stats
   bool fIsMask;       //!< Flag: Apply bin masking
   bool fIsRawEvents;  //!< Flag: Only event rates in histograms
   bool fIsEnu;        //!< Needs Enu Unfolding
   bool fIsChi2SVD;    //!< Flag: Chi2 SVD Method (DO NOT USE)
   bool fAddNormPen;   //!< Flag: Add normalisation penalty to fi
   bool fIsProjFitX;  //!< Flag: Use 1D projections onto X and Y to calculate the
-                     //!Chi2 Method. If flagged X will be used to set the rate.
+  //!Chi2 Method. If flagged X will be used to set the rate.
   bool fIsProjFitY;  //!< Flag: Use 1D projections onto X and Y to calculate the
-                     //!Chi2 Method. If flagged Y will be used to set the rate.
+  //!Chi2 Method. If flagged Y will be used to set the rate.
   bool fIsFix;       //!< Flag: Fixed Histogram Norm
   bool fIsFull;      //!< Flag; Use Full Covar
   bool fIsDifXSec;   //!< Flag: Differential XSec
   bool fIsEnu1D;     //!< Flag: Flux Unfolded XSec
   bool fIsChi2;      //!< Flag; Use Chi2 over LL
+
+
+  TrueModeStack* fMCHist_Modes; ///< Optional True Mode Stack
+
+  TMatrixDSym* fCovar;    ///< New FullCovar
+  TMatrixDSym* fInvert;   ///< New covar
+
+
+  // Fake Data
+  std::string fFakeDataInput;  ///< Input fake data file path
+  TFile* fFakeDataFile;        ///< Input fake data file
+
+  // Arrays for data entries
+  Double_t* fDataValues;  ///< REMOVE data bin contents
+  Double_t* fDataErrors;  ///< REMOVE data bin errors
+
 };
 
 /*! @} */
 #endif
diff --git a/src/FitBase/MeasurementBase.cxx b/src/FitBase/MeasurementBase.cxx
index e2e2524..013facf 100644
--- a/src/FitBase/MeasurementBase.cxx
+++ b/src/FitBase/MeasurementBase.cxx
@@ -1,458 +1,536 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MeasurementBase.h"
 
 /*
   Constructor/Destructors
 */
 
 //********************************************************************
 // 2nd Level Constructor (Inherits From MeasurementBase.h)
-MeasurementBase::MeasurementBase() {
+MeasurementBase::MeasurementBase(void) {
   //********************************************************************
 
   fScaleFactor = 1.0;
   fMCFilled = false;
   fNoData = false;
   fInput = NULL;
 
   // Set the default values
   // After-wards this gets set in SetupMeasurement
   EnuMin = 0.;
   EnuMax = 1.E5;
 
   fMeasurementSpeciesType = kSingleSpeciesMeasurement;
+  fEventVariables = NULL;
+  fIsJoint = false;
 };
 
+void MeasurementBase::FinaliseMeasurement() {
+
+  // Used to setup default data hists, covars, etc.
+
+
+
+}
+
 //********************************************************************
 // 2nd Level Destructor (Inherits From MeasurementBase.h)
-MeasurementBase::~MeasurementBase(){
-    //********************************************************************
+MeasurementBase::~MeasurementBase() {
+  //********************************************************************
 
 };
 
 //********************************************************************
 double MeasurementBase::TotalIntegratedFlux(std::string intOpt, double low,
-                                            double high) {
-  //********************************************************************
+    double high) {
+//********************************************************************
 
   // Set Energy Limits
   if (low == -9999.9) low = this->EnuMin;
   if (high == -9999.9) high = this->EnuMax;
-
   return GetInput()->TotalIntegratedFlux(low, high, intOpt);
 };
 
 //********************************************************************
 double MeasurementBase::PredictedEventRate(std::string intOpt, double low,
-                                           double high) {
+    double high) {
   //********************************************************************
 
   // Set Energy Limits
   if (low == -9999.9) low = this->EnuMin;
   if (high == -9999.9) high = this->EnuMax;
 
   return GetInput()->PredictedEventRate(low, high, intOpt) * 1E-38;
 };
 
 //********************************************************************
 void MeasurementBase::SetupInputs(std::string inputfile) {
   //********************************************************************
 
+
   // Add this infile to the global manager
   if (FitPar::Config().GetParB("EventManager")) {
     fInput = FitBase::AddInput(fName, inputfile);
   } else {
     std::vector<std::string> file_descriptor =
-        GeneralUtils::ParseToStr(inputfile, ":");
+      GeneralUtils::ParseToStr(inputfile, ":");
     if (file_descriptor.size() != 2) {
       ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfile
                << "\". expected \"FILETYPE:file.root\"" << std::endl;
       throw;
     }
     InputUtils::InputType inpType =
-        InputUtils::ParseInputType(file_descriptor[0]);
+      InputUtils::ParseInputType(file_descriptor[0]);
 
-    fInput = new InputHandler(fName, inpType, file_descriptor[1]);
+    fInput = InputUtils::CreateInputHandler(fName, inpType, file_descriptor[1]);
   }
 
-  // fFluxHist = (TH1D*)  fInput->GetFluxHistogram()->Clone();
-  // fEventHist = (TH1D*) fInput->GetEventHistogram()->Clone();
-  // fXSecHist = (TH1D*)  fInput->GetXSecHistogram()->Clone();
+
   fNEvents = fInput->GetNEvents();
 
   // Expect INPUTTYPE:FileLocation(s)
   std::vector<std::string> file_descriptor =
-      GeneralUtils::ParseToStr(inputfile, ":");
+    GeneralUtils::ParseToStr(inputfile, ":");
   if (file_descriptor.size() != 2) {
     ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfile
              << "\". expected \"FILETYPE:file.root\"" << std::endl;
     throw;
   }
   fInputType = InputUtils::ParseInputType(file_descriptor[0]);
 
   fInputFileName = file_descriptor[1];
   if (EnuMin == 0 && EnuMax == 1.E5) {
     EnuMin = fInput->GetFluxHistogram()->GetBinLowEdge(1);
     EnuMax = fInput->GetFluxHistogram()->GetBinLowEdge(
-        fInput->GetFluxHistogram()->GetNbinsX() + 1);
+               fInput->GetFluxHistogram()->GetNbinsX() + 1);
   }
+
+  fFluxHist = fInput->GetFluxHistogram();
+  fEventHist = fInput->GetEventHistogram();
 }
 
 //***********************************************
 int MeasurementBase::GetInputID() {
-  //***********************************************
+//***********************************************
   return FitBase::GetInputID(fInputFileName);
 }
 
 //***********************************************
-void MeasurementBase::Reconfigure() {
-  //***********************************************
-  LOG(REC) << " Reconfiguring sample " << fName << std::endl;
+SampleSettings MeasurementBase::LoadSampleSettings(nuiskey samplekey) {
+//***********************************************
+  SampleSettings setting = SampleSettings(samplekey);
+  fName = setting.GetS("name");
 
-  bool using_evtmanager = FitPar::Config().GetParB("EventManager");
-  int input_id = -1;
-  if (using_evtmanager) {
-    input_id = FitBase::GetInputID(fInputFileName);
-  }
-  cust_event = fInput->GetEventPointer();
+  // Used as an initial setup function incase we need to do anything here.
+  LOG(SAM) << "Loading Sample : " << setting.GetName() << std::endl;
+  if (!fIsJoint) SetupInputs( setting.GetS("input") );
 
-  if (FitPar::Config().GetParI("cachesize") > 0) {
-    fInput->SetupCache();
-  }
+  return setting;
+}
+
+//***********************************************
+SampleSettings MeasurementBase::LoadSampleSettings(std::string name, std::string input, std::string type) {
+//***********************************************
+
+  nuiskey samplekey = Config::CreateKey("sample");
+  samplekey.SetS("name",name);
+  samplekey.SetS("input",input);
+  samplekey.SetS("type",type);
+
+  return LoadSampleSettings(samplekey);
+}
+
+void MeasurementBase::FinaliseSampleSettings() {
+
+  EnuMin = fSettings.GetD("enu_min");
+  EnuMax = fSettings.GetD("enu_max");
+
+}
+
+
+//***********************************************
+void MeasurementBase::Reconfigure() {
+//***********************************************
+  
+  LOG(REC) << " Reconfiguring sample " << fName << std::endl;
 
   // Reset Histograms
+  ResetExtraHistograms();
+  AutoResetExtraTH1();
   this->ResetAll();
 
-  // READ in spline head for this input
-  if (fInput->GetType() == kEVTSPLINE) {
-    FitBase::GetRW()->ReadSplineHead(fInput->GetSplineHead());
-  }
-
-  FitEvent* cust_event = fInput->GetEventPointer();
+  // FitEvent* cust_event = fInput->GetEventPointer();
   int fNEvents = fInput->GetNEvents();
   int countwidth = (fNEvents / 5);
 
-  // Reset Signal Vectors
-  fXVar_VECT.clear();
-  fYVar_VECT.clear();
-  fZVar_VECT.clear();
-  this->fMode_VECT.clear();
-  this->fIndex_VECT.clear();
 
-#ifdef __GiBUU_ENABLED__
-  bool UsingGiBUU = (fInput->GetType() == kGiBUU);
-#endif
-
-  size_t NSignal = 0;
   // MAIN EVENT LOOP
-  for (int i = 0; i < fNEvents; i++) {
-    // Read in the TChain and Calc Kinematics
-    if (using_evtmanager) {
-      cust_event = FitBase::EvtManager().GetEvent(input_id, i);
-    } else {
-      fInput->ReadEvent(i);
-
-      cust_event->RWWeight = FitBase::GetRW()->CalcWeight(cust_event);
-      cust_event->Weight = cust_event->RWWeight * cust_event->InputWeight;
-    }
+  FitEvent* cust_event = fInput->FirstNuisanceEvent();
+  int i = 0;
+  int npassed = 0;
+  while(cust_event){
 
-    Weight = cust_event->Weight;
-
-#ifdef __GiBUU_ENABLED__
-
-    /// For multi species measurements the flux scalings must be correctly
-    /// applied here
-    if (UsingGiBUU) {
-      switch (fMeasurementSpeciesType) {
-        case kSingleSpeciesMeasurement:
-        default: { break; }
-        case kNumuWithWrongSignMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght_numu;
-          break;
-        }
-        case kNueWithWrongSignMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght_nue;
-          break;
-        }
-        case kFourSpeciesMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght;
-          break;
-        }
-      }
-    }
+    cust_event->RWWeight = fRW->CalcWeight(cust_event);
+    cust_event->Weight = cust_event->RWWeight * cust_event->InputWeight;
 
-#endif
+    Weight = cust_event->Weight;
 
     // Initialize
     fXVar = -999.9;
     fYVar = -999.9;
     fZVar = -999.9;
     Signal = false;
     Mode = cust_event->Mode;
 
     // Extract Measurement Variables
     this->FillEventVariables(cust_event);
     Signal = this->isSignal(cust_event);
+    if (Signal) npassed++;
 
-    // Push Back Signal
-    if (Signal) {
-      fXVar_VECT.push_back(fXVar);
-      fYVar_VECT.push_back(fYVar);
-      fZVar_VECT.push_back(fZVar);
-      this->fMode_VECT.push_back(Mode);
-      this->fIndex_VECT.push_back((UInt_t)i);
-      NSignal++;
-    }
+    GetBox()->SetX(fXVar);
+    GetBox()->SetY(fYVar);
+    GetBox()->SetZ(fZVar);
+    GetBox()->SetMode(Mode);
+    // GetBox()->fSignal = Signal;
 
     // Fill Histogram Values
-    this->FillHistograms();
-    // this->FillExtraHistograms();
+    GetBox()->FillBoxFromEvent(cust_event);
+    // this->FillExtraHistograms(GetBox(), Weight);
+    this->FillHistogramsFromBox(GetBox(), Weight);
 
     // Print Out
     if (LOG_LEVEL(REC) && countwidth > 0 && !(i % countwidth)) {
       std::stringstream ss("");
-      ss.unsetf(ios_base::fixed);
+      ss.unsetf(std::ios_base::fixed);
       ss << std::setw(7) << std::right << i << "/" << fNEvents << " events ("
          << std::setw(2) << double(i) / double(fNEvents) * 100. << std::left
          << std::setw(5) << "%) "
          << "[S,X,Y,Z,M,W] = [" << std::fixed << std::setprecision(2)
          << std::right << Signal << ", " << std::setw(5) << fXVar << ", "
          << std::setw(5) << fYVar << ", " << std::setw(5) << fYVar << ", "
          << std::setw(3) << (int)Mode << ", " << std::setw(5) << Weight << "] "
          << std::endl;
       LOG(SAM) << ss.str();
     }
+
+    // iterate
+    cust_event = fInput->NextNuisanceEvent();
+    i++;
   }
 
-  int npassed = fXVar_VECT.size();
   LOG(SAM) << npassed << "/" << fNEvents << " passed selection " << std::endl;
   if (npassed == 0) {
     LOG(SAM) << "WARNING: NO EVENTS PASSED SELECTION!" << std::endl;
   }
+  LOG(REC) << std::setw(10) << std::right << NSignal << "/"
+           << fNEvents << " events passed selection + binning after reweight"
+           << std::endl;
 
   // Finalise Histograms
   fMCFilled = true;
   this->ConvertEventRates();
 }
 
-//***********************************************
-void MeasurementBase::ReconfigureFast() {
-  //***********************************************
-  LOG(REC) << " Reconfiguring signal " << this->fName << std::endl;
+void MeasurementBase::FillHistogramsFromBox(MeasurementVariableBox* var, double weight) {
 
-  bool using_evtmanager = FitPar::Config().GetParB("EventManager");
-  int input_id = -1;
+  fXVar  = var->GetX();
+  fYVar  = var->GetY();
+  fZVar  = var->GetZ();
+  // Signal = var->fSignal;
+  // Mode   = var->fMode;
+  Weight = weight;
 
-  if (using_evtmanager) {
-    input_id = FitBase::GetInputID(fInputFileName);
-  } else {
-    cust_event = fInput->GetEventPointer();
-  }
+  FillHistograms();
+  FillExtraHistograms(var, weight);
 
-  // Check if we Can't Signal Reconfigure
-  if (!fMCFilled) {
-    this->Reconfigure();
-    return;
-  }
+}
 
-  // Reset Histograms
-  this->ResetAll();
+void MeasurementBase::FillHistograms(double weight){
+  Weight = weight;
+  FillHistograms();
+  FillExtraHistograms(GetBox(), Weight);
+}
 
-  // READ in spline head for this input
-  if (fInput->GetType() == kEVTSPLINE) {
-    FitBase::GetRW()->ReadSplineHead(fInput->GetSplineHead());
-  }
 
-  // Get Pointer To Base Event (Just Generator Formats)
-  int countwidth = (fIndex_VECT.size() / 5);
-
-  // Setup Iterators
-  std::vector<double>::iterator X = fXVar_VECT.begin();
-  std::vector<double>::iterator Y = fYVar_VECT.begin();
-  std::vector<double>::iterator Z = fZVar_VECT.begin();
-  std::vector<int>::iterator M = fMode_VECT.begin();
-  std::vector<UInt_t>::iterator I = fIndex_VECT.begin();
-
-#ifdef __GiBUU_ENABLED__
-  bool UsingGiBUU = (fInput->GetType() == kGiBUU);
-#endif
-
-  // SIGNAL LOOP
-  for (int i = 0; I != fIndex_VECT.end(); I++, i++) {
-    // Just Update Weight
-    if (using_evtmanager) {
-      Weight = FitBase::EvtManager().GetEventWeight(input_id, (*I));
-    } else {
-      fInput->GetTreeEntry((*I));
-      Weight =
-          FitBase::GetRW()->CalcWeight(cust_event) * cust_event->InputWeight;
-    }
+MeasurementVariableBox* MeasurementBase::FillVariableBox(FitEvent* event) {
 
-#ifdef __GiBUU_ENABLED__
-    /// For multi species measurements the flux scalings must be correctly
-    /// applied here
-    if (UsingGiBUU) {
-      switch (fMeasurementSpeciesType) {
-        case kSingleSpeciesMeasurement:
-        default: { break; }
-        case kNumuWithWrongSignMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght_numu;
-          break;
-        }
-        case kNueWithWrongSignMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght_nue;
-          break;
-        }
-        case kFourSpeciesMeasurement: {
-          Weight *= cust_event->GiRead->SpeciesWght;
-          break;
-        }
-      }
-    }
-#endif
-
-    fXVar = (*X);
-    fYVar = (*Y);
-    fZVar = (*Z);
-    Mode = (*M);
+  GetBox()->Reset();
+  Mode = event->Mode;
+  
+  this->FillEventVariables(event);
+  Signal = this->isSignal(event);
 
-    // Set signal to true because here every event looped is true signal
-    Signal = true;
+  GetBox()->FillBoxFromEvent(event);
 
-    // Sort Histograms
-    this->FillHistograms();
+  GetBox()->SetX(fXVar);
+  GetBox()->SetY(fYVar);
+  GetBox()->SetZ(fZVar);
+  GetBox()->SetMode(event->Mode);
+  // GetBox()->fSignal = Signal;
 
-    // Get Next Iteration
-    X++;
-    Y++;
-    Z++;
-    M++;
+  return GetBox();
+}
 
-    // Print Out
-    if (LOG_LEVEL(REC) && (i) % countwidth == 0)
-      LOG(REC) << "Reconfigured " << std::setw(7) << std::right << i
-               << " signal events. [X,Y,Z,M,W] = [" << std::setprecision(2)
-               << std::setw(5) << std::right << fXVar << ", " << std::setw(5)
-               << std::right << fYVar << ", " << std::setw(5) << std::right
-               << fYVar << ", " << std::setw(3) << std::right << (int)Mode
-               << ", " << std::setw(5) << std::right << Weight << "] "
-               << std::endl;
-  }
+MeasurementVariableBox* MeasurementBase::GetBox() {
+  if (!fEventVariables) fEventVariables = CreateBox();
+  return fEventVariables;
+}
 
-  // Finalise histograms
-  fMCFilled = true;
-  this->ConvertEventRates();
+//***********************************************
+void MeasurementBase::ReconfigureFast() {
+  //***********************************************
+  this->Reconfigure();
 }
 
 //***********************************************
 void MeasurementBase::ConvertEventRates() {
   //***********************************************
 
+  AutoScaleExtraTH1();
+  ScaleExtraHistograms(GetBox());
   this->ScaleEvents();
-  double normval = FitBase::GetRW()->GetSampleNorm(this->fName);
+
+  double normval = fRW->GetSampleNorm(this->fName);
   if (normval < 0.01 or normval > 10.0){
     ERR(WRN) << "Norm Value inside MeasurementBase::ConvertEventRates() looks off!" << std::endl;
     ERR(WRN) << "It could have become out of sync with the minimizer norm list." << std::endl;
     ERR(WRN) << "Setting it to 1.0" << std::endl;
     normval = 1.0;
   }
-
+  AutoNormExtraTH1(normval);
+  NormExtraHistograms(GetBox(), normval);
   this->ApplyNormScale(normval);
+
 }
 
 //***********************************************
-InputHandler* MeasurementBase::GetInput() {
+InputHandlerBase* MeasurementBase::GetInput() {
   //***********************************************
 
   if (!fInput) {
     ERR(FTL) << "MeasurementBase::fInput not set. Please submit your command "
-                "line options and input cardfile with a bug report to: "
-                "nuisance@projects.hepforge.org"
+             "line options and input cardfile with a bug report to: "
+             "nuisance@projects.hepforge.org"
              << std::endl;
     throw;
   }
   return fInput;
 };
 
 //***********************************************
 void MeasurementBase::Renormalise() {
   //***********************************************
 
   // Called when the fitter has changed a measurements normalisation but not any
   // reweight dials
   // Means we don't have to call the time consuming reconfigure when this
   // happens.
-  double norm = FitBase::GetRW()->GetDialValue(this->fName + "_norm");
+  double norm = fRW->GetDialValue(this->fName + "_norm");
 
   if ((this->fCurrentNorm == 0.0 and norm != 0.0) or not fMCFilled) {
     this->ReconfigureFast();
     return;
   }
 
   if (this->fCurrentNorm == norm) return;
 
   this->ApplyNormScale(1.0 / this->fCurrentNorm);
   this->ApplyNormScale(norm);
 
   return;
 };
 
 //***********************************************
 void MeasurementBase::SetSignal(bool sig) {
   //***********************************************
   Signal = sig;
 }
 
 //***********************************************
 void MeasurementBase::SetSignal(FitEvent* evt) {
   //***********************************************
   Signal = this->isSignal(evt);
 }
 
 //***********************************************
 void MeasurementBase::SetWeight(double wght) {
   //***********************************************
   Weight = wght;
 }
 
 //***********************************************
 void MeasurementBase::SetMode(int md) {
   //***********************************************
   Mode = md;
 }
 
 //***********************************************
 std::vector<TH1*> MeasurementBase::GetFluxList() {
   //***********************************************
   return GetInput()->GetFluxList();
 }
 
 //***********************************************
 std::vector<TH1*> MeasurementBase::GetEventRateList() {
   //***********************************************
   return GetInput()->GetEventList();
 }
 
 //***********************************************
 std::vector<TH1*> MeasurementBase::GetXSecList() {
   //***********************************************
   return GetInput()->GetXSecList();
 }
+
+
+void MeasurementBase::ProcessExtraHistograms(int cmd,
+    MeasurementVariableBox* vars,
+    double weight) {
+  // This should be overriden if we have extra histograms!!!
+  // Add a flag to tell user this...
+  return;
+}
+
+void MeasurementBase::FillExtraHistograms(MeasurementVariableBox* vars,
+    double weight) {
+  ProcessExtraHistograms(kCMD_Fill, vars, weight);
+}
+
+void MeasurementBase::ScaleExtraHistograms(MeasurementVariableBox* vars) {
+  ProcessExtraHistograms(kCMD_Scale, vars, 1.0);
+}
+void MeasurementBase::ResetExtraHistograms() {
+  ProcessExtraHistograms(kCMD_Reset, NULL, 1.0);
+}
+void MeasurementBase::NormExtraHistograms(MeasurementVariableBox* vars,
+    double norm) {
+  ProcessExtraHistograms(kCMD_Norm, vars, norm);
+}
+void MeasurementBase::WriteExtraHistograms() {
+  ProcessExtraHistograms(kCMD_Write, NULL, 1.00);
+}
+
+void MeasurementBase::SetAutoProcessTH1(TH1* hist, int c1, int c2, int c3, int c4, int c5) {
+  FakeStack* fake = new FakeStack(hist);
+  SetAutoProcessTH1(fake, c1, c2, c3, c4, c5); // Need to add a destroy command!
+}
+
+void MeasurementBase::SetAutoProcessTH1(StackBase* hist,  int c1, int c2, int c3, int c4, int c5) {
+
+  // Set Defaults
+  // int ncommands = kCMD_extraplotflags;
+  bool autoflags[5];
+  autoflags[0] = false;
+  autoflags[1] = false;
+  autoflags[2] = false;
+  autoflags[3] = false;
+  autoflags[4] = false;
+
+  int givenflags[5];
+  givenflags[0] = c1;
+  givenflags[1] = c2;
+  givenflags[2] = c3;
+  givenflags[3] = c4;
+  givenflags[4] = c5;
+  fExtraTH1s[hist] = std::vector<int>(5,0);
+
+  // Setup a default one.
+  if (c1 == -1 && c2 == -1 && c3 == -1 && c4 == -1 && c5 == -1){
+    fExtraTH1s[hist][kCMD_Reset] = 1;
+    fExtraTH1s[hist][kCMD_Scale] = 1;
+    fExtraTH1s[hist][kCMD_Norm] = 1;
+    fExtraTH1s[hist][kCMD_Write] = 1;
+  }
+
+  for (int i = 0; i < 5; i++) {
+    switch (givenflags[i]) {
+
+    // Skip over...
+    case -1:
+      break;
+
+    case kCMD_Reset:
+    case kCMD_Scale:
+    case kCMD_Norm:
+    case kCMD_Write:
+      fExtraTH1s[hist][givenflags[i]] = 1;
+      break;
+
+    case kCMD_Fill:
+      ERR(FTL) << "Can't auto fill yet!" << std::endl;
+      autoflags[givenflags[i]] = 1;
+      break;
+
+    default:
+      break;
+    }
+  }
+
+  // LOG(SAM) << "AutoProcessing " << hist->GetName() << std::endl;
+};
+
+void MeasurementBase::AutoFillExtraTH1() {
+  ERR(FTL) << "Can't auto fill yet! it's too inefficent!" << std::endl;
+  return;
+}
+
+void MeasurementBase::AutoResetExtraTH1() {
+
+  for (std::map<StackBase*, std::vector<int> >::iterator iter = fExtraTH1s.begin();
+       iter != fExtraTH1s.end(); iter++) {
+
+    if (!((*iter).second)[kCMD_Reset]) continue;
+    (*iter).first->Reset();
+  }
+};
+
+void MeasurementBase::AutoScaleExtraTH1() {
+  for (std::map<StackBase*, std::vector<int> >::iterator iter = fExtraTH1s.begin();
+       iter != fExtraTH1s.end(); iter++) {
+
+    if (!((*iter).second)[kCMD_Scale]) continue;
+    (*iter).first->Scale(fScaleFactor, "width");
+  }
+};
+
+void MeasurementBase::AutoNormExtraTH1(double norm) {
+  double sfactor = 0.0;
+  if (norm != 0.0) sfactor = 1.0 / norm;
+
+  for (std::map<StackBase*, std::vector<int> >::iterator iter = fExtraTH1s.begin();
+       iter != fExtraTH1s.end(); iter++) {
+
+    if (!((*iter).second)[kCMD_Norm]) continue;
+    (*iter).first->Scale(sfactor);
+  }
+};
+
+void MeasurementBase::AutoWriteExtraTH1() {
+  for (std::map<StackBase*, std::vector<int> >::iterator iter = fExtraTH1s.begin();
+       iter != fExtraTH1s.end(); iter++) {
+
+    if (!(((*iter).second)[kCMD_Write])) continue;
+    (*iter).first->Write();
+  }
+};
+
+
+
diff --git a/src/FitBase/MeasurementBase.h b/src/FitBase/MeasurementBase.h
index 55fa00b..ff86ab8 100644
--- a/src/FitBase/MeasurementBase.h
+++ b/src/FitBase/MeasurementBase.h
@@ -1,277 +1,343 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef INPUTHANDLER_H_SEEN
 #define INPUTHANDLER_H_SEEN
 
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
 // C Includes
 #include <math.h>
 #include <stdlib.h>
 #include <time.h>
 #include <deque>
 #include <iomanip>
 #include <iostream>
 #include <list>
 #include <numeric>
 #include <sstream>
 #include <string>
 
 // ROOT includes
 #include <TArrayF.h>
 #include <TDecompChol.h>
 #include <TDecompSVD.h>
 #include <TGraph.h>
 #include <TGraphErrors.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <TMatrixDSym.h>
 #include <TROOT.h>
 #include <TSystem.h>
 
 // External data fit includes
 #include "FitEvent.h"
 #include "FitParameters.h"
 #include "FitUtils.h"
 #include "GeneralUtils.h"
 #include "PlotUtils.h"
 #include "StatUtils.h"
-
+#include "InputFactory.h"
 #include "FitWeight.h"
 
 #include "TMultiDimFit.h"
 
 #ifdef __GENIE_ENABLED__
 #include "Conventions/Units.h"
 #endif
 
 #include "EventManager.h"
-#include "InputHandler.h"
 #include "TObject.h"
+#include "InputHandler.h"
+#include "NuisConfig.h"
+#include "NuisKey.h"
+#include "SampleSettings.h"
+#include "StackBase.h"
+#include "StandardStacks.h"
 
 /// Enumerations to help with extra plot functions
 enum extraplotflags {
-  kExtraPlotError = 0,
-  kExtraPlotReset = 1,
-  kExtraPlotFill = 2,
-  kExtraPlotConvert = 3,
-  kExtraPlotWrite = 4
+  kCMD_Reset = 0,
+  kCMD_Fill,
+  kCMD_Scale,
+  kCMD_Norm,
+  kCMD_Write,
+  kCMD_Error,
+  kCMD_extraplotflags
 };
 
 enum MeasurementSpeciesClass {
   kSingleSpeciesMeasurement = 0,
   kNumuWithWrongSignMeasurement,
   kNueWithWrongSignMeasurement,
   kFourSpeciesMeasurement,
 };
 
 /// InputHandler Class
 ///
 /// Inherits from Measurement base to handle whatever input is throwna t the
 /// fitter automatically.
 /// All functions here handle how files are read in, converted to custom formats
 /// and reconfigures are called.
 /// Used generally for the MC inputs.
 
 //! 2nd level experiment class that handles converting MC into a common format
 //! and calling reconfigure
+
+
 class MeasurementBase {
- public:
+public:
   /*
     Constructor/Destructors
   */
   //! Default Constructor. Set everything to NULL
-  MeasurementBase(void);
+  MeasurementBase();
 
   //! Default virtual destructor
   virtual ~MeasurementBase(void);
+  virtual void InitialSetup(void) {};
 
   /*
     Reconfigure Functions
   */
-
   //! Function called if MC tuning dials haven't been changed and all we want to
   //! do is update the normalisation.
   virtual void Renormalise(void);
 
   //! Call reconfigure only looping over signal events to save time.
   virtual void ReconfigureFast(void);
 
+  virtual void FillHistograms(double weight);
+
+
   //! Call reconfigure looping over all MC events including background
   virtual void Reconfigure(void);
 
-  virtual TH2D GetCovarMatrix(void) = 0;
+  // virtual TH2D GetCovarMatrix(void) = 0;
   virtual double GetLikelihood(void) { return 0.0; };
   virtual int GetNDOF(void) { return 0; };
   virtual void ThrowCovariance(void) = 0;
   virtual void SetFakeDataValues(std::string fkdt) = 0;
 
   //! Get the total integrated flux between this samples energy range
   virtual double TotalIntegratedFlux(std::string intOpt = "width",
                                      double low = -9999.9,
                                      double high = -9999.9);
 
   //! Get the predicted event rate for this sample
   virtual double PredictedEventRate(std::string intOpt = "width",
                                     double low = -9999.9,
                                     double high = -9999.9);
 
+  virtual SampleSettings LoadSampleSettings(nuiskey samplekey);
+  virtual SampleSettings LoadSampleSettings(std::string name, std::string input, std::string type);
+
+  virtual void FinaliseSampleSettings();
+  virtual void FinaliseMeasurement();
+  virtual void ProcessExtraHistograms(int cmd, MeasurementVariableBox* vars,
+                                      double weight = 1.0);
+
+  virtual void FillExtraHistograms(MeasurementVariableBox* vars, double weight = 1.0);
+  virtual void ScaleExtraHistograms(MeasurementVariableBox* vars);
+  virtual void ResetExtraHistograms();
+  virtual void NormExtraHistograms(MeasurementVariableBox* vars, double norm = 1.0);
+  virtual void WriteExtraHistograms();
+  virtual MeasurementVariableBox* CreateBox() {return new MeasurementVariableBox();};
+
   int GetPassed() {
-    int signalSize = fXVar_VECT.size();
+    int signalSize = 0;
     return signalSize;
   }
 
   int GetTotal() { return fNEvents; }
 
   /*
     Reconfigure LOOP
   */
   // All these should be virtual
   ///! Reset Histograms (Handled at Measurement Stage)
   virtual void ResetAll(void) = 0;
 
   ///! Fill the event variables for this sample (Handled in each inherited
   /// sample)
   virtual void FillEventVariables(FitEvent* event) { (void)event; };
 
   ///! Check whether this event is signle (Handled in each inherited sample)
   virtual bool isSignal(FitEvent* event) {
     (void)event;
     return false;
   };
 
   ///! Fill the histogram for this event using fXVar and fYVar (Handled in each
   /// inherited sample)
-  virtual void FillHistograms(void){};
+  virtual void FillHistograms(void) {};
 
   ///! Convert event rates to whatever distributions you need.
   virtual void ConvertEventRates(void);
 
   ///! Call scale events after the plots have been filled at the end of
   /// reconfigure.
-  virtual void ScaleEvents(void){};
+  virtual void ScaleEvents(void) {};
 
   ///! Apply the scale factor at the end of reconfigure.
   virtual void ApplyNormScale(double norm) { (void)norm; };
 
   ///! Save Histograms
   virtual void Write(std::string drawOpt = "") = 0;
 
+  virtual MeasurementVariableBox* FillVariableBox(FitEvent* event);
+
+  virtual MeasurementVariableBox* GetBox();
+
+  void FillHistogramsFromBox(MeasurementVariableBox* var, double weight);
   /*
     Histogram Access Functions
   */
 
   ///! Virtual function to get data histogram
   virtual std::vector<TH1*> GetDataList(void) = 0;
 
   ///! Virtual function to get MC histogram
   virtual std::vector<TH1*> GetMCList(void) = 0;
   virtual std::vector<TH1*> GetFineList(void) = 0;
   virtual std::vector<TH1*> GetMaskList(void) = 0;
 
   ///! Return flux histograms in a vector
   virtual std::vector<TH1*> GetFluxList(void);
   virtual std::vector<TH1*> GetEventRateList(void);
   virtual std::vector<TH1*> GetXSecList(void);
 
   virtual TH1D* GetEventHistogram() { return fInput->GetEventHistogram(); };
   virtual TH1D* GetXSecHistogram() { return fInput->GetXSecHistogram(); };
   virtual TH1D* GetFluxHistogram() { return fInput->GetFluxHistogram(); };
 
   ///! Return input for this sample
-  InputHandler* GetInput(void);
+  InputHandlerBase* GetInput(void);
 
   std::string GetName(void) { return fName; };
   double GetScaleFactor(void) { return fScaleFactor; };
 
   double GetXVar(void) { return fXVar; };
   double GetYVar(void) { return fYVar; };
   double GetZVar(void) { return fZVar; };
   double GetMode(void) { return this->Mode; };
   double GetEnu(void) { return this->Enu; };
 
   void SetupInputs(std::string inputfile);
   int GetInputID(void);
   std::string GetInputFileName() { return fInputFileName; };
   void SetSignal(bool sig);
   void SetSignal(FitEvent* evt);
   void SetWeight(double wght);
   void SetMode(int md);
   void SetNoData(bool isTrue = true) { fNoData = isTrue; };
 
   inline void SetXVar(double xvar) { fXVar = xvar; };
   inline void SetYVar(double yvar) { fYVar = yvar; };
   inline void SetZVar(double zvar) { fZVar = zvar; };
 
- protected:
+  virtual std::vector<MeasurementBase*> GetSubSamples() {
+    return std::vector<MeasurementBase*>(1, this);
+  }
+
+
+  void SetAutoProcessTH1(TH1* hist,  int c1 = -1,
+                         int c2 = -1, int c3 = -1,
+                         int c4 = -1, int c5 = -1);
+  void SetAutoProcessTH1(StackBase* hist, int c1 = -1,
+                         int c2 = -1, int c3 = -1,
+                         int c4 = -1, int c5 = -1);
+  void AutoFillExtraTH1();
+  void AutoResetExtraTH1();
+  void AutoScaleExtraTH1();
+  void AutoNormExtraTH1(double norm);
+  void AutoWriteExtraTH1();
+
+
+  // functions that need to be added.
+  // - Initial Check
+  // - Check Target/Beam loop.
+  // - Check flux shape if suggested one given.
+  // - Return MeasurementList (returns )
+
+
+protected:
   // Minimum and maximum energies
   double Enu;     //!< Neutrino Energy
   double EnuMin;  //!< Minimum incoming particle energy of events to include
   double EnuMax;  //!< Maximum incoming particle energy of events to include
 
   BaseFitEvt* signal_event;
   FitEvent* cust_event;
 
   FitWeight* fRW;        //!< Pointer to the rw engine
-  InputHandler* fInput;  //!< Instance of the input handler
+  InputHandlerBase* fInput;  //!< Instance of the input handler
 
   std::string fName; //!< Name of the sample
   int fEventType;
 
   double fBeamDistance;  //!< Incoming Particle flight distance (for oscillation
-                         //! analysis)
+  //! analysis)
   double fScaleFactor;   //!< fScaleFactor applied to events to convert from
-                         //! eventrate to final distribution
+  //! eventrate to final distribution
   double
-      fCurrentNorm;  //!< current normalisation factor applied if fit is "FREE"
+  fCurrentNorm;  //!< current normalisation factor applied if fit is "FREE"
   bool fMCFilled;    //!< flag whether MC plots have been filled (For
-                     //! ApplyNormalisation)
+  //! ApplyNormalisation)
   bool fNoData;      //!< flag whether data plots do not exist (for ratios)
 
   // TEMP OBJECTS TO HANDLE MERGE
   double fXVar, fYVar, fZVar, Mode, Weight;
   bool Signal;
   int ievt;
   int fNEvents;
   double Enu_rec, ThetaMu, CosThetaMu;
 
-  std::vector<double> fXVar_VECT;
-  std::vector<double> fYVar_VECT;
-  std::vector<double> fZVar_VECT;
-  std::vector<int> fMode_VECT;
-  std::vector<UInt_t> fIndex_VECT;
-
   InputUtils::InputType fInputType;
   std::string fInputFileName;
+  TH1D* fFluxHist;
+  TH1D* fEventHist;
 
   MeasurementSpeciesClass fMeasurementSpeciesType;
+  SampleSettings fSettings;
+
+  MeasurementVariableBox* fEventVariables;
+
+  std::map<StackBase*, std::vector<int> > fExtraTH1s;
+  int NSignal;
+  // std::map<TH1*, bool[6] > fExtaStacks;
+
+  bool fIsJoint;
+
 };
 
+
+
+
 // Class TypeDefs
 typedef std::list<MeasurementBase*>::const_iterator MeasListConstIter;
 typedef std::list<MeasurementBase*>::iterator MeasListIter;
 typedef std::vector<MeasurementBase*>::const_iterator MeasVectConstIter;
 typedef std::vector<MeasurementBase*>::iterator MeasVectIter;
 
 /*! @} */
 #endif
diff --git a/src/FitBase/MeasurementVariableBox.cxx b/src/FitBase/MeasurementVariableBox.cxx
new file mode 100644
index 0000000..a063d3d
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox.cxx
@@ -0,0 +1,31 @@
+#include "MeasurementVariableBox.h"
+void MeasurementVariableBox::Reset() {
+}
+
+void MeasurementVariableBox::FillBoxFromEvent(FitEvent* evt) {
+  return;
+}
+
+MeasurementVariableBox* MeasurementVariableBox::CloneSignalBox() {
+  return NULL;
+};
+
+void MeasurementVariableBox::Print() {
+  std::cout << "Printing Empty BOX! " << std::endl;
+}
+
+double MeasurementVariableBox::GetX(){
+  return -999.9;
+}
+
+double MeasurementVariableBox::GetY(){
+  return -999.9;
+}
+
+double MeasurementVariableBox::GetZ(){
+  return -999.9;
+}
+
+int MeasurementVariableBox::GetMode(){
+  return 0;
+}
diff --git a/src/FitBase/MeasurementVariableBox.h b/src/FitBase/MeasurementVariableBox.h
new file mode 100644
index 0000000..1d7217f
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox.h
@@ -0,0 +1,28 @@
+#ifndef MEASUREMENTVARIABLEBOX_H
+#define MEASUREMENTVARIABLEBOX_H
+#include "FitEvent.h"
+
+class MeasurementVariableBox {
+public:
+  
+  MeasurementVariableBox() {};
+  ~MeasurementVariableBox() {};
+
+  virtual void Reset();
+  virtual void FillBoxFromEvent(FitEvent* evt);
+  virtual MeasurementVariableBox* CloneSignalBox();
+  virtual void Print();
+
+  virtual double GetX();
+  virtual double GetY();
+  virtual double GetZ();
+  virtual int GetMode();
+
+  virtual void SetX(double x){};
+  virtual void SetY(double y){};
+  virtual void SetZ(double z){};
+  virtual void SetMode(int m){};
+
+};
+
+#endif
diff --git a/src/FitBase/MeasurementVariableBox1D.cxx b/src/FitBase/MeasurementVariableBox1D.cxx
new file mode 100644
index 0000000..0e2ecea
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox1D.cxx
@@ -0,0 +1,40 @@
+#include "MeasurementVariableBox1D.h"
+
+void MeasurementVariableBox1D::Reset() {
+  fX = -999.9;
+}
+
+void MeasurementVariableBox1D::FillBoxFromEvent(FitEvent* evt) {
+  return;
+}
+
+MeasurementVariableBox* MeasurementVariableBox1D::CloneSignalBox() {
+  MeasurementVariableBox1D* box = new MeasurementVariableBox1D();
+  box->fX = this->fX;
+  return box;
+};
+
+void MeasurementVariableBox1D::Print() {
+  std::cout << "Printing Empty BOX! " << std::endl;
+}
+
+double MeasurementVariableBox1D::GetX(){
+  return fX;
+}
+
+double MeasurementVariableBox1D::GetY(){
+  return -999.9;
+}
+
+double MeasurementVariableBox1D::GetZ(){
+  return -999.9;
+}
+
+int MeasurementVariableBox1D::GetMode(){
+  return 0;
+}
+
+void MeasurementVariableBox1D::SetX(double x){
+  fX = x;
+}
+
diff --git a/src/FitBase/MeasurementVariableBox1D.h b/src/FitBase/MeasurementVariableBox1D.h
new file mode 100644
index 0000000..3cc2422
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox1D.h
@@ -0,0 +1,30 @@
+#ifndef MEASUREMENTVARIABLEBOX1D_H
+#define MEASUREMENTVARIABLEBOX1D_H
+#include "FitEvent.h"
+#include "MeasurementVariableBox.h"
+
+class MeasurementVariableBox1D : public MeasurementVariableBox {
+public:
+  MeasurementVariableBox1D() {};
+  ~MeasurementVariableBox1D() {};
+
+  virtual void Reset();
+  virtual void FillBoxFromEvent(FitEvent* evt);
+  virtual MeasurementVariableBox* CloneSignalBox();
+  virtual void Print();
+
+  virtual double GetX();
+  virtual double GetY();
+  virtual double GetZ();
+  virtual int GetMode();
+
+  virtual void SetX(double x);
+  virtual void SetY(double y){};
+  virtual void SetZ(double z){};
+  virtual void SetMode(int m){};
+
+  double fX;
+
+};
+
+#endif
diff --git a/src/FitBase/MeasurementVariableBox2D.cxx b/src/FitBase/MeasurementVariableBox2D.cxx
new file mode 100644
index 0000000..43e03c9
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox2D.cxx
@@ -0,0 +1,45 @@
+#include "MeasurementVariableBox2D.h"
+
+void MeasurementVariableBox2D::Reset() {
+  fX = -999.9;
+  fY = -999.9;
+}
+
+void MeasurementVariableBox2D::FillBoxFromEvent(FitEvent* evt) {
+  return;
+}
+
+MeasurementVariableBox* MeasurementVariableBox2D::CloneSignalBox() {
+  MeasurementVariableBox2D* box = new MeasurementVariableBox2D();
+  box->fX = this->fX;
+  box->fY = this->fY;
+  return box;
+};
+
+void MeasurementVariableBox2D::Print() {
+  std::cout << "Printing Empty BOX! " << std::endl;
+}
+
+double MeasurementVariableBox2D::GetX(){
+  return fX;
+}
+
+double MeasurementVariableBox2D::GetY(){
+  return fY;
+}
+
+double MeasurementVariableBox2D::GetZ(){
+  return -999.9;
+}
+
+int MeasurementVariableBox2D::GetMode(){
+  return 0;
+}
+
+void MeasurementVariableBox2D::SetX(double x){
+  fX = x;
+}
+
+void MeasurementVariableBox2D::SetY(double y){
+  fY = y;
+}
diff --git a/src/FitBase/MeasurementVariableBox2D.h b/src/FitBase/MeasurementVariableBox2D.h
new file mode 100644
index 0000000..cb63375
--- /dev/null
+++ b/src/FitBase/MeasurementVariableBox2D.h
@@ -0,0 +1,30 @@
+#ifndef MEASUREMENTVARIABLEBOX2D_H
+#define MEASUREMENTVARIABLEBOX2D_H
+#include "FitEvent.h"
+#include "MeasurementVariableBox.h"
+
+class MeasurementVariableBox2D : public MeasurementVariableBox {
+public:
+  MeasurementVariableBox2D() {};
+  ~MeasurementVariableBox2D() {};
+
+  virtual void Reset();
+  virtual void FillBoxFromEvent(FitEvent* evt);
+  virtual MeasurementVariableBox* CloneSignalBox();
+  virtual void Print();
+
+  virtual double GetX();
+  virtual double GetY();
+  virtual double GetZ();
+  virtual int GetMode();
+
+  virtual void SetX(double x);
+  virtual void SetY(double y);
+  virtual void SetZ(double z){};
+  virtual void SetMode(int m){};
+
+  double fX, fY;
+
+};
+
+#endif
diff --git a/src/FitBase/ParamPull.cxx b/src/FitBase/ParamPull.cxx
index 7267c00..f443f82 100644
--- a/src/FitBase/ParamPull.cxx
+++ b/src/FitBase/ParamPull.cxx
@@ -1,791 +1,792 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #include "ParamPull.h"
 
 //*******************************************************************************
 ParamPull::ParamPull(std::string name, std::string inputfile, std::string type, std::string dials){
 //*******************************************************************************
 
   fMinHist = NULL;
   fMaxHist = NULL;
   fTypeHist = NULL;
   fDialSelection = dials;
   
   fName  = name;
   fInput = inputfile;
   fType  = type;
   
   // Set the pull type
   SetType(fType);
   std::cout << fType << std::endl;
   
   // Setup Histograms from input file
   SetupHistograms(fInput);    
 };
 
 //*******************************************************************************
 void ParamPull::SetType(std::string type){
 //*******************************************************************************
 
   fType = type;
   // Assume Default if empty
   if (type.empty() || type == "DEFAULT"){
     ERR(WRN) << "No type specified for ParmPull class " << fName << std::endl;
     ERR(WRN) << "Assuming GAUSTHROW/GAUSPULL" << std::endl;
 
     type = "GAUSTHROW/GAUSPULL";
   }
   
   // Set Dial options
   if (type.find("FRAC") != std::string::npos){
 
     fDialOptions = "FRAC";
     fPlotTitles  = ";; Fractional RW Value";
 
   } else if (type.find("ABS") != std::string::npos){
 
     fDialOptions = "ABS";
     fPlotTitles= ";; ABS RW Value";
 
   } else {
 
     fDialOptions = "";
     fPlotTitles= ";; RW Value";
 
   }
 
   // Parse throw types
   if (type.find("GAUSPULL") != std::string::npos) fCalcType = kGausPull;
   else fCalcType = kNoPull;
 
   if (type.find("GAUSTHROW") != std::string::npos) fThrowType = kGausThrow;
   else fThrowType = kNoThrow;
 
   // Extra check to see if throws or pulls are turned off
   if (type.find("NOPULL") != std::string::npos)  fCalcType = kNoPull;
   if (type.find("NOTHROW") != std::string::npos) fThrowType = kNoThrow;
   
 }
 
 //*******************************************************************************
 void ParamPull::SetupHistograms(std::string input){
 //*******************************************************************************
 
   // Extract Types from Input
   fFileType = "";
   const int nfiletypes = 4;
   const std::string filetypes[nfiletypes] = {"FIT","ROOT","TXT","DIAL"};
 
   for (int i = 0; i < nfiletypes; i++) {
     std::string tempTypes = filetypes[i] + ":";
     if (input.find(tempTypes) != std::string::npos) {
       fFileType = filetypes[i];
       input.replace(input.find(tempTypes), tempTypes.size(), "");
       break;
     }
   }
 
   // Read Files
   if      (!fFileType.compare("FIT")) ReadFitFile(input);
   else if (!fFileType.compare("ROOT")) ReadRootFile(input);
   else if (!fFileType.compare("VECT")) ReadVectFile(input);
   else if (!fFileType.compare("DIAL")) ReadDialInput(input);
   else {
     ERR(FTL) << "Unknown ParamPull Type: " << input << std::endl;
     throw;
   }
   
   // Check Dials are all good
   CheckDialsValid();
 
   // Setup MC Histogram
   fMCHist = (TH1D*) fDataHist->Clone();
   fMCHist->Reset();
   fMCHist->SetNameTitle( (fName + "_MC").c_str(),
 			 (fName + " MC" + fPlotTitles).c_str() );
 
   // If no Covar input make an uncorrelated one
   if (!fCovar){
     fCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist, 1.0);
   }
 
   // If no types or limits are provided give them a default option
   if (!fMinHist){
     fMinHist = (TH1D*) fDataHist->Clone();
     fMinHist->SetNameTitle( (fName + "_min").c_str(),
 			    (fName + " min" + fPlotTitles).c_str() );
     for (int i = 0; i < fMinHist->GetNbinsX(); i++){
       // TODO (P.Stowell) Change this to a NULL system where limits are actually free!    
       fMinHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1) - 1E6); 
     }
   }
 
   if (!fMaxHist){
     fMaxHist = (TH1D*) fDataHist->Clone();
     fMaxHist->SetNameTitle( (fName + "_min").c_str(),
 			    (fName + " min" + fPlotTitles).c_str() );
     for(int i = 0; i < fMaxHist->GetNbinsX(); i++){
       fMaxHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1) - 1E6);
     }
   }
 
   // Set types from state, or to unknown
   if (!fTypeHist){
 
     int deftype = -1;
     if (fType.find("T2K")        != std::string::npos){ deftype = kT2K;   }
     else if (fType.find("NEUT")  != std::string::npos){ deftype = kNEUT;  }
     else if (fType.find("NIWG")  != std::string::npos){ deftype = kNIWG;  }
     else if (fType.find("GENIE") != std::string::npos){ deftype = kGENIE; }
     else if (fType.find("NORM")  != std::string::npos){ deftype = kNORM;  }
     else if (fType.find("NUWRO") != std::string::npos){ deftype = kNUWRO; }
     
     fTypeHist = new TH1I( (fName + "_type").c_str(),
 			  (fName + " type" + fPlotTitles).c_str(),
 			  fDataHist->GetNbinsX(), 0, fDataHist->GetNbinsX() );
     
     for(int i = 0; i < fTypeHist->GetNbinsX(); i++){
       fTypeHist->SetBinContent(i+1, deftype );
     }
   }
   
   
   // Sort Covariances
   fInvCovar = StatUtils::GetInvert(fCovar);
   fDecomp   = StatUtils::GetDecomp(fCovar);
 
   // Create DataTrue for Throws
   fDataTrue = (TH1D*) fDataHist->Clone();
   fDataTrue->SetNameTitle( (fName + "_truedata").c_str(),
 			   (fName + " truedata" + fPlotTitles).c_str() );
 
   fDataOrig = (TH1D*) fDataHist->Clone();
   fDataOrig->SetNameTitle( (fName + "_origdata").c_str(),
 			   (fName + " origdata" + fPlotTitles).c_str() );
 
   // Select only dials we want
   if (!fDialSelection.empty()){
     (*fDataHist) = RemoveBinsNotInString(*fDataHist, fDialSelection);
     
 
     
   }
   
 }
 
 //******************************************************************************* 
 TH1D ParamPull::RemoveBinsNotInString(TH1D hist, std::string mystr){
 //******************************************************************************* 
 
   // Make list of allowed bins
   std::vector<std::string> allowedbins;
   for (int i = 0; i < hist.GetNbinsX(); i++){
     std::string syst = std::string(hist.GetXaxis()->GetBinLabel(i+1));
     
     if (mystr.find(syst) != std::string::npos){
       allowedbins.push_back(syst);
     }
   }
 
   // Make new histogram
   UInt_t nbins = allowedbins.size();
   TH1D newhist = TH1D( hist.GetName(), hist.GetTitle(),
 		       (Int_t)nbins, 0.0, (Double_t)nbins);
 
   // Setup bins
   for (UInt_t i = 0; i < nbins; i++){
     // Set Labels
     newhist.GetXaxis()->SetBinLabel(i+1, allowedbins[i].c_str());
 
     // Copy Values
     for (Int_t j = 0; j < hist.GetNbinsX(); j++){
       if (!allowedbins[i].compare(hist.GetXaxis()->GetBinLabel(j+1))){
 	newhist.SetBinContent(i+1, hist.GetBinContent(j+1) );
 	newhist.SetBinError(i+1, hist.GetBinError(j+1) );
       }
     }
   }
 
   return newhist;
 }
 
 //*******************************************************************************
 TH1I ParamPull::RemoveBinsNotInString(TH1I hist, std::string mystr){
 //*******************************************************************************
 
   // Make list of allowed bins
   std::vector<std::string> allowedbins;
   for (int i = 0; i < hist.GetNbinsX(); i++){
     std::string syst = std::string(hist.GetXaxis()->GetBinLabel(i+1));
 
     if (mystr.find(syst) != std::string::npos){
       allowedbins.push_back(syst);
     }
   }
 
   // Make new histogram
   UInt_t nbins = allowedbins.size();
   TH1I newhist = TH1I( hist.GetName(), hist.GetTitle(),
 		       (Int_t)nbins, 0.0, (Int_t)nbins);
 
   // Setup bins
   for (UInt_t i = 0; i < nbins; i++){
     // Set Labels
     newhist.GetXaxis()->SetBinLabel(i+1, allowedbins[i].c_str());
 
     // Copy Values
     for (Int_t j = 0; j < hist.GetNbinsX(); j++){
       if (!allowedbins[i].compare(hist.GetXaxis()->GetBinLabel(j+1))){
 	newhist.SetBinContent(i+1, hist.GetBinContent(j+1) );
 	newhist.SetBinError(i+1, hist.GetBinError(j+1) );
       }
     }
   }
 
   return newhist;
 }
 
 //******************************************************************************* 
 void ParamPull::ReadFitFile(std::string input){
 //*******************************************************************************
 
   TFile* tempfile = new TFile(input.c_str(),"READ");
 
   // Read Data
   fDataHist = (TH1D*) tempfile->Get("fit_dials_free");
   if (!fDataHist){
     ERR(FTL) << "Can't find TH1D hist fit_dials in " << fName << std::endl;
     ERR(FTL) << "File Entries:" << std::endl;
     tempfile->ls();
 
     throw;
   }
 
   fDataHist->SetDirectory(0);
   fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			   (fName + " data" + fPlotTitles).c_str() );
 
   // Read Covar
   TH2D* tempcov = (TH2D*) tempfile->Get("covariance_free");
   if (!tempcov){
     ERR(FTL) << "Can't find TH2D covariance_free in " << fName << std::endl;
     ERR(FTL) << "File Entries:" << std::endl;
     tempfile->ls();
 
     throw;
   }
 
   // Setup Covar
   int nbins = fDataHist->GetNbinsX();
   fCovar = new TMatrixDSym( nbins );
 
   for (int i = 0; i < nbins; i++){
     for(int j = 0; j < nbins; j++){
       (*fCovar)(i,j) = tempcov->GetBinContent(i+1,j+1);
     }
   }
   
   return;
 }
 
 //*******************************************************************************
 void ParamPull::ReadRootFile(std::string input){
 //******************************************************************************* 
 
   std::vector<std::string> inputlist = GeneralUtils::ParseToStr(input,";");
 
   // Check all given
   if (inputlist.size() < 2){
     ERR(FTL) << "Covar supplied in 'ROOT' format should have 3 semi-colon seperated entries!" << std::endl
 	     << "ROOT:filename;histname[;covarname]" << std::endl;
     ERR(FTL) << "histname = TH1D, covarname = TH2D" << std::endl;
     throw;
   }
 
   // Get Entries
   std::string filename  = inputlist[0];
   LOG(DEB) << filename << std::endl;
   std::string histname  = inputlist[1];
   LOG(DEB) << histname << std::endl;
   LOG(DEB) << input<< std::endl;
 
   // Read File
   TFile* tempfile = new TFile(filename.c_str(),"READ");
   if (tempfile->IsZombie()){
     ERR(FTL) << "Can't find file in " << fName << std::endl;
     ERR(FTL) << "location = " << filename << std::endl;
     throw;
   }
 
   // Read Hist
   fDataHist = (TH1D*) tempfile->Get(histname.c_str());
   if (!fDataHist){
     ERR(FTL) << "Can't find TH1D hist " << histname << " in " << fName << std::endl;
     ERR(FTL) << "File Entries:" << std::endl;
     tempfile->ls();
 
     throw;
   }
   fDataHist->SetDirectory(0);
   fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			   (fName + " data" + fPlotTitles).c_str() );
 
   LOG(DEB) << "READING COVAR" << std::endl;
   // Read Covar
   if (inputlist.size() > 2){
     std::string covarname = inputlist[2];
     LOG(DEB) << "COVARNAME = " <<covarname << std::endl;
     
     TH2D* tempcov = (TH2D*) tempfile->Get(covarname.c_str());
     if (!tempcov){
       ERR(FTL) << "Can't find TH2D covar " << covarname << " in " << fName << std::endl;
       ERR(FTL) << "File Entries:" << std::endl;
       tempfile->ls();
       
       throw;
     }
     
     // Setup Covar
     int nbins = fDataHist->GetNbinsX();
     fCovar = new TMatrixDSym( nbins );
     
     for (int i = 0; i < nbins; i++){
       for (int j = 0; j < nbins; j++){
 	(*fCovar)(i,j) = tempcov->GetBinContent(i+1,j+1);
       }
     }
     
   // Uncorrelated
   } else {
     LOG(SAM) <<"No Covar provided so using diagonal errors for "
 	     << fName << std::endl;
     fCovar = NULL;
   }
 }
 
 //*******************************************************************************  
 void ParamPull::ReadVectFile(std::string input){
 //*******************************************************************************
 
   std::vector<std::string> inputlist = GeneralUtils::ParseToStr(input,";");
   if (inputlist.size() < 4){
     ERR(FTL) << "Need 3 inputs for vector input in " << fName << std::endl;
     ERR(FTL) << "Inputs: " << input << std::endl;
     throw;
   }
 
   // Open File
   std::string rootname   = inputlist[0];
   TFile* tempfile = new TFile(rootname.c_str(),"READ");
   if (tempfile->IsZombie()){
     ERR(FTL) << "Can't find file in " << fName << std::endl;
     ERR(FTL) << "location = " << rootname << std::endl;
     throw;
   }
 
   // Get Name
   std::string tagname = inputlist[1];
   //  TVector<std::string> dialtags = tempfile->Get(tagname.c_str());
   //  if (!dialtags){
   //    ERR(FTL) << "Can't find list of dial names!" << std::endl;
   //  }
   
   // Get Values 
   std::string valuename  = inputlist[2];
   TVectorD* dialvals = (TVectorD*)tempfile->Get(valuename.c_str());
   if (!dialvals){
     ERR(FTL) << "Can't find dial values" << std::endl;
   }
 
   // Get Matrix 
   std::string matrixname = inputlist[3];
   TMatrixD* matrixvals = (TMatrixD*)tempfile->Get(matrixname.c_str());
   if (!matrixvals){
     ERR(FTL) << "Can't find matirx values" << std::endl;
   }
  
   // Get Types
   if (inputlist.size() > 4){
     std::string typesname  = inputlist[3];
   }
 
   // Get Minimum
   if (inputlist.size() > 5){
     std::string minname = inputlist[4];
   }
 
   // Get Maximum
   if (inputlist.size() > 6){
     std::string maxname = inputlist[5];
   }
   
 }
 
 //*******************************************************************************  
 void ParamPull::ReadDialInput(std::string input){
 //*******************************************************************************  
 
   std::vector<std::string> inputlist = GeneralUtils::ParseToStr(input,";");
   if (inputlist.size() < 3){
     ERR(FTL) << "Need 3 inputs for dial input in " << fName << std::endl;
     ERR(FTL) << "Inputs: " << input << std::endl;
     throw;
   }
 
   std::vector<double> inputvals = GeneralUtils::ParseToDbl(input,";");
   std::string dialname = inputlist[0];
   double val = inputvals[1];
   double err = inputvals[2];
   
   fDataHist = new TH1D( (fName + "_data").c_str(),
 			(fName + "_data" + fPlotTitles).c_str(), 1, 0, 1);
   fDataHist->SetBinContent(1, val);
   fDataHist->SetBinError(1, err);
   fDataHist->GetXaxis()->SetBinLabel(1, dialname.c_str());
 
   fCovar = NULL;
 }
 
 //*******************************************************************************   
 std::map<std::string, int> ParamPull::GetAllDials(){
 //*******************************************************************************   
 
   std::map<std::string, int> dialtypemap;
   
   for (int i = 0; i < fDataHist->GetNbinsX(); i++){
 
     std::string name = fDataHist->GetXaxis()->GetBinLabel(i+1);
     int type = fTypeHist->GetBinContent(i+1);
     
     dialtypemap[name] = type;
     
   }
 
   return dialtypemap;
 }
 
 
 //******************************************************************************* 
 bool ParamPull::CheckDialsValid(){
 //*******************************************************************************
 
   return true;
   std::string helpstring = "";
   
   for (int i = 0; i < fDataHist->GetNbinsX(); i++){
     std::string name = std::string(fDataHist->GetXaxis()->GetBinLabel(i+1));
 
     // If dial exists its all good
     if (FitBase::GetRW()->DialIncluded(name)) continue;
 
     // If it doesn't but its a sample norm also continue
     if (name.find("_norm") != std::string::npos){
       ERR(WRN) << "Norm dial included in covar but not set in FitWeight." << std::endl;
       ERR(WRN) << "Assuming its a sample norm and skipping..." << std::endl;
     }
 
     // Dial unknown so print a help statement
     std::ostringstream tempstr;
     tempstr << "unknown_parameter " << name << " "
 	    << fDataHist->GetBinContent(i+1) << " "
 	    << fDataHist->GetBinContent(i+1) - fDataHist->GetBinError(i+1) << " "
 	    << fDataHist->GetBinContent(i+1) + fDataHist->GetBinError(i+1) << " "
 	    << fDataHist->GetBinError(i+1) << " ";
 
     if (!fType.empty()) tempstr << fType << std::endl;
     else tempstr << "FREE" << std::endl;
     helpstring += tempstr.str(); 
   }
 
   // Show statement before failing
   if (!helpstring.empty()){
     
     ERR(WRN) <<"Dial(s) included in covar but not set in FitWeight." << std::endl
              << "ParamPulls needs to know how you want it to be treated." << std::endl
              <<"Include the following lines into your card:" << std::endl;
 
     ERR(WRN) << helpstring << std::endl;
     throw;
     return false;
   } else {
     return true;
   }
   
 }
 
     
 
 //*******************************************************************************
 void ParamPull::Reconfigure(){
 //*******************************************************************************
   
   FitWeight* rw = FitBase::GetRW();
   
   // Get Dial Names that are valid
   std::vector<std::string> namevec  = rw->GetDialNames();
   std::vector<double>      valuevec = rw->GetDialValues();
 
   // Set Bin Values from RW
   for (UInt_t i = 0; i < namevec.size(); i++){
 
     // Loop over bins and check name matches
     std::string syst = namevec.at(i);
 
     // Proper Reconf using RW
     for (int j = 0; j < fMCHist->GetNbinsX(); j++){
 
       // If Match set value
       if (!syst.compare( fMCHist->GetXaxis()->GetBinLabel(j+1) )){
 	
-	double curval = rw->GetDialValue(syst, fDialOptions);
+	double curval = rw->GetDialValue(syst);
 	fMCHist->SetBinContent(j+1, curval);
       }
     }
   }
 
   return;
 };
 
 //*******************************************************************************  
 void ParamPull::ResetToy(void){
 //*******************************************************************************  
 
   if (fDataHist) delete fDataHist;
 
   LOG(DEB) << "Resetting toy" << std::endl;
   LOG(DEB) << fDataTrue << std::endl;
   fDataHist = (TH1D*)fDataTrue->Clone();
   LOG(DEB) << "Setting name" << std::endl;
   fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			   (fName + " data" + fPlotTitles).c_str() );
   
 }
 
 
     
 //******************************************************************************* 
 void ParamPull::SetFakeData(std::string fakeinput){
 //******************************************************************************* 
 
   // Set from MC Setting
   if (!fakeinput.compare("MC")){
 
     // Copy MC into data
     if (fDataHist) delete fDataHist;
     fDataHist = (TH1D*)fMCHist->Clone();
     fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			     (fName + " fakedata" + fPlotTitles).c_str() );
 
     // Copy original data errors
     for (int i = 0; i < fDataOrig->GetNbinsX(); i++){
       fDataHist->SetBinError(i+1, fDataOrig->GetBinError(i+1) );
     }
 
     // Make True Toy Central Value Hist
     fDataTrue = (TH1D*) fDataHist->Clone();
     fDataTrue->SetNameTitle( (fName + "_truedata").c_str(),
 			     (fName + " truedata" + fPlotTitles).c_str() );
     
   } else {
 
     ERR(FTL) << "Trying to set fake data for ParamPulls not from MC!" << std::endl;
     ERR(FTL) << "Not currently implemented.." << std::endl;
     throw;
     
   }
 }
 
 //*******************************************************************************  
 void ParamPull::RemoveFakeData(){
 //*******************************************************************************
 
   delete fDataHist;
   fDataHist = (TH1D*)fDataOrig->Clone();
   fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			   (fName + " data" + fPlotTitles).c_str() );
   
   fDataTrue = (TH1D*) fDataHist->Clone();
   fDataTrue->SetNameTitle( (fName + "_truedata").c_str(),
 			   (fName + " truedata" + fPlotTitles).c_str() );
 
 }
   
 //******************************************************************************* 
 double ParamPull::GetLikelihood(){
 //*******************************************************************************
   
   double like = 0.0;
 
   switch(fCalcType){
 
   // Gaussian Calculation with correlations
   case kGausPull:
     like = StatUtils::GetChi2FromCov(fDataHist, fMCHist, fInvCovar, NULL);
     like *= 1E-76;
     break;
 
   // Default says this has no pull
   case kNoThrow:
   default:
     like = 0.0;
     break;
   }
 
 
   LOG(DEB) << "Likelihood = " << like << " " << fCalcType << std::endl;
   return like;
   
 };
 
 //*******************************************************************************
 int ParamPull::GetNDOF(){
 //*******************************************************************************
 
   int ndof = 0;
 
   if (fCalcType != kNoThrow){
     ndof += fDataHist->GetNbinsX();
   }
 
   return ndof;
 };
 
 
 //******************************************************************************* 
 void ParamPull::ThrowCovariance(){
 //*******************************************************************************
 
   // Reset toy for throw
   ResetToy();
   LOG(DEB) << "Toy Reset " << std::endl;
   
   // Generate random Gaussian throws
   std::vector<double> randthrows;
   for (int i = 0; i < fDataHist->GetNbinsX(); i++){
     double randtemp = 0.0;
 
     switch(fThrowType){
       
       // Gaussian Throws
     case kGausThrow:
       randtemp = gRandom->Gaus(0.0,1.0);
       break;
       
       // No Throws (DEFAULT)
     default:
       break;
     }
     
     randthrows.push_back(randtemp);
   }
 
   // Create Bin Modifications
   double totalres = 0.0;
   for (int i = 0; i < fDataHist->GetNbinsX(); i++){
 
     // Calc Bin Mod
     double binmod  = 0.0;
     for (int j = 0; j < fDataHist->GetNbinsX(); j++){
+      //      std::cout << "DECOMP " << j << " " << i << " " << randthrows.at(j) << std::endl;
       binmod += (*fDecomp)(j,i) * randthrows.at(j);
     }
 
     // Add up fraction dif
-    totalres += binmod / fDataHist->GetBinContent(i+1);
+    totalres += binmod;
     
     // Add to current data
     fDataHist->SetBinContent(i+1,fDataHist->GetBinContent(i+1) + binmod);
   }
 
   // Rename
   fDataHist->SetNameTitle( (fName + "_data").c_str(),
 			   (fName + " toydata" + fPlotTitles).c_str() );
   
   // Print Status
-  LOG(REC) << "Created new toy histogram. Total Fractional Dif = "
+  LOG(REC) << "Created new toy histogram. Total Dif = "
 	   << totalres << std::endl;
   return;
 };
 
 
 //*******************************************************************************
 TH2D ParamPull::GetCovar(){
 //*******************************************************************************
 
   TH2D tempCov = TH2D(*fInvCovar);
 
   for (int i = 0; i < tempCov.GetNbinsX(); i++){
     tempCov.GetXaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
     tempCov.GetYaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
   }
 
   tempCov.SetNameTitle((fName + "_INVCOV").c_str(),
 			(fName + " InvertedCovariance;Dials;Dials").c_str());
 
   return tempCov;
 }
 
 //*******************************************************************************
 TH2D ParamPull::GetFullCovar(){
 //*******************************************************************************
 
   TH2D tempCov = TH2D(*fCovar);
 
   for (int i = 0; i < tempCov.GetNbinsX(); i++){
     tempCov.GetXaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
     tempCov.GetYaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
   }
 
   tempCov.SetNameTitle((fName + "_COV").c_str(),
 			(fName + " Covariance;Dials;Dials").c_str());
 
   return tempCov;
 }
 
 //*******************************************************************************
 TH2D ParamPull::GetDecompCovar(){
 //*******************************************************************************
 
   TH2D tempCov = TH2D(*fCovar);
 
   for (int i = 0; i < tempCov.GetNbinsX(); i++){
     tempCov.GetXaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
     tempCov.GetYaxis()->SetBinLabel(i+1,fDataHist->GetXaxis()->GetBinLabel(i+1));
   }
 
   tempCov.SetNameTitle((fName + "_DEC").c_str(),
 			(fName + " Decomposition;Dials;Dials").c_str());
 
   return tempCov;
 }
 
 
 //******************************************************************************* 
 void ParamPull::Write(std::string writeoptt){
 //******************************************************************************* 
 
   fDataHist->Write();
   fMCHist->Write();
   
   GetCovar().Write();
   GetFullCovar().Write();
   GetDecompCovar().Write();
   
   return;
 };
 
diff --git a/src/FitBase/ParamPull.h b/src/FitBase/ParamPull.h
index 679c14b..22e707d 100644
--- a/src/FitBase/ParamPull.h
+++ b/src/FitBase/ParamPull.h
@@ -1,186 +1,188 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef PARAM_PULL_H_SEEN
 #define PARAM_PULL_H_SEEN
 
 /*!                                                                                                                                                                                                   
  *  \addtogroup FitBase                                                                                                                                                                               
  *  @{                                                                                                                                                                                                
  */
 
 #include <stdlib.h>
 #include <numeric>
 #include <math.h>
 #include <iostream>
 #include <sstream>
 #include <fstream>
+#include <list>
+#include <vector>
 
 // ROOT includes
 #include <TROOT.h>
 #include <TH1D.h>
 #include <TTree.h>
 #include <TFile.h>
 #include <TMatrixDSym.h>
 #include <TDecompSVD.h>
 #include <TVectorD.h>
 
 // Fit Includes
 #include "PlotUtils.h"
 #include "StatUtils.h"
 #include "FitWeight.h"
 #include "FitLogger.h"
 #include "EventManager.h"
 #include "TVector.h"
 
 using namespace std;
 
 //! Enums to allow Non Guassian Pulls in Future
 enum FitPullTypes {
   kUnknownPull = -1,
   kNoPull = 0,
   kGausPull = 1
 };
 
 enum FitThrowTypes {
   kUnknownThrow = -1,
   kNoThrow = 0,
   kGausThrow = 1
 };
   
 //! Used to produce gaussian penalty terms in the fit.
 class ParamPull {
  public:
 
   //! Default Constructor
   ParamPull(std::string name, std::string inputfile, std::string type, std::string dials="");    
   
   //! Default destructor
   virtual ~ParamPull(void) {};
 
   // Set dial types (DEFAULT,ABS,FRAC)
   void SetType(std::string type);
 
   // Setup Histogram inputs (from previous fit file, or ROOT file)
   void SetupHistograms(std::string input);
 
   // Read a previous NUISANCE file
   void ReadFitFile(std::string input);
 
   // Read a ROOT file with any histograms in
   void ReadRootFile(std::string input);
 
   // Read Text file
   void ReadVectFile(std::string input);
   
   // Read a single dial central value and error
   void ReadDialInput(std::string input);
   
   //! Reconfigure function reads in current RW engine dials and sets their value to MC
   void Reconfigure(void);
 
   //! Get likelihood given the current values
   double GetLikelihood(void);
 
   //! Get NDOF if used in likelihoods
   int GetNDOF(void);
   
   // Get Covariance Matrices as plots
   TH2D GetCovar(void);
   TH2D GetFullCovar(void);
   TH2D GetDecompCovar(void);
 
   // Get Covariance Matrices
   inline TMatrixDSym GetCovarMatrix       (void) const { return *fInvCovar; };
   inline TMatrixDSym GetFullCovarMatrix   (void) const { return *fCovar;    };
   inline TMatrixDSym GetDecompCovarMatrix (void) const { return *fDecomp;   };
 
   //! Save the histograms
   void Write(std::string writeopt="");
 
   //! Throw the dial values using the current covariance. Useful for parameter throws.
   void ThrowCovariance(void);
 
   //! Compare dials to RW
   bool CheckDialsValid(void);
 
   //! Reset toy data back to original data
   void ResetToy(void);
 
   //! Read fake data from MC
   void SetFakeData(std::string fakeinput);
 
   //! Reset fake data back to original data (before fake data or throws)
   void RemoveFakeData();
   
   // Get Functions
   inline std::string GetName        (void) const { return fName;        };
   inline std::string GetInput       (void) const { return fInput;       };
   inline std::string GetType        (void) const { return fType;        };
   inline std::string GetFileType    (void) const { return fFileType;    };
   inline std::string GetDialOptions (void) const { return fDialOptions; };
 
   std::map<std::string, int> GetAllDials();
   
   inline TH1D GetDataHist  (void) const { return *fDataHist; };
   inline TH1D GetDataTrue  (void) const { return *fDataTrue; };
   inline TH1D GetDataOrig  (void) const { return *fDataOrig; };
   inline TH1D GetMCHist    (void) const { return *fMCHist;   };
   inline TH1D GetMaxHist   (void) const { return *fMaxHist;  };
   inline TH1D GetMinHist   (void) const { return *fMinHist;  };
   inline TH1I GetDialTypes (void) const { return *fTypeHist; };
 
  private:
 
   TH1D RemoveBinsNotInString(TH1D hist, std::string mystr);
   TH1I RemoveBinsNotInString(TH1I hist, std::string mystr);
   
   std::string fName;        //!< Pull Name
   std::string fInput;       //!< Pull input string
   std::string fType;        //!< Pull options type
   std::string fFileType;    //!< Pull input file types
   std::string fPlotTitles;  //! Axis format
   std::string fDialOptions; //!< Dial handling options
   std::string fDialSelection; //!< Dial Selection
   
   TH1D* fMCHist;    //!< Current MC Histogram
   TH1D* fDataHist;  //!< Current data Histogram
   TH1D* fDataTrue;  //!< True Data (before histogram throws)
   TH1D* fDataOrig;  //!< Orig Data (without toys or fake data)
   TH1D* fMaxHist;   //!< Maximum limit on MC/Data
   TH1D* fMinHist;   //!< Maximum limit on MC/Data
   TH1I* fTypeHist; //!< Dial Types
   
   int fCalcType;   //!< Method to calculate likelihood
   int fThrowType;  //!< Method to calculate throws
     
   TMatrixDSym* fCovar;    //!< Covariance
   TMatrixDSym* fInvCovar; //!< Inverted Covariance
   TMatrixDSym* fDecomp;   //!< Decomposition
   
 };
 
 // Class TypeDefs
 typedef std::list<ParamPull*>::const_iterator PullListConstIter;
 typedef std::list<ParamPull*>::iterator PullListIter;
 typedef std::vector<ParamPull*>::const_iterator PullVectConstIter;
 typedef std::vector<ParamPull*>::iterator PullVectIter;
 
 /*! @} */  
 #endif
diff --git a/src/FitBase/SampleSettings.cxx b/src/FitBase/SampleSettings.cxx
new file mode 100644
index 0000000..5e37563
--- /dev/null
+++ b/src/FitBase/SampleSettings.cxx
@@ -0,0 +1,158 @@
+#include "SampleSettings.h"
+
+SampleSettings::SampleSettings() {
+};
+
+SampleSettings::SampleSettings(nuiskey key) {
+	fKeyValues = key;
+	if (!key.Has("type")) key.AddS("type", "DEFAULT");
+}
+
+std::string SampleSettings::GetName() {
+	return GetS("name");
+}
+
+void SampleSettings::SetS(std::string name, std::string val) {
+	fKeyValues.SetS(name, val);
+};
+
+bool SampleSettings::Found(std::string name, std::string substr) {
+	std::string compstring = fKeyValues.GetS(name);
+	return compstring.find(substr) != std::string::npos;
+}
+
+
+void SampleSettings::SetXTitle(std::string name) {
+	SetDefault("xtitle", name);
+};
+
+void SampleSettings::SetYTitle(std::string name) {
+	SetDefault("ytitle", name);
+};
+
+
+void SampleSettings::SetZTitle(std::string name) {
+	SetDefault("ztitle", name);
+};
+
+void SampleSettings::SetNormError(double norm) {
+	SetDefault("norm_error", GeneralUtils::DblToStr(norm));
+};
+
+std::string SampleSettings::GetCovarInput() {
+	return GetS("covar");
+}
+
+void SampleSettings::SetAllowedTypes(std::string allowed, std::string defaulttype) {
+	SetDefault("default_types", allowed);
+	SetDefault("allowed_types", defaulttype);
+};
+
+void SampleSettings::SetEnuRangeFromFlux(TH1D* fluxhist) {
+	double enu_min = fluxhist->GetXaxis()->GetXmin();
+	double enu_max = fluxhist->GetXaxis()->GetXmax();
+	SetEnuRange(enu_min, enu_max);
+};
+
+void SampleSettings::SetEnuRange(double min, double max) {
+	SetDefault("enu_min", min);
+	SetDefault("enu_max", max);
+};
+
+void SampleSettings::DefineAllowedTargets(std::string targ) {
+	// fAllowedTargets = TargetUtils::ParseTargetsToIntVect(targ);
+};
+
+
+void SampleSettings::FoundFill(std::string name, std::string substr, bool& cont, bool def) {
+	std::string compstring = fKeyValues.GetS(name);
+	if (compstring.find(substr) != std::string::npos) {
+		cont = def;
+	} else {
+		cont = !def;
+	}
+};
+
+
+void SampleSettings::SetTitle(std::string val) {
+	SetDefault("title", val);
+};
+
+void SampleSettings::SetDataInput(std::string val) {
+	SetDefault("data", val);
+};
+
+std::string SampleSettings::GetMapInput() {
+	return GetS("map");
+}
+void SampleSettings::SetMapInput(std::string val) {
+	SetDefault("map", val);
+}
+
+void SampleSettings::SetErrorInput(std::string val) {
+	SetDefault("error", val);
+};
+
+
+
+void SampleSettings::SetCovarInput(std::string val) {
+	SetDefault("covar", val);
+};
+
+void SampleSettings::SetDefault(std::string name, std::string val) {
+	if (!fKeyValues.Has(name)) fKeyValues.AddS(name, val);
+};
+
+void SampleSettings::SetDefault(std::string name, double val ) {
+	if (!fKeyValues.Has(name)) fKeyValues.AddD(name, val);
+};
+
+void SampleSettings::SetHasExtraHistograms(bool opt) {
+	fHasExtraHistograms = opt;
+};
+
+void SampleSettings::DefineAllowedSpecies(std::string species) {
+	fAllowedTargets = BeamUtils::ParseSpeciesToIntVect(species);
+};
+
+std::string SampleSettings::Title() {
+	return GetS("title");
+}
+
+std::string SampleSettings::GetDataInput() {
+	return GetS("data");
+};
+
+
+std::string SampleSettings::GetErrorInput() {
+	return GetS("error");
+};
+
+std::string SampleSettings::PlotTitles() {
+	return ";" + GetS("xtitle") + ";" + GetS("ytitle");
+};
+
+std::string SampleSettings::GetFullTitles() {
+	return Title() + PlotTitles();
+}
+
+int SampleSettings::GetI(std::string name) {
+	return fKeyValues.GetI(name);
+}
+
+double SampleSettings::GetD(std::string name) {
+  return fKeyValues.GetD(name);
+}
+
+std::string SampleSettings::GetS(std::string name) {
+	return fKeyValues.GetS(name);
+}
+
+void SampleSettings::SetSuggestedFlux(std::string str) {
+	SetS("suggested_flux", str);
+}
+
+void SampleSettings::SetDescription(std::string str) {
+	SetS("description", str);
+}
+
diff --git a/src/FitBase/SampleSettings.h b/src/FitBase/SampleSettings.h
new file mode 100644
index 0000000..607635d
--- /dev/null
+++ b/src/FitBase/SampleSettings.h
@@ -0,0 +1,62 @@
+#ifndef SAMPLESETTINGS_H
+#define SAMPLESETTINGS_H
+#include "NuisConfig.h"
+#include "NuisKey.h"
+#include "TH1D.h"
+#include "BeamUtils.h"
+class SampleSettings {
+public:
+	SampleSettings();
+	SampleSettings(nuiskey key);
+
+	inline std::string Name(){return GetName();};
+	std::string GetName();
+	void SetS(std::string name, std::string val);
+	void SetXTitle(std::string name);
+	void SetYTitle(std::string name);
+	void SetZTitle(std::string name);
+	void SetNormError(double norm);
+
+	void SetAllowedTypes(std::string allowed, std::string defaulttype="FIX");
+	void SetEnuRangeFromFlux(TH1D* fluxhist);
+	void SetEnuRange(double min, double max);
+	std::string Title();
+	void DefineAllowedTargets(std::string targ);
+
+	void FoundFill(std::string name, std::string substr, bool& cont, bool def);
+	// void FoundFill(std::string name, std::string substr, double& val, double )
+	bool Found(std::string name, std::string substr);
+	void SetTitle(std::string val);
+	void SetDataInput(std::string val);
+	void SetErrorInput(std::string val);
+	std::string GetErrorInput();
+
+	std::string GetMapInput();
+	void SetMapInput(std::string val);
+	void SetCovarInput(std::string val);
+
+	void SetDefault(std::string name, std::string val);
+	void SetDefault(std::string name, double val);
+	void SetHasExtraHistograms(bool opt = true);
+	void DefineAllowedSpecies(std::string species);
+	void SetSuggestedFlux(std::string str);
+	void SetDescription(std::string str);
+
+	std::string GetFullTitles();
+	
+	bool Has(std::string name){return fKeyValues.Has(name);};
+
+	std::string GetDataInput();
+	std::string PlotTitles();
+	std::string GetS(std::string name);
+	int GetI(std::string name);
+	double GetD(std::string name);
+	std::string GetCovarInput();
+
+	std::vector<int> fAllowedTargets;
+	std::vector<int> fAllowedSpecies;
+  	nuiskey fKeyValues;
+  	bool fHasExtraHistograms;
+};
+
+#endif
diff --git a/src/FitBase/StatusMessage.h b/src/FitBase/StatusMessage.h
deleted file mode 100644
index 94ad74d..0000000
--- a/src/FitBase/StatusMessage.h
+++ /dev/null
@@ -1,330 +0,0 @@
-#include <iostream>
-#include <sstream>
-
-inline std::string StatusMessage(bool happy = true) {
-  std::stringstream ss("");
-  if (happy) {
-    ss << "   @@@                                                       "
-                 "         @@,  \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"
-                 "  @ .@              @..                         .@           "
-                 ",:+    ;@ @,  \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"
-                 ",,:   "
-                 ":,,:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+:"
-                 ",,:  .:,\n"
-                 "  @   @  "
-                 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ "
-                 ";@  :@ \n"
-                 "   @@@                                                       "
-                 "         @@,  \n"
-              << std::endl;
-  } else {
-    ss << "  @@@                                                        "
-                 "        @@,   \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"
-                 "  @ .@        ,.,'::..`     .              ..     ...:;',.,  "
-                 "       ;@ @,  \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"
-                 ",,:   "
-                 ":,,:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+:"
-                 ",,:  .:,\n"
-                 "  @   @  "
-                 "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ "
-                 ";@  :@ \n"
-                 "   @@@                                                       "
-                 "         @@,  \n"
-              << std::endl;
-  }
-  return ss.str();
-}
diff --git a/src/GGM/CMakeLists.txt b/src/GGM/CMakeLists.txt
index 33019c3..685ab67 100644
--- a/src/GGM/CMakeLists.txt
+++ b/src/GGM/CMakeLists.txt
@@ -1,53 +1,56 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 GGM_CC1ppip_Evt_1DQ2_nu.cxx
 GGM_CC1ppip_XSec_1DEnu_nu.cxx
 )
 
 set(HEADERFILES
 GGM_CC1ppip_Evt_1DQ2_nu.h
 GGM_CC1ppip_XSec_1DEnu_nu.h
 )
 
 set(LIBNAME expGGM)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/GGM/GGM_CC1ppip_Evt_1DQ2_nu.cxx b/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.cxx
index 7fffd5f..90fb1b0 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.cxx
+++ b/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.cxx
@@ -1,74 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "GGM_CC1ppip_Evt_1DQ2_nu.h"
 
-// The constructor
-GGM_CC1ppip_Evt_1DQ2_nu::GGM_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "GGM_CC1ppip_Evt_1DQ2_nu";
-  // could replace with fName = std::string(__FILE__).substr(0, std::string(__FILE__).find_last_of("."))
-  fPlotTitles = "; Q^{2}_{CC1#pi} (GeV^{2}); Number of events";
-  EnuMin = 1;
-  EnuMax = 10;
-  fIsDiag = true;
-  fIsRawEvents = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/GGM/CC1pip_on_p/GGM_CC1ppip_Q2_events_bin_edit.txt");
-  this->SetupDefaultHist();
+//********************************************************************
+GGM_CC1ppip_Evt_1DQ2_nu::GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
 
-  // set Poisson errors on fDataHist (scanned does not have this)
-  // Simple counting experiment here
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinError(i+1, sqrt(fDataHist->GetBinContent(i+1)));
-  }
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "GGM_CC1ppip_Evt_1DQ2_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CC1#pi} (GeV^{2})");
+  fSettings.SetYTitle("Number of events");
+  fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG");
+  fSettings.SetEnuRange(1.0, 10.0);
+  fSettings.DefineAllowedTargets("D,H");
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents+0.)*(16./8.);
-};
+  // plot information
+  fSettings.SetTitle("GGM_CC1ppip_Evt_1DQ2_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "GGM/CC1pip_on_p/GGM_CC1ppip_Q2_events_bin_edit.txt");
 
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents+0.)*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetPoissonErrors();
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+}
 
 void GGM_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;
 
   // GGM 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 GGM_CC1ppip_Evt_1DQ2_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi3Prong(event, 14, 211, 2212, EnuMin, EnuMax);
 }
diff --git a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h b/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
index 10ffba5..d2f883e 100644
--- a/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
+++ b/src/GGM/GGM_CC1ppip_Evt_1DQ2_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 #define GGM_CC1PPIP_EVT_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class GGM_CC1ppip_Evt_1DQ2_nu : public Measurement1D {
 public:
-  GGM_CC1ppip_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  GGM_CC1ppip_Evt_1DQ2_nu(nuiskey samplekey);
   virtual ~GGM_CC1ppip_Evt_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
   
 #endif
diff --git a/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.cxx b/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.cxx
index 764b052..c961121 100644
--- a/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.cxx
+++ b/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.cxx
@@ -1,68 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "GGM_CC1ppip_XSec_1DEnu_nu.h"
 
-// The constructor
-GGM_CC1ppip_XSec_1DEnu_nu::GGM_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "GGM_CC1ppip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/proton)";
-  EnuMin = 1.;
-  EnuMax = 10.0;
-  fIsDiag = true;
-  fNormError = 0.20;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+GGM_CC1ppip_XSec_1DEnu_nu::GGM_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/GGM/CC1pip_on_p/Gargamelle78-numu-p-to-mu-p-piplus-lowW_EDGES.txt");
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "GGM_CC1ppip_XSec_1DEnu_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // 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(1.0, 10.0);
+  fSettings.DefineAllowedTargets("D,H");
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(16./8.);
-};
+  // plot information
+  fSettings.SetTitle("GGM_CC1ppip_XSec_1DEnu_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "GGM/CC1pip_on_p/Gargamelle78-numu-p-to-mu-p-piplus-lowW_EDGES.txt");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(2./1.);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+}
 
 void GGM_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;
 
   // should probably put in a weight here!
   double hadMass = FitUtils::MpPi(Pp, Ppip);
   double Enu     = -1.0;
 
   if (hadMass < 1400) Enu = Pnu.E()/1.E3;
   fXVar = Enu;
 
   return;
 }
 
 
 bool GGM_CC1ppip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi3Prong(event, 14, 211, 2212,EnuMin,EnuMax);
 }
 
diff --git a/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.h b/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.h
index f6c3b7d..b02e431 100644
--- a/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.h
+++ b/src/GGM/GGM_CC1ppip_XSec_1DEnu_nu.h
@@ -1,40 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef GGM_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 #define GGM_CC1PPIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class GGM_CC1ppip_XSec_1DEnu_nu : public Measurement1D {
 public:
-  GGM_CC1ppip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  GGM_CC1ppip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~GGM_CC1ppip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
   bool isSignal(FitEvent *event);
-  //void FillHistograms();
-
 
  private:
 
 };
 
 #endif
diff --git a/src/InputHandler/BaseFitEvt.cxx b/src/InputHandler/BaseFitEvt.cxx
new file mode 100644
index 0000000..9814c63
--- /dev/null
+++ b/src/InputHandler/BaseFitEvt.cxx
@@ -0,0 +1,180 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "BaseFitEvt.h"
+
+BaseFitEvt::BaseFitEvt() {
+
+  Mode = 0;
+  E    = 0.0;
+
+  Weight        = 1.0;
+  InputWeight   = 1.0;
+  RWWeight      = 1.0;
+  CustomWeight  = 1.0;
+  SavedRWWeight = 1.0;
+
+  fSplineCoeff = NULL;
+  fSplineRead = NULL;
+
+  fGenInfo = NULL;
+  fType = 9999;
+
+#ifdef __NEUT_ENABLED__
+  fNeutVect = NULL;
+#endif
+
+#ifdef __NUWRO_ENABLED__
+  fNuwroEvent = NULL;
+#endif
+
+#ifdef __GENIE_ENABLED__
+  genie_event  = NULL;
+  genie_record = NULL;
+#endif
+
+#ifdef __NUANCE_ENABLED__
+  nuance_event = NULL;
+#endif
+
+#ifdef __GiBUU_ENABLED__
+  GiRead = NULL;
+#endif
+};
+
+BaseFitEvt::~BaseFitEvt(){
+
+#ifdef __NEUT_ENABLED__
+  if (fNeutVect) delete fNeutVect;
+#endif
+
+#ifdef __NUWRO_ENABLED__
+  if (fNuwroEvent) delete fNuwroEvent;
+#endif
+
+#ifdef __GENIE_ENABLED__
+  if (genie_event) delete genie_event;
+#endif
+
+#ifdef __NUANCE_ENABLED__
+  if (nuance_event) delete nuance_event;
+#endif
+
+#ifdef __GiBUU_ENABLED__
+  if (GiRead) delete GiRead;
+#endif
+
+};
+
+BaseFitEvt::BaseFitEvt(const BaseFitEvt *obj) {
+ 
+  this->Mode = obj->Mode;
+  this->E    = obj->E;
+
+  this->Weight        = obj->Weight;
+  this->InputWeight   = obj->InputWeight;
+  this->RWWeight      = obj->RWWeight;
+  this->CustomWeight  = obj->CustomWeight;
+  this->SavedRWWeight = obj->SavedRWWeight;
+
+  this->fSplineCoeff = obj->fSplineCoeff;
+  this->fSplineRead  = obj->fSplineRead;
+
+  this->fGenInfo = obj->fGenInfo;
+  this->fType    = obj->fType;
+
+#ifdef __NEUT_ENABLED__
+  fNeutVect = obj->fNeutVect;
+#endif
+
+#ifdef __NUWRO_ENABLED__
+  fNuwroEvent = obj->fNuwroEvent;
+#endif
+
+#ifdef __GENIE_ENABLED__
+  genie_event = obj->genie_event;
+#endif
+
+  #ifdef __NUANCE_ENABLED__
+  nuance_event = obj->nuance_event;
+#endif
+
+#ifdef __GiBUU_ENABLED__
+  GiRead = obj->GiRead;
+#endif
+
+};
+
+void BaseFitEvt::ResetWeight(){
+  InputWeight = 1.0;
+}
+
+double BaseFitEvt::GetWeight(){ 
+  return InputWeight * RWWeight * CustomWeight; 
+};
+
+
+#ifdef __NEUT_ENABLED__
+void BaseFitEvt::SetNeutVect(NeutVect* v){
+  fType     = kNEUT;
+  fNeutVect = v;
+}
+#endif
+
+#ifdef __NUWRO_ENABLED__
+void BaseFitEvt::SetNuwroEvent(event* e){
+  fType = kNUWRO;
+  fNuwroEvent = e;
+}
+#endif
+
+#ifdef __GENIE_ENABLED__
+void BaseFitEvt::SetGenieEvent(NtpMCEventRecord* ntpl){
+  fType = kGENIE;
+  genie_event = ntpl;
+}
+#endif
+
+#ifdef __NUANCE_ENABLED__
+void BaseFitEvt::SetNuanceEvent(NuanceEvent* e){
+  fType = kNUANCE;
+  nuance_event = e;
+}
+#endif
+
+#ifdef __GiBUU_ENABLED__
+void BaseFitEvt::SetGiBUUReader(GiBUUStdHepReader* g){
+  fType = kGiBUU;
+  GiRead = g;
+}
+#endif
+
+void BaseFitEvt::SetInputFitEvent(){
+  fType = kINPUTFITEVENT;
+}
+
+void BaseFitEvt::SetInputFitSpline(){
+  fType = kNEWSPLINE;
+}
+
+void BaseFitEvt::SetInputHepMC(){
+  fType = kHEPMC;
+}
+
+
+
diff --git a/src/InputHandler/BaseFitEvt.h b/src/InputHandler/BaseFitEvt.h
new file mode 100644
index 0000000..ef102cc
--- /dev/null
+++ b/src/InputHandler/BaseFitEvt.h
@@ -0,0 +1,132 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef FITEVENTBASE_H_SEEN
+#define FITEVENTBASE_H_SEEN
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+
+#ifdef __NEUT_ENABLED__
+#include "neutpart.h"
+#include "neutvect.h"
+#endif
+
+#ifdef __NUWRO_ENABLED__
+#include "event1.h"
+#endif
+
+#ifdef __GENIE_ENABLED__
+#include "EVGCore/EventRecord.h"
+#include "GHEP/GHepRecord.h"
+#include "Ntuple/NtpMCEventRecord.h"
+using namespace genie;
+#endif
+
+#ifdef __NUANCE_ENABLED__
+#include "NuanceEvent.h"
+#endif
+
+#include "StdHepEvt.h"
+#include "SplineReader.h"
+#include "InputTypes.h"
+#include "GeneratorInfoBase.h"
+
+/// Base Event Class used to store just the generator event pointers 
+class BaseFitEvt {
+ public:
+
+  /// Base Constructor
+  BaseFitEvt(void);
+  ~BaseFitEvt();
+
+  /// Copy base fit event pointers
+  BaseFitEvt(const BaseFitEvt* obj);
+
+  /// Reset weight to 1.0
+  void ResetWeight();
+
+  /// Return combined weight for this event
+  double GetWeight();
+
+  /// Manually set event type
+  inline void SetType(int type){fType = type;};
+  
+  // Global Event Variables/Weights
+  int Mode;  ///< True interaction mode
+  double E;  ///< True probe energy
+  
+  // Weighting Info
+  double Weight;        ///< Total Weight For Event
+  double InputWeight;   ///< Input Starting Weight (used for GiBUU)
+  double RWWeight;      ///< Saved RW from FitWeight
+  double CustomWeight;  ///< Extra custom weight that samples can set
+  double SavedRWWeight; ///< Saved RW value for FitEvents
+
+  // Spline Info Coefficients and Readers
+  float* fSplineCoeff; ///< ND Array of Spline Coefficients
+  SplineReader* fSplineRead; ///< Spline Interpretter
+
+  // Generator Info
+  GeneratorInfoBase* fGenInfo; ///< Generator Variable Box
+  UInt_t fType; ///< Generator Event Type
+
+#ifdef __NEUT_ENABLED__
+  /// Setup Event Reading from NEUT Event
+  void SetNeutVect(NeutVect* v);
+  NeutVect* fNeutVect;  ///< Pointer to Neut Vector
+#endif
+
+#ifdef __NUWRO_ENABLED__
+  /// Setup Event Reading from NuWro Event
+  void SetNuwroEvent(event* e);
+  event* fNuwroEvent;  ///< Pointer to Nuwro event
+#endif
+
+#ifdef __GENIE_ENABLED__
+  /// Setup Event Reading from GENIE Event
+  void SetGenieEvent(NtpMCEventRecord* ntpl);
+  NtpMCEventRecord* genie_event;  ///< Pointer to NTuple Genie Event
+  GHepRecord* genie_record;  ///< Pointer to actually accessible Genie Record
+#endif
+
+#ifdef __NUANCE_ENABLED__
+  /// Setup Event Reading from NUANCE Event
+  void SetNuanceEvent(NuanceEvent* e);
+  NuanceEvent* nuance_event; ///< Pointer to Nuance reader
+#endif
+
+#ifdef __GiBUU_ENABLED__
+  /// Setup Event Reading from GIBUU Event
+  void SetGiBUUReader(GiBUUStdHepReader* g);
+  GiBUUStdHepReader* GiRead; ///< Pointer to GiBUU reader
+#endif
+
+  /// Setup Event Type to FitEvent
+  void SetInputFitEvent();
+
+  /// Setup Event Type to FitSpline
+  void SetInputFitSpline();
+
+  /// Setup Event Type to HepMC
+  void SetInputHepMC();
+
+};
+/*! @} */
+#endif
diff --git a/src/FitBase/CMakeLists.txt b/src/InputHandler/CMakeLists.txt
similarity index 71%
copy from src/FitBase/CMakeLists.txt
copy to src/InputHandler/CMakeLists.txt
index 89f6e00..35ca3d9 100644
--- a/src/FitBase/CMakeLists.txt
+++ b/src/InputHandler/CMakeLists.txt
@@ -1,72 +1,96 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
-ParamPull.cxx
 BaseFitEvt.cxx
 FitParticle.cxx
-FitWeight.cxx
-Measurement1D.cxx
-EventManager.cxx
-InputHandler.cxx
-Measurement2D.cxx
 FitEvent.cxx
-JointMeas1D.cxx
-MeasurementBase.cxx
 GeneratorUtils.cxx
 StdHepEvt.cxx
-TemplateMeas1D.cxx
 InputUtils.cxx
+NEUTInputHandler.cxx
+GENIEInputHandler.cxx
+NuWroInputHandler.cxx
+GIBUUInputHandler.cxx
+NUANCEInputHandler.cxx
+InputHandler.cxx
+NuanceEvent.cxx
+FitEventInputHandler.cxx
+SplineInputHandler.cxx
+GeneratorInfoBase.h
+InputTypes.h
+HepMCTextInputHandler.cxx
+InputFactory.cxx
 )
 
 set(HEADERFILES
-ParamPull.h
 NuanceEvent.h
-BaseFitEvt.h    FitEvent.h     JointMeas1D.h    Measurement2D.h
-EventManager.h  FitParticle.h  FitWeight.h      MeasurementBase.h
-InputHandler.h   Measurement1D.h GeneratorUtils.h StdHepEvt.h TemplateMeas1D.h
+BaseFitEvt.h    
+FitEvent.h   
+FitParticle.h     
+GeneratorUtils.h 
+StdHepEvt.h 
 InputUtils.h
+NEUTInputHandler.h
+HepMCTextInputHandler.h
+GENIEInputHandler.h
+NuWroInputHandler.h
+InputHandler.h
+GIBUUInputHandler.h
+NUANCEInputHandler.h
+FitEventInputHandler.h
+SplineInputHandler.h
+GeneratorInfoBase.h
+InputFactory.h
+InteractionModes.h
 )
 
-set(LIBNAME FitBase)
+set(LIBNAME InputHandler)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
+if (USE_GENIE)
+   include_directories(${GENIE_INCLUDES}/Apps)
+   include_directories(${GENIE_INCLUDES}/FluxDrivers)
+   include_directories(${GENIE_INCLUDES}/EVGDrivers)
+endif()
+
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/InputHandler/FitEvent.cxx b/src/InputHandler/FitEvent.cxx
new file mode 100644
index 0000000..ddc376d
--- /dev/null
+++ b/src/InputHandler/FitEvent.cxx
@@ -0,0 +1,433 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is pddrt of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "FitEvent.h"
+#include <iostream>
+#include "TObjArray.h"
+
+FitEvent::FitEvent() {
+
+  fGenInfo = NULL;
+  kRemoveFSIParticles = true;
+  kRemoveUndefParticles = true;
+
+  AllocateParticleStack(400);
+
+};
+
+
+void FitEvent::AddGeneratorInfo(GeneratorInfoBase* gen) {
+  fGenInfo = gen;
+  gen->AllocateParticleStack(kMaxParticles);
+}
+
+void FitEvent::AllocateParticleStack(int stacksize) {
+  LOG(DEB) << "Allocating particle stack of size: " << stacksize << std::endl;
+  kMaxParticles = stacksize;
+
+  fParticleList  = new FitParticle*[kMaxParticles];
+
+  fParticleMom   = new double*[kMaxParticles];
+  fParticleState = new UInt_t[kMaxParticles];
+  fParticlePDG   = new int[kMaxParticles];
+
+  fOrigParticleMom   = new double*[kMaxParticles];
+  fOrigParticleState = new UInt_t[kMaxParticles];
+  fOrigParticlePDG   = new int[kMaxParticles];
+
+  for (size_t i = 0; i < kMaxParticles; i++) {
+    fParticleList[i]    = NULL;
+    fParticleMom[i]     = new double[4];
+    fOrigParticleMom[i] = new double[4];
+  }
+
+  if (fGenInfo) fGenInfo->AllocateParticleStack(kMaxParticles);
+
+}
+
+void FitEvent::ExpandParticleStack(int stacksize) {
+  DeallocateParticleStack();
+  AllocateParticleStack(stacksize);
+}
+
+void FitEvent::DeallocateParticleStack() {
+
+  for (size_t i = 0; i < kMaxParticles; i++) {
+    if (fParticleList[i]) delete fParticleList[i];
+    delete fParticleMom[i];
+    delete fOrigParticleMom[i];
+  }
+  delete fParticleMom;
+  delete fOrigParticleMom;
+
+  delete fParticleList;
+
+  delete fParticleState;
+  delete fParticlePDG;
+
+  delete fOrigParticleState;
+  delete fOrigParticlePDG;
+
+  if (fGenInfo) fGenInfo -> DeallocateParticleStack();
+
+  kMaxParticles = 0;
+
+}
+
+void FitEvent::ClearFitParticles() {
+  for (size_t i = 0; i < kMaxParticles; i++) {
+    fParticleList[i] = NULL;
+  }
+}
+
+void FitEvent::FreeFitParticles() {
+  for (size_t i = 0; i < kMaxParticles; i++) {
+    FitParticle* fp = fParticleList[i];
+    if (fp) delete fp;
+    fParticleList[i] = NULL;
+  }
+}
+
+void FitEvent::ResetParticleList() {
+  for (unsigned int i = 0; i < kMaxParticles; i++) {
+    FitParticle* fp = fParticleList[i];
+    if (fp) delete fp;
+    fParticleList[i] = NULL;
+  }
+}
+
+void FitEvent::HardReset() {
+  for (unsigned int i = 0; i < kMaxParticles; i++) {
+    fParticleList[i] = NULL;
+  }
+}
+
+void FitEvent::ResetEvent() {
+
+  fMode = 9999;
+  Mode = 9999;
+  fEventNo = -1;
+  fTotCrs = -1.0;
+  fTargetA = -1;
+  fTargetZ = -1;
+  fTargetH = -1;
+  fBound = false;
+  fNParticles = 0;
+
+  if (fGenInfo) fGenInfo->Reset();
+
+  for (unsigned int i = 0; i < kMaxParticles; i++) {
+    if (fParticleList[i]) delete fParticleList[i];
+    fParticleList[i] = NULL;
+
+    continue;
+
+    fParticlePDG[i] = 0;
+    fParticleState[i] = kUndefinedState;
+    fParticleMom[i][0] = 0.0;
+    fParticleMom[i][1] = 0.0;
+    fParticleMom[i][2] = 0.0;
+    fParticleMom[i][3] = 0.0;
+
+    fOrigParticlePDG[i] = 0;
+    fOrigParticleState[i] = kUndefinedState;
+    fOrigParticleMom[i][0] = 0.0;
+    fOrigParticleMom[i][1] = 0.0;
+    fOrigParticleMom[i][2] = 0.0;
+    fOrigParticleMom[i][3] = 0.0;
+  }
+
+}
+
+void FitEvent::OrderStack() {
+
+  // Copy current stack
+  int npart = fNParticles;
+
+  for (int i = 0; i < npart; i++) {
+    fOrigParticlePDG[i]    = fParticlePDG[i];
+    fOrigParticleState[i]  = fParticleState[i];
+    fOrigParticleMom[i][0] = fParticleMom[i][0];
+    fOrigParticleMom[i][1] = fParticleMom[i][1];
+    fOrigParticleMom[i][2] = fParticleMom[i][2];
+    fOrigParticleMom[i][3] = fParticleMom[i][3];
+  }
+
+  // Now run loops for each particle
+  fNParticles = 0;
+  int stateorder[6] = {kInitialState,   kFinalState,     kFSIState,
+                       kNuclearInitial, kNuclearRemnant, kUndefinedState
+                      };
+
+  for (int s = 0; s < 6; s++) {
+    for (int i = 0; i < npart; i++) {
+      if ((UInt_t)fOrigParticleState[i] != (UInt_t)stateorder[s]) continue;
+
+      fParticlePDG[fNParticles]    = fOrigParticlePDG[i];
+      fParticleState[fNParticles]  = fOrigParticleState[i];
+      fParticleMom[fNParticles][0] = fOrigParticleMom[i][0];
+      fParticleMom[fNParticles][1] = fOrigParticleMom[i][1];
+      fParticleMom[fNParticles][2] = fOrigParticleMom[i][2];
+      fParticleMom[fNParticles][3] = fOrigParticleMom[i][3];
+
+      fNParticles++;
+    }
+  }
+
+  if (LOG_LEVEL(DEB)) {
+    LOG(DEB) << "Ordered stack" << std::endl;
+    for (int i = 0; i < fNParticles; i++) {
+      LOG(DEB) << "Particle " << i << ". " << fParticlePDG[i] << " "
+               << fParticleMom[i][0] << " " << fParticleMom[i][1] << " "
+               << fParticleMom[i][2] << " " << fParticleMom[i][3] << " "
+               << fParticleState[i] << std::endl;
+    }
+  }
+
+  if (fNParticles != npart) {
+    ERR(FTL) << "Dropped some particles when ordering the stack!" << std::endl;
+  }
+
+  return;
+}
+
+
+void FitEvent::Print() {
+
+  if (LOG_LEVEL(EVT)) {
+    LOG(EVT) << "EVTEvent print" << std::endl;
+    LOG(EVT) << "Mode: " << fMode << std::endl;
+    LOG(EVT) << "Particles: " << fNParticles << std::endl;
+    LOG(EVT) << " -> Particle Stack " << std::endl;
+    for (int i = 0; i < fNParticles; i++) {
+      LOG(EVT) << " -> -> " << i << ". " << fParticlePDG[i] << " "
+               << fParticleState[i] << " "
+               << "  Mom(" << fParticleMom[i][0] << ", " << fParticleMom[i][1]
+               << ", " << fParticleMom[i][2] << ", " << fParticleMom[i][3] << ")."
+               << std::endl;
+    }
+  }
+  return;
+}
+
+/* Read/Write own event class */
+void FitEvent::SetBranchAddress(TChain* tn) {
+
+  tn->SetBranchAddress("Mode",    &fMode);
+  tn->SetBranchAddress("Mode",    &Mode);
+
+  tn->SetBranchAddress("EventNo", &fEventNo);
+  tn->SetBranchAddress("TotCrs",  &fTotCrs);
+  tn->SetBranchAddress("TargetA", &fTargetA);
+  tn->SetBranchAddress("TargetH", &fTargetH);
+  tn->SetBranchAddress("Bound",   &fBound);
+
+  tn->SetBranchAddress("RWWeight",    &SavedRWWeight);
+  tn->SetBranchAddress("InputWeight", &InputWeight);
+
+  tn->SetBranchAddress("NParticles",    &fNParticles);
+  tn->SetBranchAddress("ParticleState", fParticleState);
+  tn->SetBranchAddress("ParticlePDG",   fParticlePDG);
+  tn->SetBranchAddress("ParticleMom",   fParticleMom);
+
+}
+
+void FitEvent::AddBranchesToTree(TTree* tn) {
+
+  tn->Branch("Mode", &Mode, "Mode/I");
+
+  tn->Branch("EventNo", &fEventNo, "EventNo/i");
+  tn->Branch("TotCrs",  &fTotCrs,  "TotCrs/D");
+  tn->Branch("TargetA", &fTargetA, "TargetA/I");
+  tn->Branch("TargetH", &fTargetH, "TargetH/I");
+  tn->Branch("Bound",   &fBound,   "Bound/O");
+
+  tn->Branch("RWWeight",    &RWWeight,    "RWWeight/D");
+  tn->Branch("InputWeight", &InputWeight, "InputWeight/D");
+
+  tn->Branch("NParticles",    &fNParticles,       "NParticles/I");
+  tn->Branch("ParticleState", fOrigParticleState, "ParticleState[NParticles]/i");
+  tn->Branch("ParticlePDG",   fOrigParticlePDG,   "ParticlePDG[NParticles]/I");
+  tn->Branch("ParticleMom",   fOrigParticleMom,   "ParticleMom[NParticles][4]/D");
+
+}
+
+
+// ------- EVENT ACCESS FUNCTION --------- //
+TLorentzVector FitEvent::GetParticleP4 (int index) const {
+  if (index == -1 or index >= fNParticles) return TLorentzVector();
+  return TLorentzVector( fParticleMom[index][0],
+                         fParticleMom[index][1],
+                         fParticleMom[index][2],
+                         fParticleMom[index][3] );
+}
+
+TVector3  FitEvent::GetParticleP3 (int index) const {
+  if (index == -1 or index >= fNParticles) return TVector3();
+  return TVector3( fParticleMom[index][0],
+                   fParticleMom[index][1],
+                   fParticleMom[index][2] );
+}
+
+double FitEvent::GetParticleMom (int index) const {
+  if (index == -1 or index >= fNParticles) return 0.0;
+  return sqrt(fParticleMom[index][0] * fParticleMom[index][0] +
+              fParticleMom[index][1] * fParticleMom[index][1] +
+              fParticleMom[index][2] * fParticleMom[index][2]);
+}
+
+double FitEvent::GetParticleMom2 (int index) const {
+  if (index == -1 or index >= fNParticles) return 0.0;
+  return fabs((fParticleMom[index][0] * fParticleMom[index][0] +
+               fParticleMom[index][1] * fParticleMom[index][1] +
+               fParticleMom[index][2] * fParticleMom[index][2]));
+}
+
+double FitEvent::GetParticleE (int index) const {
+  if (index == -1 or index >= fNParticles) return 0.0;
+  return fParticleMom[index][3];
+}
+
+int FitEvent::GetParticleState (int index) const {
+  if (index == -1 or index >= fNParticles) return kUndefinedState;
+  return (fParticleState[index]);
+}
+
+int FitEvent::GetParticlePDG (int index) const {
+  if (index == -1 or index >= fNParticles) return 0;
+  return (fParticlePDG[index]);
+}
+
+FitParticle* FitEvent::GetParticle (int const i) {
+
+  // Check Valid Index
+  if (i == -1){
+    return NULL;
+  }
+
+  // Check Valid
+  if (i > (UInt_t)fNParticles) {
+    ERR(FTL) << "Requesting particle beyond stack!" << std::endl
+             << "i = " << i << " N = " << fNParticles << std::endl
+             << "Mode = " << fMode << std::endl;
+    throw;
+  }
+
+  if (!fParticleList[i]) {
+    fParticleList[i] = new FitParticle(fParticleMom[i][0], fParticleMom[i][1],
+                                       fParticleMom[i][2], fParticleMom[i][3],
+                                       fParticlePDG[i], fParticleState[i]);
+  } else {
+    fParticleList[i]->SetValues(fParticleMom[i][0], fParticleMom[i][1],
+                                fParticleMom[i][2], fParticleMom[i][3],
+                                fParticlePDG[i], fParticleState[i]);
+
+  }
+
+  return fParticleList[i];
+}
+
+bool FitEvent::HasParticle(int const pdg, int const state) const {
+  bool found = false;
+  for (int i = 0; i < fNParticles; i++) {
+    if (state != -1 && fParticleState[i] != (uint)state) continue;
+    if (fParticlePDG[i] == pdg) found = true;
+  }
+  return found;
+}
+
+int FitEvent::NumParticle(int const pdg, int const state) const {
+  int nfound = 0;
+  for (int i = 0; i < fNParticles; i++) {
+    if (state != -1 and fParticleState[i] != (uint)state) continue;
+    if (pdg == 0 or fParticlePDG[i] == pdg) nfound += 1;
+  }
+  return nfound;
+}
+
+std::vector<int> FitEvent::GetAllParticleIndices (int const pdg, int const state) const {
+  std::vector<int> indexlist;
+  for (int i = 0; i < fNParticles; i++) {
+    if (state != -1 and fParticleState[i] != (uint)state) continue;
+    if (pdg == 0 or fParticlePDG[i] == pdg) {
+      indexlist.push_back(i);
+    }
+  }
+  return indexlist;
+}
+
+std::vector<FitParticle*> FitEvent::GetAllParticle(int const pdg, int const state) {
+  std::vector<int> indexlist = GetAllParticleIndices(pdg, state);
+  std::vector<FitParticle*> plist;
+  for (std::vector<int>::iterator iter = indexlist.begin();
+       iter != indexlist.end(); iter++) {
+    plist.push_back( GetParticle((*iter)) );
+  }
+  return plist;
+}
+
+int FitEvent::GetHMParticleIndex (int const pdg, int const state) const {
+  double maxmom2 = -9999999.9;
+  int maxind = -1;
+  for (int i = 0; i < fNParticles; i++) {
+    if (state != -1 and fParticleState[i] != (uint)state) continue;
+    if (pdg == 0 or fParticlePDG[i] == pdg) {
+
+      double newmom2 = GetParticleMom2(i);
+      if (newmom2 > maxmom2) {
+        maxind = i;
+        maxmom2 = newmom2;
+      }
+    }
+  }
+  return maxind;
+}
+
+int FitEvent::GetBeamNeutrinoIndex   (void) const {
+  for (int i = 0; i < fNParticles; i++){
+    if (fParticleState[i] != kInitialState) continue;
+    int pdg = abs(fParticlePDG[i]);
+    if (pdg == 12 or pdg == 14 or pdg == 16){
+      return i;
+    }
+  }
+  return 0;
+}
+
+
+int FitEvent::GetBeamElectronIndex   (void) const {
+  return GetHMISParticleIndex( 11 );
+}
+
+int FitEvent::GetBeamPionIndex   (void) const {
+  return GetHMISParticleIndex( PhysConst::pdg_pions );
+}
+
+int FitEvent::NumFSMesons() {
+  int nMesons = 0;
+
+  for (int i = 0; i < fNParticles; i++) {
+    if (fParticleState[i] != kFinalState) continue;
+    if (abs(fParticlePDG[i]) >= 111 && abs(fParticlePDG[i]) <= 557)
+      nMesons += 1;
+  }
+
+  return nMesons;
+}
+
+
diff --git a/src/InputHandler/FitEvent.h b/src/InputHandler/FitEvent.h
new file mode 100644
index 0000000..7e7f14d
--- /dev/null
+++ b/src/InputHandler/FitEvent.h
@@ -0,0 +1,603 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef FITEVENT2_H_SEEN
+#define FITEVENT2_H_SEEN
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+
+#include <algorithm>
+#include <iterator>
+#include <vector>
+#include "FitParticle.h"
+#include "TLorentzVector.h"
+#include "TSpline.h"
+#include "FitParameters.h"
+#include "BaseFitEvt.h"
+#include "FitLogger.h"
+#include "TArrayD.h"
+#include "TTree.h"
+#include "TChain.h"
+
+/// Common container for event particles
+class FitEvent : public BaseFitEvt {
+public:
+
+  FitEvent();
+  ~FitEvent() {};
+
+  void FreeFitParticles();
+  void ClearFitParticles();
+  void ResetEvent(void);
+  void ResetParticleList(void);
+  void HardReset();
+  void OrderStack();
+  void SetBranchAddress(TChain* tn);
+  void AddBranchesToTree(TTree* tn);
+  void Print();
+  void PrintChris();
+  void DeallocateParticleStack();
+  void AllocateParticleStack(int stacksize);
+  void ExpandParticleStack(int stacksize);
+  void AddGeneratorInfo(GeneratorInfoBase* gen);
+
+
+  // ---- HELPER/ACCESS FUNCTIONS ---- //
+  /// Return True Interaction ID
+  inline int GetMode    (void) const { return fMode;    };
+  /// Return Target Atomic Number
+  inline int GetTargetA (void) const { return fTargetA; };
+  /// Return Target Nuclear Charge
+  inline int GetTargetZ (void) const { return fTargetZ; };
+  /// Get Event Total Cross-section
+  inline int GetTotCrs  (void) const { return fTotCrs;  };
+
+  /// Is Event Charged Current?
+  inline bool IsCC() const { return (abs(fMode) <= 30); };
+  /// Is Event Neutral Current?
+  inline bool IsNC() const { return (abs(fMode) > 30);  };
+
+  /// Return Particle 4-momentum for given index in particle stack
+  TLorentzVector GetParticleP4    (int index) const;
+  /// Return Particle 3-momentum for given index in particle stack
+  TVector3       GetParticleP3    (int index) const;
+  /// Return Particle absolute momentum for given index in particle stack
+  double         GetParticleMom   (int index) const;
+  /// Return Particle absolute momentum-squared for given index in particle stack
+  double         GetParticleMom2  (int index) const;
+  /// Return Particle energy for given index in particle stack
+  double         GetParticleE     (int index) const;
+  /// Return Particle State for given index in particle stack
+  int            GetParticleState (int index) const;
+  /// Return Particle PDG for given index in particle stack
+  int            GetParticlePDG   (int index) const;
+
+
+  /// Return Particle for given index in particle stack
+  FitParticle* GetParticle(int const index);
+  /// Get Total Number of Particles in stack
+  inline uint  NParticles (void) const { return fNParticles; };
+
+  /// Check if event contains a particle given a pdg and state.
+  /// If no state is passed all states are considered.
+  bool HasParticle (int const pdg = 0, int const state = -1) const ;
+
+  template <size_t N>
+  inline bool HasParticle(int const (&pdgs)[N], int const state = -1) const {
+    for (size_t i = 0; i < N; i++) {
+      if (HasParticle( pdgs[i], state )) {
+        return false;
+      }
+    }
+    return false;
+  }
+
+  /// Get total number of particles given a pdg and state.
+  /// If no state is passed all states are considered.
+  int  NumParticle (int const pdg = 0, int const state = -1) const;
+
+  template <size_t N>
+  inline int NumParticle(int const (&pdgs)[N], int const state = -1) const {
+    int ncount = 0;
+    for (size_t i = 0; i < N; i++) {
+      ncount += NumParticle( pdgs[i], state );
+    }
+    return ncount;
+  }
+
+  /// Return a vector of particle indices that can be used with 'GetParticle'
+  /// functions given a particle pdg and state.
+  /// If no state is passed all states are considered.
+  std::vector<int> GetAllParticleIndices (int const pdg = -1, int const state = -1) const;
+
+  template <size_t N>
+  inline std::vector<int> GetAllParticleIndices(int const (&pdgs)[N], const int state = -1) const {
+    std::vector<int> plist;
+    for (size_t i = 0; i < N; i++) {
+      std::vector<int> plisttemp = GetAllParticleIndices(pdgs[i], state);
+      plist.insert( plist.end(), plisttemp.begin(), plisttemp.end() );
+    }
+    return plist;
+  }
+
+  /// Return a vector of FitParticles given a particle pdg and state.
+  /// This is memory intensive and slow than GetAllParticleIndices,
+  /// but is slightly easier to use. 
+  std::vector<FitParticle*> GetAllParticle (int const pdg = -1, int const state = -1);
+
+  template <size_t N>
+  inline std::vector<FitParticle*> GetAllParticle(int const (&pdgs)[N], int const state = -1) {
+    std::vector<FitParticle*> plist;
+    for (size_t i = 0; i < N; i++) {
+      std::vector<FitParticle*> plisttemp = GetAllParticle(pdgs[i], state);
+      plist.insert( plist.end(), plisttemp.begin(), plisttemp.end() );
+    }
+    return plist;
+  }
+
+  inline std::vector<int> GetAllNuElectronIndices (void) { return GetAllParticleIndices(12);   };
+  inline std::vector<int> GetAllNuMuonIndices     (void) { return GetAllParticleIndices(14);   };
+  inline std::vector<int> GetAllNuTauIndices      (void) { return GetAllParticleIndices(16);   };
+  inline std::vector<int> GetAllElectronIndices   (void) { return GetAllParticleIndices(11);   };
+  inline std::vector<int> GetAllMuonIndices       (void) { return GetAllParticleIndices(13);   };
+  inline std::vector<int> GetAllTauIndices        (void) { return GetAllParticleIndices(15);   };
+  inline std::vector<int> GetAllProtonIndices     (void) { return GetAllParticleIndices(2212); };
+  inline std::vector<int> GetAllNeutronIndices    (void) { return GetAllParticleIndices(2112); };
+  inline std::vector<int> GetAllPiZeroIndices     (void) { return GetAllParticleIndices(111);  };
+  inline std::vector<int> GetAllPiPlusIndices     (void) { return GetAllParticleIndices(211);  };
+  inline std::vector<int> GetAllPiMinusIndices    (void) { return GetAllParticleIndices(-211); };
+  inline std::vector<int> GetAllPhotonIndices     (void) { return GetAllParticleIndices(22);   };
+
+  inline std::vector<FitParticle*> GetAllNuElectron (void) { return GetAllParticle(12);   };
+  inline std::vector<FitParticle*> GetAllNuMuon     (void) { return GetAllParticle(14);   };
+  inline std::vector<FitParticle*> GetAllNuTau      (void) { return GetAllParticle(16);   };
+  inline std::vector<FitParticle*> GetAllElectron   (void) { return GetAllParticle(11);   };
+  inline std::vector<FitParticle*> GetAllMuon       (void) { return GetAllParticle(13);   };
+  inline std::vector<FitParticle*> GetAllTau        (void) { return GetAllParticle(15);   };
+  inline std::vector<FitParticle*> GetAllProton     (void) { return GetAllParticle(2212); };
+  inline std::vector<FitParticle*> GetAllNeutron    (void) { return GetAllParticle(2112); };
+  inline std::vector<FitParticle*> GetAllPiZero     (void) { return GetAllParticle(111);  };
+  inline std::vector<FitParticle*> GetAllPiPlus     (void) { return GetAllParticle(211);  };
+  inline std::vector<FitParticle*> GetAllPiMinus    (void) { return GetAllParticle(-211); };
+  inline std::vector<FitParticle*> GetAllPhoton     (void) { return GetAllParticle(22);   };
+
+  // --- Highest Momentum Search Functions --- //
+  /// Returns the Index of the highest momentum particle given a pdg and state.
+  /// If no state is given all states are considered, but that will just return the
+  /// momentum of the beam in most cases so is not advised.
+  int  GetHMParticleIndex (int const pdg = 0, int const state = -1) const;
+
+  template <size_t N>
+  inline int GetHMParticleIndex (int const (&pdgs)[N], int const state = -1) const {
+
+    double mom = 0.0;
+    int rtnindex = -1;
+
+    for (size_t i = 0; i < N; ++i) {
+      // Use ParticleMom as doesn't require Particle Mem alloc
+      int pindex = GetHMParticleIndex(pdgs[i], state);
+      double momnew = GetParticleMom2(pindex);
+      if (momnew > 0.0 && (momnew > mom)) {
+        rtnindex = pindex;
+        mom = momnew;
+      }
+    }
+    return rtnindex;
+  };
+
+  /// Returns the highest momentum particle given a pdg and state.
+  /// If no state is given all states are considered, but that will just return the
+  /// momentum of the beam in most cases so is not advised.
+  inline FitParticle* GetHMParticle(int const pdg = 0, int const state = -1) {
+    return GetParticle( GetHMParticleIndex(pdg, state) );
+  }
+
+  template <size_t N>
+  inline FitParticle* GetHMParticle(int const (&pdgs)[N], int const state) {
+    return GetParticle(GetHMParticleIndex(pdgs, state));
+  };
+
+
+  // ---- Initial State Helpers --- //
+  /// Checks the event has a particle of a given pdg in the initial state.
+  inline bool HasISParticle(int const pdg) const {
+    return HasParticle(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline bool HasISParticle(int const (&pdgs)[N]) const {
+    return HasParticle(pdgs, kInitialState);
+  };
+
+  /// Returns the number of particles with a given pdg in the initial state.
+  inline int NumISParticle(int const pdg = 0) const {
+    return NumParticle(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline int NumISParticle(int const (&pdgs)[N]) const {
+    return NumParticle(pdgs, kInitialState);
+  };
+
+  /// Returns a list of indices for all particles with a given pdg
+  /// in the initial state. These can be used with the 'GetParticle' functions.
+  inline std::vector<int> GetAllISParticleIndices(int const pdg = -1) const {
+    return GetAllParticleIndices(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline std::vector<int> GetAllISParticleIndices(int const (&pdgs)[N]) const {
+    return GetAllParticleIndices(pdgs, kInitialState);
+  };
+
+  /// Returns a list of particles with a given pdg in the initial state.
+  /// This function is more memory intensive and slower than the Indices function.
+  inline std::vector<FitParticle*> GetAllISParticle(int const pdg = -1) {
+    return GetAllParticle(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline std::vector<FitParticle*> GetAllISParticle(int const (&pdgs)[N]) {
+    return GetAllParticle(pdgs, kInitialState);
+  };
+
+  /// Returns the highest momentum particle with a given pdg in the initial state.
+  inline FitParticle* GetHMISParticle(int const pdg) {
+    return GetHMParticle(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline FitParticle* GetHMISParticle(int const (&pdgs)[N]) {
+    return GetHMParticle(pdgs, kInitialState);
+  };
+
+  /// Returns the highest momentum particle index with a given pdg in the initial state.
+  inline int GetHMISParticleIndex(int const pdg) const {
+    return GetHMParticleIndex(pdg, kInitialState);
+  };
+  template <size_t N>
+  inline int GetHMISParticleIndex(int const (&pdgs)[N]) const {
+    return GetHMParticleIndex(pdgs, kInitialState);
+  };
+
+  inline bool HasISNuElectron   (void) const { return HasISParticle(12);   };
+  inline bool HasISNuMuon       (void) const { return HasISParticle(14);   };
+  inline bool HasISNuTau        (void) const { return HasISParticle(16);   };
+  inline bool HasISElectron     (void) const { return HasISParticle(11);   };
+  inline bool HasISMuon         (void) const { return HasISParticle(13);   };
+  inline bool HasISTau          (void) const { return HasISParticle(15);   };
+  inline bool HasISProton       (void) const { return HasISParticle(2212); };
+  inline bool HasISNeutron      (void) const { return HasISParticle(2112); };
+  inline bool HasISPiZero       (void) const { return HasISParticle(111);  };
+  inline bool HasISPiPlus       (void) const { return HasISParticle(211);  };
+  inline bool HasISPiMinus      (void) const { return HasISParticle(-211); };
+  inline bool HasISPhoton       (void) const { return HasISParticle(22);   };
+  inline bool HasISLeptons      (void) const { return HasISParticle(PhysConst::pdg_leptons);       };
+  inline bool HasISPions        (void) const { return HasISParticle(PhysConst::pdg_pions);         };
+  inline bool HasISChargePions  (void) const { return HasISParticle(PhysConst::pdg_charged_pions); };
+
+  inline int NumISNuElectron   (void) const { return NumISParticle(12);   };
+  inline int NumISNuMuon       (void) const { return NumISParticle(14);   };
+  inline int NumISNuTau        (void) const { return NumISParticle(16);   };
+  inline int NumISElectron     (void) const { return NumISParticle(11);   };
+  inline int NumISMuon         (void) const { return NumISParticle(13);   };
+  inline int NumISTau          (void) const { return NumISParticle(15);   };
+  inline int NumISProton       (void) const { return NumISParticle(2212); };
+  inline int NumISNeutron      (void) const { return NumISParticle(2112); };
+  inline int NumISPiZero       (void) const { return NumISParticle(111);  };
+  inline int NumISPiPlus       (void) const { return NumISParticle(211);  };
+  inline int NumISPiMinus      (void) const { return NumISParticle(-211); };
+  inline int NumISPhoton       (void) const { return NumISParticle(22);   };
+  inline int NumISLeptons      (void) const { return NumISParticle(PhysConst::pdg_leptons);       };
+  inline int NumISPions        (void) const { return NumISParticle(PhysConst::pdg_pions);         };
+  inline int NumISChargePions  (void) const { return NumISParticle(PhysConst::pdg_charged_pions); };
+
+  inline std::vector<int> GetAllISNuElectronIndices (void) const { return GetAllISParticleIndices(12);   };
+  inline std::vector<int> GetAllISNuMuonIndices     (void) const { return GetAllISParticleIndices(14);   };
+  inline std::vector<int> GetAllISNuTauIndices      (void) const { return GetAllISParticleIndices(16);   };
+  inline std::vector<int> GetAllISElectronIndices   (void) const { return GetAllISParticleIndices(11);   };
+  inline std::vector<int> GetAllISMuonIndices       (void) const { return GetAllISParticleIndices(13);   };
+  inline std::vector<int> GetAllISTauIndices        (void) const { return GetAllISParticleIndices(15);   };
+  inline std::vector<int> GetAllISProtonIndices     (void) const { return GetAllISParticleIndices(2212); };
+  inline std::vector<int> GetAllISNeutronIndices    (void) const { return GetAllISParticleIndices(2112); };
+  inline std::vector<int> GetAllISPiZeroIndices     (void) const { return GetAllISParticleIndices(111);  };
+  inline std::vector<int> GetAllISPiPlusIndices     (void) const { return GetAllISParticleIndices(211);  };
+  inline std::vector<int> GetAllISPiMinusIndices    (void) const { return GetAllISParticleIndices(-211); };
+  inline std::vector<int> GetAllISPhotonIndices     (void) const { return GetAllISParticleIndices(22);   };
+  inline std::vector<int> GetAllISLeptonsIndices    (void) const { return GetAllISParticleIndices(PhysConst::pdg_leptons);       };
+  inline std::vector<int> GetAllISPionsIndices      (void) const { return GetAllISParticleIndices(PhysConst::pdg_pions);         };
+  inline std::vector<int> GetAllISChargePionsIndices(void) const { return GetAllISParticleIndices(PhysConst::pdg_charged_pions); };
+
+  inline std::vector<FitParticle*> GetAllISNuElectron (void) { return GetAllISParticle(12);   };
+  inline std::vector<FitParticle*> GetAllISNuMuon     (void) { return GetAllISParticle(14);   };
+  inline std::vector<FitParticle*> GetAllISNuTau      (void) { return GetAllISParticle(16);   };
+  inline std::vector<FitParticle*> GetAllISElectron   (void) { return GetAllISParticle(11);   };
+  inline std::vector<FitParticle*> GetAllISMuon       (void) { return GetAllISParticle(13);   };
+  inline std::vector<FitParticle*> GetAllISTau        (void) { return GetAllISParticle(15);   };
+  inline std::vector<FitParticle*> GetAllISProton     (void) { return GetAllISParticle(2212); };
+  inline std::vector<FitParticle*> GetAllISNeutron    (void) { return GetAllISParticle(2112); };
+  inline std::vector<FitParticle*> GetAllISPiZero     (void) { return GetAllISParticle(111);  };
+  inline std::vector<FitParticle*> GetAllISPiPlus     (void) { return GetAllISParticle(211);  };
+  inline std::vector<FitParticle*> GetAllISPiMinus    (void) { return GetAllISParticle(-211); };
+  inline std::vector<FitParticle*> GetAllISPhoton     (void) { return GetAllISParticle(22);   };
+  inline std::vector<FitParticle*> GetAllISLeptons    (void) { return GetAllISParticle(PhysConst::pdg_leptons);       };
+  inline std::vector<FitParticle*> GetAllISPions      (void) { return GetAllISParticle(PhysConst::pdg_pions);         };
+  inline std::vector<FitParticle*> GetAllISChargePions(void) { return GetAllISParticle(PhysConst::pdg_charged_pions); };
+
+  inline FitParticle* GetHMISNuElectron (void) { return GetHMISParticle(12);   };
+  inline FitParticle* GetHMISNuMuon     (void) { return GetHMISParticle(14);   };
+  inline FitParticle* GetHMISNuTau      (void) { return GetHMISParticle(16);   };
+  inline FitParticle* GetHMISElectron   (void) { return GetHMISParticle(11);   };
+  inline FitParticle* GetHMISMuon       (void) { return GetHMISParticle(13);   };
+  inline FitParticle* GetHMISTau        (void) { return GetHMISParticle(15);   };
+  inline FitParticle* GetHMISProton     (void) { return GetHMISParticle(2212); };
+  inline FitParticle* GetHMISNeutron    (void) { return GetHMISParticle(2112); };
+  inline FitParticle* GetHMISPiZero     (void) { return GetHMISParticle(111);  };
+  inline FitParticle* GetHMISPiPlus     (void) { return GetHMISParticle(211);  };
+  inline FitParticle* GetHMISPiMinus    (void) { return GetHMISParticle(-211); };
+  inline FitParticle* GetHMISPhoton     (void) { return GetHMISParticle(22);   };
+  inline FitParticle* GetHMISLeptons    (void) { return GetHMISParticle(PhysConst::pdg_leptons);       };
+  inline FitParticle* GetHMISPions      (void) { return GetHMISParticle(PhysConst::pdg_pions);         };
+  inline FitParticle* GetHMISChargePions(void) { return GetHMISParticle(PhysConst::pdg_charged_pions); };
+
+  inline int GetHMISNuElectronIndex (void) { return GetHMISParticleIndex(12);   };
+  inline int GetHMISNuMuonIndex     (void) { return GetHMISParticleIndex(14);   };
+  inline int GetHMISNuTauIndex      (void) { return GetHMISParticleIndex(16);   };
+  inline int GetHMISElectronIndex   (void) { return GetHMISParticleIndex(11);   };
+  inline int GetHMISMuonIndex       (void) { return GetHMISParticleIndex(13);   };
+  inline int GetHMISTauIndex        (void) { return GetHMISParticleIndex(15);   };
+  inline int GetHMISProtonIndex     (void) { return GetHMISParticleIndex(2212); };
+  inline int GetHMISNeutronIndex    (void) { return GetHMISParticleIndex(2112); };
+  inline int GetHMISPiZeroIndex     (void) { return GetHMISParticleIndex(111);  };
+  inline int GetHMISPiPlusIndex     (void) { return GetHMISParticleIndex(211);  };
+  inline int GetHMISPiMinusIndex    (void) { return GetHMISParticleIndex(-211); };
+  inline int GetHMISPhotonIndex     (void) { return GetHMISParticleIndex(22);   };
+  inline int GetHMISLeptonsIndex    (void) { return GetHMISParticleIndex(PhysConst::pdg_leptons);       };
+  inline int GetHMISPionsIndex      (void) { return GetHMISParticleIndex(PhysConst::pdg_pions);         };
+  inline int GetHMISChargePionsIndex(void) { return GetHMISParticleIndex(PhysConst::pdg_charged_pions); };
+
+  // ---- Final State Helpers --- //
+  inline bool HasFSParticle(int const pdg) const {
+    return HasParticle(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline bool HasFSParticle(int const (&pdgs)[N]) const {
+    return HasParticle(pdgs, kFinalState);
+  };
+
+  inline int NumFSParticle(int const pdg = 0) const {
+    return NumParticle(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline int NumFSParticle(int const (&pdgs)[N]) const {
+    return NumParticle(pdgs, kFinalState);
+  };
+
+  inline std::vector<int> GetAllFSParticleIndices(int const pdg = -1) const {
+    return GetAllParticleIndices(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline std::vector<int> GetAllFSParticleIndices(int const (&pdgs)[N]) const {
+    return GetAllParticleIndices(pdgs, kFinalState);
+  };
+
+  inline std::vector<FitParticle*> GetAllFSParticle(int const pdg = -1) {
+    return GetAllParticle(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline std::vector<FitParticle*> GetAllFSParticle(int const (&pdgs)[N]) {
+    return GetAllParticle(pdgs, kFinalState);
+  };
+
+  inline FitParticle* GetHMFSParticle(int const pdg) {
+    return GetHMParticle(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline FitParticle* GetHMFSParticle(int const (&pdgs)[N]) {
+    return GetHMParticle(pdgs, kFinalState);
+  };
+
+  inline int GetHMFSParticleIndex(int const pdg) const {
+    return GetHMParticleIndex(pdg, kFinalState);
+  };
+  template <size_t N>
+  inline int GetHMFSParticleIndex(int const (&pdgs)[N]) const {
+    return GetHMParticleIndex(pdgs, kFinalState);
+  };
+
+  inline bool HasFSNuElectron   (void) const { return HasFSParticle(12);   };
+  inline bool HasFSNuMuon       (void) const { return HasFSParticle(14);   };
+  inline bool HasFSNuTau        (void) const { return HasFSParticle(16);   };
+  inline bool HasFSElectron     (void) const { return HasFSParticle(11);   };
+  inline bool HasFSMuon         (void) const { return HasFSParticle(13);   };
+  inline bool HasFSTau          (void) const { return HasFSParticle(15);   };
+  inline bool HasFSProton       (void) const { return HasFSParticle(2212); };
+  inline bool HasFSNeutron      (void) const { return HasFSParticle(2112); };
+  inline bool HasFSPiZero       (void) const { return HasFSParticle(111);  };
+  inline bool HasFSPiPlus       (void) const { return HasFSParticle(211);  };
+  inline bool HasFSPiMinus      (void) const { return HasFSParticle(-211); };
+  inline bool HasFSPhoton       (void) const { return HasFSParticle(22);   };
+  inline bool HasFSLeptons      (void) const { return HasFSParticle(PhysConst::pdg_leptons);       };
+  inline bool HasFSPions        (void) const { return HasFSParticle(PhysConst::pdg_pions);         };
+  inline bool HasFSChargePions  (void) const { return HasFSParticle(PhysConst::pdg_charged_pions); };
+
+  inline int NumFSNuElectron   (void) const { return NumFSParticle(12);   };
+  inline int NumFSNuMuon       (void) const { return NumFSParticle(14);   };
+  inline int NumFSNuTau        (void) const { return NumFSParticle(16);   };
+  inline int NumFSElectron     (void) const { return NumFSParticle(11);   };
+  inline int NumFSMuon         (void) const { return NumFSParticle(13);   };
+  inline int NumFSTau          (void) const { return NumFSParticle(15);   };
+  inline int NumFSProton       (void) const { return NumFSParticle(2212); };
+  inline int NumFSNeutron      (void) const { return NumFSParticle(2112); };
+  inline int NumFSPiZero       (void) const { return NumFSParticle(111);  };
+  inline int NumFSPiPlus       (void) const { return NumFSParticle(211);  };
+  inline int NumFSPiMinus      (void) const { return NumFSParticle(-211); };
+  inline int NumFSPhoton       (void) const { return NumFSParticle(22);   };
+  inline int NumFSLeptons      (void) const { return NumFSParticle(PhysConst::pdg_leptons);       };
+  inline int NumFSPions        (void) const { return NumFSParticle(PhysConst::pdg_pions);         };
+  inline int NumFSChargePions  (void) const { return NumFSParticle(PhysConst::pdg_charged_pions); };
+
+  inline std::vector<int> GetAllFSNuElectronIndices (void) const { return GetAllFSParticleIndices(12);   };
+  inline std::vector<int> GetAllFSNuMuonIndices     (void) const { return GetAllFSParticleIndices(14);   };
+  inline std::vector<int> GetAllFSNuTauIndices      (void) const { return GetAllFSParticleIndices(16);   };
+  inline std::vector<int> GetAllFSElectronIndices   (void) const { return GetAllFSParticleIndices(11);   };
+  inline std::vector<int> GetAllFSMuonIndices       (void) const { return GetAllFSParticleIndices(13);   };
+  inline std::vector<int> GetAllFSTauIndices        (void) const { return GetAllFSParticleIndices(15);   };
+  inline std::vector<int> GetAllFSProtonIndices     (void) const { return GetAllFSParticleIndices(2212); };
+  inline std::vector<int> GetAllFSNeutronIndices    (void) const { return GetAllFSParticleIndices(2112); };
+  inline std::vector<int> GetAllFSPiZeroIndices     (void) const { return GetAllFSParticleIndices(111);  };
+  inline std::vector<int> GetAllFSPiPlusIndices     (void) const { return GetAllFSParticleIndices(211);  };
+  inline std::vector<int> GetAllFSPiMinusIndices    (void) const { return GetAllFSParticleIndices(-211); };
+  inline std::vector<int> GetAllFSPhotonIndices     (void) const { return GetAllFSParticleIndices(22);   };
+  inline std::vector<int> GetAllFSLeptonsIndices    (void) const { return GetAllFSParticleIndices(PhysConst::pdg_leptons);       };
+  inline std::vector<int> GetAllFSPionsIndices      (void) const { return GetAllFSParticleIndices(PhysConst::pdg_pions);         };
+  inline std::vector<int> GetAllFSChargePionsIndices(void) const { return GetAllFSParticleIndices(PhysConst::pdg_charged_pions); };
+
+  inline std::vector<FitParticle*> GetAllFSNuElectron (void) { return GetAllFSParticle(12);   };
+  inline std::vector<FitParticle*> GetAllFSNuMuon     (void) { return GetAllFSParticle(14);   };
+  inline std::vector<FitParticle*> GetAllFSNuTau      (void) { return GetAllFSParticle(16);   };
+  inline std::vector<FitParticle*> GetAllFSElectron   (void) { return GetAllFSParticle(11);   };
+  inline std::vector<FitParticle*> GetAllFSMuon       (void) { return GetAllFSParticle(13);   };
+  inline std::vector<FitParticle*> GetAllFSTau        (void) { return GetAllFSParticle(15);   };
+  inline std::vector<FitParticle*> GetAllFSProton     (void) { return GetAllFSParticle(2212); };
+  inline std::vector<FitParticle*> GetAllFSNeutron    (void) { return GetAllFSParticle(2112); };
+  inline std::vector<FitParticle*> GetAllFSPiZero     (void) { return GetAllFSParticle(111);  };
+  inline std::vector<FitParticle*> GetAllFSPiPlus     (void) { return GetAllFSParticle(211);  };
+  inline std::vector<FitParticle*> GetAllFSPiMinus    (void) { return GetAllFSParticle(-211); };
+  inline std::vector<FitParticle*> GetAllFSPhoton     (void) { return GetAllFSParticle(22);   };
+  inline std::vector<FitParticle*> GetAllFSLeptons     (void) { return GetAllFSParticle(PhysConst::pdg_leptons);       };
+  inline std::vector<FitParticle*> GetAllFSPions       (void) { return GetAllFSParticle(PhysConst::pdg_pions);         };
+  inline std::vector<FitParticle*> GetAllFSChargePions (void) { return GetAllFSParticle(PhysConst::pdg_charged_pions); };
+
+  inline FitParticle* GetHMFSNuElectron (void) { return GetHMFSParticle(12);   };
+  inline FitParticle* GetHMFSNuMuon     (void) { return GetHMFSParticle(14);   };
+  inline FitParticle* GetHMFSNuTau      (void) { return GetHMFSParticle(16);   };
+  inline FitParticle* GetHMFSElectron   (void) { return GetHMFSParticle(11);   };
+  inline FitParticle* GetHMFSMuon       (void) { return GetHMFSParticle(13);   };
+  inline FitParticle* GetHMFSTau        (void) { return GetHMFSParticle(15);   };
+  inline FitParticle* GetHMFSProton     (void) { return GetHMFSParticle(2212); };
+  inline FitParticle* GetHMFSNeutron    (void) { return GetHMFSParticle(2112); };
+  inline FitParticle* GetHMFSPiZero     (void) { return GetHMFSParticle(111);  };
+  inline FitParticle* GetHMFSPiPlus     (void) { return GetHMFSParticle(211);  };
+  inline FitParticle* GetHMFSPiMinus    (void) { return GetHMFSParticle(-211); };
+  inline FitParticle* GetHMFSPhoton     (void) { return GetHMFSParticle(22);   };
+  inline FitParticle* GetHMFSLeptons    (void) { return GetHMFSParticle(PhysConst::pdg_leptons);       };
+  inline FitParticle* GetHMFSPions      (void) { return GetHMFSParticle(PhysConst::pdg_pions);         };
+  inline FitParticle* GetHMFSChargePions(void) { return GetHMFSParticle(PhysConst::pdg_charged_pions); };
+
+  inline int GetHMFSNuElectronIndex (void) const { return GetHMFSParticleIndex(12);   };
+  inline int GetHMFSNuMuonIndex     (void) const { return GetHMFSParticleIndex(14);   };
+  inline int GetHMFSNuTauIndex      (void) const { return GetHMFSParticleIndex(16);   };
+  inline int GetHMFSElectronIndex   (void) const { return GetHMFSParticleIndex(11);   };
+  inline int GetHMFSMuonIndex       (void) const { return GetHMFSParticleIndex(13);   };
+  inline int GetHMFSTauIndex        (void) const { return GetHMFSParticleIndex(15);   };
+  inline int GetHMFSProtonIndex     (void) const { return GetHMFSParticleIndex(2212); };
+  inline int GetHMFSNeutronIndex    (void) const { return GetHMFSParticleIndex(2112); };
+  inline int GetHMFSPiZeroIndex     (void) const { return GetHMFSParticleIndex(111);  };
+  inline int GetHMFSPiPlusIndex     (void) const { return GetHMFSParticleIndex(211);  };
+  inline int GetHMFSPiMinusIndex    (void) const { return GetHMFSParticleIndex(-211); };
+  inline int GetHMFSPhotonIndex     (void) const { return GetHMFSParticleIndex(22);   };
+  inline int GetHMFSLeptonsIndex    (void) const { return GetHMFSParticleIndex(PhysConst::pdg_leptons);       };
+  inline int GetHMFSPionsIndex      (void) const { return GetHMFSParticleIndex(PhysConst::pdg_pions);         };
+  inline int GetHMFSChargePionsIndex(void) const { return GetHMFSParticleIndex(PhysConst::pdg_charged_pions); };
+
+  // ---- NEUTRINO INCOMING Related Functions
+  int                   GetBeamNeutrinoIndex   (void) const;
+  inline TLorentzVector GetBeamNeutrinoP4      (void) const { return GetParticleP4(GetBeamNeutrinoIndex()); };
+  inline TVector3       GetBeamNeutrinoP3      (void) const { return GetParticleP3(GetBeamNeutrinoIndex()); };
+  inline double         GetBeamNeutrinoMom     (void) const { return GetParticleMom(GetBeamNeutrinoIndex()); };
+  inline double         GetBeamNeutrinoMom2    (void) const { return GetParticleMom2(GetBeamNeutrinoIndex()); };
+  inline double         GetBeamNeutrinoE       (void) const { return GetParticleE(GetBeamNeutrinoIndex()); };
+  inline double         Enu                    (void) const { return GetBeamNeutrinoE(); };
+  inline int            GetBeamNeutrinoPDG     (void) const { return GetParticlePDG(GetBeamNeutrinoIndex()); };
+  inline int            PDGnu                  (void) const { return GetBeamNeutrinoPDG(); };
+  inline int            GetNeutrinoInPos       (void) const { return GetBeamNeutrinoIndex(); };
+  inline FitParticle*   GetBeamNeutrino        (void) { return GetParticle(GetBeamNeutrinoIndex()); };
+  inline FitParticle*   GetNeutrinoIn          (void) { return GetParticle(GetBeamNeutrinoIndex()); };
+
+
+  // ---- Electron INCOMING Related Functions
+  int                   GetBeamElectronIndex   (void) const;
+  inline TLorentzVector GetBeamElectronP4      (void) const { return GetParticleP4(GetBeamElectronIndex()); };
+  inline TVector3       GetBeamElectronP3      (void) const { return GetParticleP3(GetBeamElectronIndex()); };
+  inline double         GetBeamElectronMom     (void) const { return GetParticleMom(GetBeamElectronIndex()); };
+  inline double         GetBeamElectronMom2    (void) const { return GetParticleMom2(GetBeamElectronIndex()); };
+  inline double         GetBeamElectronE       (void) const { return GetParticleE(GetBeamElectronIndex()); };
+  inline FitParticle*   GetBeamElectron        (void) { return GetParticle(GetBeamElectronIndex()); };
+
+  // ---- Pion INCOMING Functions
+  int                   GetBeamPionIndex   (void) const;
+  inline TLorentzVector GetBeamPionP4      (void) const { return GetParticleP4(GetBeamPionIndex()); };
+  inline TVector3       GetBeamPionP3      (void) const { return GetParticleP3(GetBeamPionIndex()); };
+  inline double         GetBeamPionMom     (void) const { return GetParticleMom(GetBeamPionIndex()); };
+  inline double         GetBeamPionMom2    (void) const { return GetParticleMom2(GetBeamPionIndex()); };
+  inline double         GetBeamPionE       (void) const { return GetParticleE(GetBeamPionIndex()); };
+  inline FitParticle*   GetBeamPion        (void) { return GetParticle(GetBeamPionIndex()); };
+
+  /// Legacy Functions
+  inline FitParticle* PartInfo(uint i) { return GetParticle(i); };
+  inline UInt_t Npart (void) const { return NPart(); };
+  inline UInt_t NPart (void) const { return fNParticles; };
+
+
+
+  // Other Functions
+  int NumFSMesons();
+  inline int GetBeamPartPos(void) const { return 0; };
+  FitParticle* GetBeamPart(void);
+
+  int GetLeptonOutPos(void) const;
+  FitParticle* GetLeptonOut(void);
+
+
+  // Event Information
+  double weight;  // need for silly reason
+  int Mode;  // Public access needed
+
+  int fMode;
+  UInt_t fEventNo;
+  double fTotCrs;
+  int fTargetA;
+  int fTargetZ;
+  int fTargetH;
+  bool fBound;
+  int fDistance;
+  int fTargetPDG;
+
+  // Reduced Particle Stack
+  UInt_t kMaxParticles;
+  int fNParticles;
+  double** fParticleMom;
+  UInt_t* fParticleState;
+  int* fParticlePDG;
+  FitParticle** fParticleList;
+
+  double** fOrigParticleMom;
+  UInt_t* fOrigParticleState;
+  int* fOrigParticlePDG;
+
+  double* fNEUT_ParticleStatusCode;
+  double* fNEUT_ParticleAliveCode;
+  GeneratorInfoBase* fGenInfo;
+
+  // Config Options for this class
+  bool kRemoveFSIParticles;
+  bool kRemoveUndefParticles;
+
+
+
+};
+/*! @} */
+#endif
diff --git a/src/InputHandler/FitEventInputHandler.cxx b/src/InputHandler/FitEventInputHandler.cxx
new file mode 100644
index 0000000..7de683a
--- /dev/null
+++ b/src/InputHandler/FitEventInputHandler.cxx
@@ -0,0 +1,100 @@
+#include "FitEventInputHandler.h"
+
+FitEventInputHandler::FitEventInputHandler(std::string const& handle, std::string const& rawinputs) {
+    LOG(SAM) << "Creating FitEventInputHandler : " << handle << std::endl;
+
+    // Run a joint input handling
+    fName = handle;
+    fFitEventTree = new TChain("nuisance_events");
+    fCacheSize = FitPar::Config().GetParI("CacheSize");
+
+    std::vector<std::string> inputs = InputUtils::ParseInputFileList(rawinputs);
+    for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
+
+
+        // Open File for histogram access
+        TFile* inp_file = new TFile(inputs[inp_it].c_str(), "READ");
+        if (!inp_file or inp_file->IsZombie()) {
+            ERR(FTL) << "FitEvent File IsZombie() at " << inputs[inp_it] << std::endl;
+            throw;
+        }
+
+        // Get Flux/Event hist
+        TH1D* fluxhist  = (TH1D*)inp_file->Get("nuisance_fluxhist");
+        TH1D* eventhist = (TH1D*)inp_file->Get("nuisance_eventhist");
+        if (!fluxhist or !eventhist) {
+            ERR(FTL) << "FitEvent FILE doesn't contain flux/xsec info" << std::endl;
+            throw;
+        }
+
+        // Get N Events
+        TTree* eventtree = (TTree*)inp_file->Get("nuisance_events");
+        if (!eventtree) {
+            ERR(FTL) << "nuisance_events not located in GENIE file! " << inputs[inp_it] << std::endl;
+            throw;
+        }
+        int nevents = eventtree->GetEntries();
+
+        // Register input to form flux/event rate hists
+        RegisterJointInput(inputs[inp_it], nevents, fluxhist, eventhist);
+
+        // Add to TChain
+        fFitEventTree->Add( inputs[inp_it].c_str() );
+    }
+
+    // Registor all our file inputs
+    SetupJointInputs();
+
+    // Assign to tree
+    fEventType = kINPUTFITEVENT;
+
+    // Create Fit Event
+    fNUISANCEEvent = new FitEvent();
+    fNUISANCEEvent->HardReset();
+    fNUISANCEEvent->SetBranchAddress(fFitEventTree);
+
+}
+
+FitEventInputHandler::~FitEventInputHandler(){
+    if (fFitEventTree) delete fFitEventTree;
+}
+
+void FitEventInputHandler::CreateCache() {
+    fFitEventTree->SetCacheEntryRange(0, fNEvents);
+    fFitEventTree->AddBranchToCache("*", 1);
+    fFitEventTree->SetCacheSize(fCacheSize);
+}
+
+void FitEventInputHandler::RemoveCache() {
+    fFitEventTree->SetCacheEntryRange(0, fNEvents);
+    fFitEventTree->AddBranchToCache("*", 0);
+    fFitEventTree->SetCacheSize(0);
+}
+
+FitEvent* FitEventInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+    // Return NULL if out of bounds
+    if (entry >= (UInt_t)fNEvents) return NULL;
+
+    // Reset all variables before tree read
+    fNUISANCEEvent->ResetEvent();
+
+    // Read NUISANCE Tree
+    fFitEventTree->GetEntry(entry);
+
+    // Setup Input scaling for joint inputs
+    fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+
+    return fNUISANCEEvent;
+}
+
+
+double FitEventInputHandler::GetInputWeight(int entry) {
+    double w = InputHandlerBase::GetInputWeight(entry);
+    return w * fNUISANCEEvent->SavedRWWeight;
+}
+
+void FitEventInputHandler::Print() {
+}
+
+
diff --git a/src/InputHandler/FitEventInputHandler.h b/src/InputHandler/FitEventInputHandler.h
new file mode 100644
index 0000000..45eb979
--- /dev/null
+++ b/src/InputHandler/FitEventInputHandler.h
@@ -0,0 +1,37 @@
+#ifndef FITEVENT_INPUTHANDLER_H
+#define FITEVENT_INPUTHANDLER_H
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+#include "InputHandler.h"
+#include "FitEvent.h"
+#include "PlotUtils.h"
+
+/// Class to read in NUISANCE FitEvents that have been saved to tree
+class FitEventInputHandler : public InputHandlerBase {
+public:
+
+	/// Standard constructor given name and inputs
+	FitEventInputHandler(std::string const& handle, std::string const& rawinputs);
+	virtual ~FitEventInputHandler();
+
+	/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+
+	/// Returns NUISANCE FitEvent from the TTree. If lightweight does nothing.
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight=false);
+
+	/// Alongside InputWeight also returns any saved RWWeights
+	double GetInputWeight(int entry);
+
+	/// Print out event information
+	void Print();
+
+	TChain* fFitEventTree; ///< TTree from FitEvent file.
+};
+/*! @} */
+#endif
diff --git a/src/InputHandler/FitParticle.cxx b/src/InputHandler/FitParticle.cxx
new file mode 100644
index 0000000..6e967ce
--- /dev/null
+++ b/src/InputHandler/FitParticle.cxx
@@ -0,0 +1,51 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "FitParticle.h"
+
+FitParticle::FitParticle(double x, double y, double z, double t, int pdg, Int_t state){
+
+  fP = TLorentzVector(x, y, z, t);
+  fPID = pdg;
+  fStatus = state;
+
+  // Set status manually from switch
+  switch(state){
+  case     kInitialState: fIsAlive= 0; fNEUTStatusCode=1; break; // Initial State
+  case     kFinalState:   fIsAlive= 1; fNEUTStatusCode=0; break; // Final State
+  case     kFSIState:     fIsAlive= 0; fNEUTStatusCode=2; break; // Intermediate State
+  default: fIsAlive=0; fNEUTStatusCode=999; break; // Other?
+  }
+
+};
+
+void FitParticle::SetValues(double x, double y, double z, double t, int pdg, Int_t state){
+
+  fP = TLorentzVector(x, y, z, t);
+  fPID = pdg;
+  fStatus = state;
+
+  // Set status manually from switch
+  switch(state){
+  case     kInitialState: fIsAlive= 0; fNEUTStatusCode=1; break; // Initial State
+  case     kFinalState:   fIsAlive= 1; fNEUTStatusCode=0; break; // Final State
+  case     kFSIState:     fIsAlive= 0; fNEUTStatusCode=2; break; // Intermediate State
+  default: fIsAlive=0; fNEUTStatusCode=999; break; // Other?
+  }
+
+};
diff --git a/src/FitBase/FitParticle.h b/src/InputHandler/FitParticle.h
similarity index 52%
rename from src/FitBase/FitParticle.h
rename to src/InputHandler/FitParticle.h
index 6c67f4b..ef3477c 100644
--- a/src/FitBase/FitParticle.h
+++ b/src/InputHandler/FitParticle.h
@@ -1,124 +1,98 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef FITPARTICLE_H_SEEN
 #define FITPARTICLE_H_SEEN
-
-#include "TLorentzVector.h"
-#include "TObject.h"
-
-#ifdef __NEUT_ENABLED__
-#include "neutpart.h"
-#include "neutfsipart.h"
-#endif
-
-#ifdef __NUWRO_ENABLED__
-#include "particle.h"
-#endif
-
-#ifdef __GENIE_ENABLED__
-#include "EVGCore/EventRecord.h"
-#include "GHEP/GHepRecord.h"
-#include "Ntuple/NtpMCEventRecord.h"
-#include "GHEP/GHepParticle.h"
-#include "PDG/PDGCodes.h"
-#include "PDG/PDGUtils.h"
-#include "GHEP/GHepStatus.h"
-#include "GHEP/GHepFlags.h"
-#include "GHEP/GHepUtils.h"
-#endif
-
-#include "StdHepEvt.h"
-
 /*!
- *  \addtogroup FitBase
+ *  \addtogroup InputHandler
  *  @{
  */
 
+#include "TLorentzVector.h"
+
+/// Partle state flags for its position in the event
 enum particle_state{
   kUndefinedState = 5,
   kInitialState   = 0,
   kFSIState       = 1,
   kFinalState     = 2,
   kNuclearInitial = 3,
   kNuclearRemnant = 4
 };
 
-//! Condensed FitParticle class which acts a common format between the generators
+/// Condensed FitParticle class which acts a common format between the generators
 class FitParticle {
-
   public:
 
-  //! Virtual Destructor
-  ~FitParticle(){ };
+  /// Create particle of given pdg from momentum variables and state
+  FitParticle(double x, double y, double z, double t, int pdg, Int_t state);
 
-  //! Default Constructor
-  FitParticle(){
-    fPID = -1;
-  };
+  /// Create empty particle (zero momentum)
+  FitParticle(){};
+  ~FitParticle(){};
 
-#ifdef __NEUT_ENABLED__
-  //! NEUT Constructor
-  FitParticle(NeutPart* part);
-  //! NEUT FSI particles constructor
-  FitParticle(NeutFsiPart* part);
-#endif
+  /// Used to change values after creation
+  void SetValues(double x, double y, double z, double t, int pdg, Int_t state);
 
+  /// Return Status Code according to particle_state enum
+  inline int  Status (void) const { return fStatus; };
 
-#ifdef __NUWRO_ENABLED__
-  //! NUWRO Constructor
-  FitParticle(particle* nuwro_particle, Int_t state);
-#endif
+  /// Get Particle PDF
+  inline int  PDG    (void) const { return fPID;    };
 
+  /// Check if particle makes it to final state
+  inline bool IsFinalState   (void) const { return (fStatus == kFinalState);   };
 
-#ifdef __GENIE_ENABLED__
-  //! GENIE Constructor
-  FitParticle(genie::GHepParticle* genie_particle);
-#endif
+  /// Was particle involved in intermediate state
+  inline bool IsFSIState     (void) const { return (fStatus == kFSIState);     };
 
-#ifdef __GiBUU_ENABLED__
-  //! GiBUU Constructor
-  FitParticle(GiBUUStdHepReader* GiRead, Int_t p_it);
-#endif
+  /// Was particle incoming
+  inline bool IsInitialState (void) const { return (fStatus == kInitialState); };
 
-  //! NULL Constructor for when the generator screws up.
-  FitParticle(UInt_t* i);
+  /// Get Mass
+  inline double M  (void){ return fP.Mag(); }; 
 
-  TLorentzVector fP; //!< Particle 4 Momentum
-  int fPID; //!< Particle PDG Code
-  int fIsAlive; //!< Whether the particle is alive at the end of the event (Yes 1, No 0, Other? -1)
-  int fNEUTStatusCode; //!< Particle Status (Incoming 1, FSI 2, Outgoing 0, Other 3)
-  double fMass; //!< Particle Mass
+  /// Get Kinetic Energy
+  inline double KE (void){ return fP.E() - fP.Mag(); }; 
 
-  FitParticle(double x, double y, double z, double t, int pdg, Int_t state);
+  /// Get Total Energy
+  inline double E  (void){ return fP.E(); };
 
-  inline int  Status (void) const { return fStatus; };
-  inline int  PDG    (void) const { return fPID;    };
-  inline bool IsFinalState   (void) const { return (fStatus == kFinalState);   };
-  inline bool IsFSIState     (void) const { return (fStatus == kFSIState);     };
-  inline bool IsInitialState (void) const { return (fStatus == kInitialState); };
+  /// Get 4 Momentum
+  inline TLorentzVector P4(void) {return fP;}; 
 
- private:
-  int fStatus;
+  /// Get 3 Momentum
+  inline TVector3       P3(void) {return fP.Vect();}; 
 
+  /// Get 3 momentum magnitude
+  inline double         p(void) { return fP.Vect().Mag(); };
 
-};
+  /// Get 3 momentum magnitude squared
+  inline double         p2(void) { return fP.Vect().Mag2(); };
 
+  /// Data Members
+  TLorentzVector fP;   ///< Particle 4 Momentum
+  int fPID;            ///< Particle PDG Code
+  int fIsAlive;        ///< Whether the particle is alive at the end of the event (Yes 1, No 0, Other? -1)
+  int fNEUTStatusCode; ///< Particle Status (Incoming 1, FSI 2, Outgoing 0, Other 3)
+  double fMass;        ///< Particle Mass
+  int fStatus;         ///< State corresponding to particle_state enum
+
+};
 /*! @} */
 #endif
diff --git a/src/InputHandler/GENIEInputHandler.cxx b/src/InputHandler/GENIEInputHandler.cxx
new file mode 100644
index 0000000..112c8f1
--- /dev/null
+++ b/src/InputHandler/GENIEInputHandler.cxx
@@ -0,0 +1,381 @@
+#include "GENIEInputHandler.h"
+#ifdef __GENIE_ENABLED__
+
+GENIEGeneratorInfo::~GENIEGeneratorInfo() {
+  DeallocateParticleStack();
+}
+
+void GENIEGeneratorInfo::AddBranchesToTree(TTree* tn) {
+  tn->Branch("GenieParticlePDGs", &fGenieParticlePDGs, "GenieParticlePDGs/I");
+}
+
+void GENIEGeneratorInfo::SetBranchesFromTree(TTree* tn) {
+  tn->SetBranchAddress("GenieParticlePDGs", &fGenieParticlePDGs);
+}
+
+void GENIEGeneratorInfo::AllocateParticleStack(int stacksize) {
+  fGenieParticlePDGs = new int[stacksize];
+}
+
+void GENIEGeneratorInfo::DeallocateParticleStack() {
+  delete fGenieParticlePDGs;
+}
+
+void GENIEGeneratorInfo::FillGeneratorInfo(NtpMCEventRecord* ntpl) {
+  Reset();
+
+  // Check for GENIE Event
+  if (!ntpl) return;
+  if (!ntpl->event) return;
+
+  // Cast Event Record
+  GHepRecord* ghep = static_cast<GHepRecord*>(ntpl->event);
+  if (!ghep) return;
+
+  // Fill Particle Stack
+  GHepParticle* p = 0;
+  TObjArrayIter iter(ghep);
+
+  // Loop over all particles
+  int i = 0;
+  while ((p = (dynamic_cast<genie::GHepParticle*>((iter).Next())))) {
+    if (!p) continue;
+
+    // Get PDG
+    fGenieParticlePDGs[i] = p->Pdg();
+    i++;
+  }
+}
+
+void GENIEGeneratorInfo::Reset() {
+  for (int i = 0; i < kMaxParticles; i++) {
+    fGenieParticlePDGs[i] = 0;
+  }
+}
+
+
+GENIEInputHandler::GENIEInputHandler(std::string const& handle, std::string const& rawinputs) {
+  LOG(SAM) << "Creating GENIEInputHandler : " << handle << std::endl;
+
+  // Run a joint input handling
+  fName = handle;
+
+  // Setup the TChain
+  fGENIETree = new TChain("gtree");
+  fSaveExtra = FitPar::Config().GetParB("SaveExtraGenie");
+  fCacheSize = FitPar::Config().GetParI("CacheSize");
+
+  // Loop over all inputs and grab flux, eventhist, and nevents
+  std::vector<std::string> inputs = InputUtils::ParseInputFileList(rawinputs);
+  for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
+
+    // Open File for histogram access
+    TFile* inp_file = new TFile(InputUtils::ExpandInputDirectories(inputs[inp_it]).c_str(), "READ");
+    if (!inp_file or inp_file->IsZombie()) {
+      THROW( "GENIE File IsZombie() at : '" << inputs[inp_it] << "'" << std::endl
+             << "Check that your file paths are correct and the file exists!" << std::endl
+             << "$ ls -lh " << inputs[inp_it] );
+    }
+
+    // Get Flux/Event hist
+    TH1D* fluxhist  = (TH1D*)inp_file->Get("nuisance_flux");
+    TH1D* eventhist = (TH1D*)inp_file->Get("nuisance_events");
+    if (!fluxhist or !eventhist) {
+      ERROR(FTL, "Input File Contents: " << inputs[inp_it] );
+      inp_file->ls();
+      THROW( "GENIE FILE doesn't contain flux/xsec info." << std::endl
+              << "Try running the app PrepareGENIE first on :" << inputs[inp_it] << std::endl
+              << "$ PrepareGENIE -h" );
+    }
+
+    // Get N Events
+    TTree* genietree = (TTree*)inp_file->Get("gtree");
+    if (!genietree) {
+      ERROR(FTL, "gtree not located in GENIE file: " << inputs[inp_it]);
+      THROW("Check your inputs, they may need to be completely regenerated!");
+      throw;
+    }
+    int nevents = genietree->GetEntries();
+    if (nevents <= 0){
+      THROW("Trying to a TTree with " << nevents << " to TChain from : " << inputs[inp_it]);
+    }
+
+
+    // Register input to form flux/event rate hists
+    RegisterJointInput(inputs[inp_it], nevents, fluxhist, eventhist);
+
+    // Add To TChain
+    fGENIETree->AddFile( inputs[inp_it].c_str() );
+  }
+
+  // Registor all our file inputs
+  SetupJointInputs();
+
+  // Assign to tree
+  fEventType = kGENIE;
+  fGenieNtpl = NULL;
+  fGENIETree->SetBranchAddress("gmcrec", &fGenieNtpl);
+
+  // Create Fit Event
+  fNUISANCEEvent = new FitEvent();
+  fNUISANCEEvent->SetGenieEvent(fGenieNtpl);
+
+  if (fSaveExtra) {
+    fGenieInfo     = new GENIEGeneratorInfo();
+    fNUISANCEEvent->AddGeneratorInfo(fGenieInfo);
+  }
+
+  fNUISANCEEvent->HardReset();
+
+};
+
+GENIEInputHandler::~GENIEInputHandler() {
+  if (fGenieGHep) delete fGenieGHep;
+  if (fGenieNtpl) delete fGenieNtpl;
+  if (fGENIETree) delete fGENIETree;
+  if (fGenieInfo) delete fGenieInfo;
+}
+
+void GENIEInputHandler::CreateCache() {
+  if (fCacheSize > 0) {
+    // fGENIETree->SetCacheEntryRange(0, fNEvents);
+    fGENIETree->AddBranchToCache("*", 1);
+    fGENIETree->SetCacheSize(fCacheSize);
+  }
+}
+
+void GENIEInputHandler::RemoveCache() {
+  // fGENIETree->SetCacheEntryRange(0, fNEvents);
+  fGENIETree->AddBranchToCache("*", 0);
+  fGENIETree->SetCacheSize(0);
+}
+
+FitEvent* GENIEInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+  if (entry >= (UInt_t)fNEvents) return NULL;
+
+  // Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+  fGENIETree->GetEntry(entry);
+
+  // Setup Input scaling for joint inputs
+  fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+
+  // Run NUISANCE Vector Filler
+  if (!lightweight) {
+    CalcNUISANCEKinematics();
+  }
+
+  return fNUISANCEEvent;
+}
+
+
+int GENIEInputHandler::GetGENIEParticleStatus(genie::GHepParticle* p, int mode) {
+  /*
+    kIStUndefined                  = -1,
+    kIStInitialState               =  0,   / generator-level initial state /
+    kIStStableFinalState           =  1,   / generator-level final state:
+    particles to be tracked by detector-level MC /
+    kIStIntermediateState          =  2,
+    kIStDecayedState               =  3,
+    kIStCorrelatedNucleon          = 10,
+    kIStNucleonTarget              = 11,
+    kIStDISPreFragmHadronicState   = 12,
+    kIStPreDecayResonantState      = 13,
+    kIStHadronInTheNucleus         = 14,   / hadrons inside the nucleus: marked
+    for hadron transport modules to act on /
+    kIStFinalStateNuclearRemnant   = 15,   / low energy nuclear fragments
+    entering the record collectively as a 'hadronic blob' pseudo-particle /
+    kIStNucleonClusterTarget       = 16,   // for composite nucleons before
+    phase space decay
+  */
+
+  int state = kUndefinedState;
+  switch (p->Status()) {
+  case genie::kIStNucleonTarget:
+  case genie::kIStInitialState:
+  case genie::kIStCorrelatedNucleon:
+  case genie::kIStNucleonClusterTarget:
+    state = kInitialState;
+    break;
+
+  case genie::kIStStableFinalState:
+    state = kFinalState;
+    break;
+
+  case genie::kIStHadronInTheNucleus:
+    if (abs(mode) == 2)
+      state = kInitialState;
+    else
+      state = kFSIState;
+    break;
+
+  case genie::kIStPreDecayResonantState:
+  case genie::kIStDISPreFragmHadronicState:
+  case genie::kIStIntermediateState:
+    state = kFSIState;
+    break;
+
+  case genie::kIStFinalStateNuclearRemnant:
+  case genie::kIStUndefined:
+  case genie::kIStDecayedState:
+  default:
+    break;
+  }
+
+  // Flag to remove nuclear part in genie
+  if (p->Pdg() > 1000000) {
+    if (state == kInitialState)
+      state = kNuclearInitial;
+    else if (state == kFinalState)
+      state = kNuclearRemnant;
+  }
+
+  return state;
+}
+#endif
+
+#ifdef __GENIE_ENABLED__
+int GENIEInputHandler::ConvertGENIEReactionCode(GHepRecord* gheprec) {
+
+  // Electron Scattering
+  if (gheprec->Summary()->ProcInfo().IsEM()) {
+    if (gheprec->Summary()->InitState().ProbePdg() == 11) {
+      if (gheprec->Summary()->ProcInfo().IsQuasiElastic()) return 1;
+      else if (gheprec->Summary()->ProcInfo().IsMEC()) return 2;
+      else if (gheprec->Summary()->ProcInfo().IsResonant()) return 13;
+      else if (gheprec->Summary()->ProcInfo().IsDeepInelastic()) return 26;
+      else {
+        ERROR(WRN, "Unknown GENIE Electron Scattering Mode!" << std::endl
+                 << "ScatteringTypeId = " << gheprec->Summary()->ProcInfo().ScatteringTypeId() << " "
+                 << "InteractionTypeId = " << gheprec->Summary()->ProcInfo().InteractionTypeId() << std::endl
+                 << genie::ScatteringType::AsString(gheprec->Summary()->ProcInfo().ScatteringTypeId()) << " "
+                 << genie::InteractionType::AsString(gheprec->Summary()->ProcInfo().InteractionTypeId()) << " "
+                 << gheprec->Summary()->ProcInfo().IsMEC());
+        return 0;
+      }
+    }
+
+    // Weak CC
+  } else if (gheprec->Summary()->ProcInfo().IsWeakCC()) {
+
+    // CC MEC
+    if (gheprec->Summary()->ProcInfo().IsMEC()) {
+      if (pdg::IsNeutrino(gheprec->Summary()->InitState().ProbePdg()))  return 2;
+      else if (pdg::IsAntiNeutrino(gheprec->Summary()->InitState().ProbePdg())) return -2;
+
+      // CC OTHER
+    } else {
+      return utils::ghep::NeutReactionCode(gheprec);
+    }
+
+    // Weak NC
+  } else if (gheprec->Summary()->ProcInfo().IsWeakNC()) {
+    // NC MEC
+    if (gheprec->Summary()->ProcInfo().IsMEC()) {
+      if (pdg::IsNeutrino(gheprec->Summary()->InitState().ProbePdg()))  return 32;
+      else if (pdg::IsAntiNeutrino(gheprec->Summary()->InitState().ProbePdg())) return -32;
+
+      // NC OTHER
+    } else {
+      return utils::ghep::NeutReactionCode(gheprec);
+    }
+  }
+
+  return 0;
+}
+
+void GENIEInputHandler::CalcNUISANCEKinematics() {
+
+  // Reset all variables
+  fNUISANCEEvent->ResetEvent();
+
+  // Check for GENIE Event
+  if (!fGenieNtpl) return;
+  if (!fGenieNtpl->event) return;
+
+  // Cast Event Record
+  fGenieGHep = static_cast<GHepRecord*>(fGenieNtpl->event);
+  if (!fGenieGHep) return;
+
+  // Convert GENIE Reaction Code
+  fNUISANCEEvent->fMode = ConvertGENIEReactionCode(fGenieGHep);
+
+  // Set Event Info
+  fNUISANCEEvent->Mode = fNUISANCEEvent->fMode;
+  fNUISANCEEvent->fEventNo = 0.0;
+  fNUISANCEEvent->fTotCrs = fGenieGHep->XSec();
+  fNUISANCEEvent->fTargetA = 0.0;
+  fNUISANCEEvent->fTargetZ = 0.0;
+  fNUISANCEEvent->fTargetH = 0;
+  fNUISANCEEvent->fBound   = 0.0;
+  fNUISANCEEvent->InputWeight = 1.0; //(1E+38 / genie::units::cm2) * fGenieGHep->XSec();
+
+  // Get N Particle Stack
+  unsigned int npart = fGenieGHep->GetEntries();
+  unsigned int kmax = fNUISANCEEvent->kMaxParticles;
+  if (npart > kmax) {
+    ERR(WRN) << "GENIE has too many particles, expanding stack." << std::endl;
+    fNUISANCEEvent->ExpandParticleStack(npart);
+  }
+
+  // Fill Particle Stack
+  GHepParticle* p = 0;
+  TObjArrayIter iter(fGenieGHep);
+  fNUISANCEEvent->fNParticles = 0;
+
+  // Loop over all particles
+  while ((p = (dynamic_cast<genie::GHepParticle*>((iter).Next())))) {
+    if (!p) continue;
+
+    // Get Status
+    int state = GetGENIEParticleStatus(p, fNUISANCEEvent->fMode);
+
+    // Remove Undefined
+    if (kRemoveUndefParticles &&
+        state == kUndefinedState) continue;
+
+    // Remove FSI
+    if (kRemoveFSIParticles &&
+        state == kFSIState) continue;
+
+    if (kRemoveNuclearParticles &&
+        (state == kNuclearInitial || state == kNuclearRemnant)) continue;
+
+    // Fill Vectors
+    int curpart = fNUISANCEEvent->fNParticles;
+    fNUISANCEEvent->fParticleState[curpart] = state;
+
+    // Mom
+    fNUISANCEEvent->fParticleMom[curpart][0] = p->Px() * 1.E3;
+    fNUISANCEEvent->fParticleMom[curpart][1] = p->Py() * 1.E3;
+    fNUISANCEEvent->fParticleMom[curpart][2] = p->Pz() * 1.E3;
+    fNUISANCEEvent->fParticleMom[curpart][3] = p->E() * 1.E3;
+
+    // PDG
+    fNUISANCEEvent->fParticlePDG[curpart] = p->Pdg();
+
+    // Add to N particle count
+    fNUISANCEEvent->fNParticles++;
+
+    // Extra Check incase GENIE fails.
+    if ((UInt_t)fNUISANCEEvent->fNParticles == kmax) {
+      ERR(WRN) << "Number of GENIE Particles exceeds maximum!" << std::endl;
+      ERR(WRN) << "Extend kMax, or run without including FSI particles!" << std::endl;
+      break;
+    }
+  }
+
+  // Fill Extra Stack
+  if (fSaveExtra) fGenieInfo->FillGeneratorInfo(fGenieNtpl);
+
+  // Run Initial, FSI, Final, Other ordering.
+  fNUISANCEEvent-> OrderStack();
+
+  return;
+}
+
+void GENIEInputHandler::Print() {
+}
+
+#endif
+
+
diff --git a/src/InputHandler/GENIEInputHandler.h b/src/InputHandler/GENIEInputHandler.h
new file mode 100644
index 0000000..1cc6b69
--- /dev/null
+++ b/src/InputHandler/GENIEInputHandler.h
@@ -0,0 +1,108 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef GENIEINPUTHANDLER_H
+#define GENIEINPUTHANDLER_H
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+#ifdef __GENIE_ENABLED__
+#include "InputHandler.h"
+#include "InputUtils.h"
+#include "PlotUtils.h"
+
+#include "GHEP/GHepParticle.h"
+#include "PDG/PDGUtils.h"
+#include "GHEP/GHepUtils.h"
+#include "Conventions/Units.h"
+#include "EVGCore/EventRecord.h"
+#include "GHEP/GHepRecord.h"
+#include "Ntuple/NtpMCEventRecord.h"
+using namespace genie;
+
+/// GENIE Generator Container to save extra particle status codes.
+class GENIEGeneratorInfo : public GeneratorInfoBase {
+public:
+	GENIEGeneratorInfo() {};
+	virtual ~GENIEGeneratorInfo();
+
+	/// Assigns information to branches
+	void AddBranchesToTree(TTree* tn);
+
+	/// Setup reading information from branches
+	void SetBranchesFromTree(TTree* tn);
+
+	/// Allocate any dynamic arrays for a new particle stack size
+	void AllocateParticleStack(int stacksize);
+
+	/// Clear any dynamic arrays
+	void DeallocateParticleStack();
+
+	/// Read extra genie information from the event
+	void FillGeneratorInfo(NtpMCEventRecord* ntpl);
+
+	/// Reset extra information to default/empty values
+	void Reset();
+
+	int  kMaxParticles; ///< Number of particles in stack
+	int* fGenieParticlePDGs; ///< GENIE Particle PDGs (example)
+};
+
+/// Main GENIE InputHandler
+class GENIEInputHandler : public InputHandlerBase {
+public:
+
+	/// Standard constructor given a name and input files
+	GENIEInputHandler(std::string const& handle, std::string const& rawinputs);
+	virtual ~GENIEInputHandler();
+
+	/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+	
+	/// Returns a NUISANCE format event from the GENIE TTree. If !lightweight
+	/// then CalcNUISANCEKinematics() is called to convert the GENIE event into
+	/// a standard NUISANCE format.
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight = false);
+
+	/// Converts GENIE event into standard NUISANCE FitEvent by looping over all
+	/// particles in the event and adding them to stack in fNUISANCEEvent.
+	void CalcNUISANCEKinematics();
+
+	/// Placeholder for GENIE related event printing.
+	void Print();
+
+	/// Converts GENIE particle status codes into NUISANCE status codes.
+	int GetGENIEParticleStatus(genie::GHepParticle* part, int mode = 0);
+
+	/// Converts GENIE event reaction codes into NUISANCE reaction codes.
+	int ConvertGENIEReactionCode(GHepRecord* gheprec);
+
+	GHepRecord* fGenieGHep;         ///< Pointer to actual event record
+	NtpMCEventRecord* fGenieNtpl;   ///< Ntpl Wrapper Class
+
+	TChain* fGENIETree;             ///< Main GENIE Event TTree
+	bool fSaveExtra;    ///< Flag to save Extra GENIE info into Nuisance Event
+	GENIEGeneratorInfo* fGenieInfo; ///< Extra GENIE Generator Info Writer
+};
+/*! @} */
+#endif
+#endif
\ No newline at end of file
diff --git a/src/InputHandler/GIBUUInputHandler.cxx b/src/InputHandler/GIBUUInputHandler.cxx
new file mode 100644
index 0000000..a6fd45f
--- /dev/null
+++ b/src/InputHandler/GIBUUInputHandler.cxx
@@ -0,0 +1,482 @@
+#ifdef __GiBUU_ENABLED__
+#include "GIBUUInputHandler.h"
+
+GIBUUGeneratorInfo::~GIBUUGeneratorInfo() {
+	DeallocateParticleStack();
+}
+
+void GIBUUGeneratorInfo::AddBranchesToTree(TTree * tn) {
+	// tn->Branch("NEUTParticleN",          fNEUTParticleN,          "NEUTParticleN/I");
+	// tn->Branch("NEUTParticleStatusCode", fNEUTParticleStatusCode, "NEUTParticleStatusCode[NEUTParticleN]/I");
+	// tn->Branch("NEUTParticleAliveCode",  fNEUTParticleAliveCode,  "NEUTParticleAliveCode[NEUTParticleN]/I");
+}
+
+void GIBUUGeneratorInfo::SetBranchesFromTree(TTree* tn) {
+	// tn->SetBranchAddress("NEUTParticleN",          &fNEUTParticleN );
+	// tn->SetBranchAddress("NEUTParticleStatusCode", &fNEUTParticleStatusCode );
+	// tn->SetBranchAddress("NEUTParticleAliveCode",  &fNEUTParticleAliveCode  );
+
+}
+
+void GIBUUGeneratorInfo::AllocateParticleStack(int stacksize) {
+	// fNEUTParticleN = 0;
+	// fNEUTParticleStatusCode = new int[stacksize];
+	// fNEUTParticleStatusCode = new int[stacksize];
+}
+
+void GIBUUGeneratorInfo::DeallocateParticleStack() {
+	// delete fNEUTParticleStatusCode;
+	// delete fNEUTParticleAliveCode;
+}
+
+void GIBUUGeneratorInfo::FillGeneratorInfo(GiBUUStdHepReader* nevent) {
+	Reset();
+	// for (int i = 0; i < nevent->Npart(); i++) {
+	// fNEUTParticleStatusCode[i] = nevent->PartInfo(i)->fStatus;
+	// fNEUTParticleAliveCode[i]  = nevent->PartInfo(i)->fIsAlive;
+	// fNEUTParticleN++;
+	// }
+}
+
+void GIBUUGeneratorInfo::Reset() {
+	// for (int i = 0; i < fNEUTParticleN; i++) {
+	// fNEUTParticleStatusCode[i] = -1;
+	// fNEUTParticleAliveCode[i]  = 9;
+	// }
+	// fNEUTParticleN = 0;
+}
+
+GIBUUInputHandler::GIBUUInputHandler(std::string const& handle, std::string const& rawinputs) {
+	LOG(SAM) << "Creating GiBUUInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+	fEventType = kGiBUU;
+
+	// Open Root File
+	LOG(SAM) << "Opening event file " << rawinputs << std::endl;
+	TFile* rootFile = new TFile(rawinputs.c_str(), "READ");
+	// Get flux histograms NEUT supplies
+	TH1D* numuFlux = dynamic_cast<TH1D*>(rootFile->Get("numu_flux"));
+	TH1D* numubFlux = dynamic_cast<TH1D*>(rootFile->Get("numub_flux"));
+	TH1D* nueFlux = dynamic_cast<TH1D*>(rootFile->Get("nue_flux"));
+	TH1D* nuebFlux = dynamic_cast<TH1D*>(rootFile->Get("nueb_flux"));
+	std::vector<TH1D*> fFluxList;
+
+	// Replace local pointers with NULL dir'd clones.
+	if (numuFlux) {
+		numuFlux = static_cast<TH1D*>(numuFlux->Clone());
+		numuFlux->Scale(1.0 / numuFlux->Integral("width"));
+		std::cout << "GiBUU Flux: numuFlux, Width integral = "
+		          << numuFlux->Integral("width") << std::endl;
+		numuFlux->SetDirectory(NULL);
+		numuFlux->SetNameTitle(
+		    (fName + "_numu_FLUX").c_str(),
+		    (fName + "; E_{#nu} (GeV); #Phi_{#nu} (A.U.)").c_str());
+		fFluxList.push_back(numuFlux);
+	}
+	if (numubFlux) {
+		numubFlux = static_cast<TH1D*>(numubFlux->Clone());
+		numubFlux->Scale(1.0 / numubFlux->Integral("width"));
+		std::cout << "GiBUU Flux: numubFlux, Width integral = "
+		          << numubFlux->Integral("width") << std::endl;
+		numubFlux->SetDirectory(NULL);
+		numubFlux->SetNameTitle(
+		    (fName + "_numub_FLUX").c_str(),
+		    (fName + "; E_{#nu} (GeV); #Phi_{#bar{#nu}} (A.U.)").c_str());
+		fFluxList.push_back(numubFlux);
+	}
+	if (nueFlux) {
+		nueFlux = static_cast<TH1D*>(nueFlux->Clone());
+		nueFlux->Scale(1.0 / nueFlux->Integral("width"));
+		std::cout << "GiBUU Flux: nueFlux, Width integral = "
+		          << nueFlux->Integral("width") << std::endl;
+		nueFlux->SetDirectory(NULL);
+		nueFlux->SetNameTitle(
+		    (fName + "_nue_FLUX").c_str(),
+		    (fName + "; E_{#nu} (GeV); #Phi_{#nu} (A.U.)").c_str());
+		fFluxList.push_back(nueFlux);
+	}
+	if (nuebFlux) {
+		nuebFlux = static_cast<TH1D*>(nuebFlux->Clone());
+		nuebFlux->Scale(1.0 / nuebFlux->Integral("width"));
+		std::cout << "GiBUU Flux: nuebFlux, Width integral = "
+		          << nuebFlux->Integral("width") << std::endl;
+		nuebFlux->SetDirectory(NULL);
+		nuebFlux->SetNameTitle(
+		    (fName + "_nueb_FLUX").c_str(),
+		    (fName + "; E_{#nu} (GeV); #Phi_{#bar{#nu}} (A.U.)").c_str());
+		fFluxList.push_back(nuebFlux);
+	}
+	rootFile->Close();
+
+	fGIBUUTree = new TChain("giRooTracker");
+	fGIBUUTree->AddFile(rawinputs.c_str());
+
+	fGiReader = new GiBUUStdHepReader();
+	fGiReader->SetBranchAddresses(fGIBUUTree);
+
+	bool IsNuBarDominant = false;
+	size_t Found_nu = 0;
+	size_t Found_nuMask = ((numuFlux ? 1 : 0) + (numubFlux ? 2 : 0) +
+	                       (nueFlux ? 4 : 0) + (nuebFlux ? 8 : 0));
+
+	static const char* specNames[] = {"numu", "numubar", "nue", "nuebar"};
+	size_t nExpected = (Found_nuMask & (1 << 0)) + (Found_nuMask & (1 << 1)) +
+	                   (Found_nuMask & (1 << 2)) + (Found_nuMask & (1 << 3));
+	size_t nFound = 0;
+	std::string expectStr = "";
+	for (size_t sn_it = 0; sn_it < 4; ++sn_it) {
+		if (Found_nuMask & (1 << sn_it)) {
+			if (!nFound) {
+				expectStr = "(";
+			}
+			expectStr += specNames[sn_it];
+			nFound++;
+			if (nFound == nExpected) {
+				expectStr += ")";
+			} else {
+				expectStr += ", ";
+			}
+		}
+	}
+
+	LOG(SAM) << "Looking for dominant vector species in GiBUU file ("
+	         << rawinputs << ") expecting to find: " << expectStr << std::endl;
+
+	size_t maskHW = GeneralUtils::GetHammingWeight(Found_nuMask);
+	if (maskHW > 2) {
+		LOG(SAM) << "We are looking for more than two species... this will have to "
+		         "loop through a large portion of the vector. Please be patient."
+		         << std::endl;
+	}
+
+	double SpeciesWeights[] = {0, 0, 0, 0};
+	Long64_t nevt = 0;
+	fNEvents = fGIBUUTree->GetEntries();
+	fNUISANCEEvent = new FitEvent();
+	TH1D* flux = NULL;
+
+	while ((Found_nu != Found_nuMask) && (nevt < fNEvents)) {
+		if ((maskHW == 2) && flux) {  // If we have found the dominant one can
+			// now guess the other
+			size_t OtherBit = GeneralUtils::GetFirstOnBit(Found_nuMask - Found_nu);
+			SpeciesWeights[OtherBit] = 1 - fGiReader->SpeciesWght;
+			Found_nu += (1 << OtherBit);
+
+			LOG(SAM) << "\tGuessing other species weight as we are only expecting "
+			         "two species. Other species weight: "
+			         << SpeciesWeights[OtherBit] << std::endl;
+			continue;
+		}
+
+		this->GetNuisanceEvent(nevt++);
+		FitParticle* isnu = fNUISANCEEvent->GetHMISParticle(PhysConst::pdg_neutrinos);
+		if (!isnu) {
+			continue;
+		}
+		switch (isnu->fPID) {
+		case 12: {
+			if ((Found_nu & 4)) {
+				continue;
+			}
+			Found_nu += 4;
+			SpeciesWeights[2] = fGiReader->SpeciesWght;
+			LOG(SAM) << "\tGiBUU File: " << rawinputs << " -- ev: " << nevt
+			         << " has IS nu (" << isnu->fPID
+			         << "), species weight: " << fGiReader->SpeciesWght << std::endl;
+			if ((fGiReader->SpeciesWght < 0.5) &&
+			        (maskHW > 1)) {  // If we only care about a single species, then
+				// species-weight might not be filled.
+				continue;
+			}
+			flux = nueFlux;
+			LOG(SAM) << "\tInput file: " << rawinputs
+			         << " determined to be nue dominated vector." << std::endl;
+			break;
+		}
+		case -12: {
+			if ((Found_nu & 8)) {
+				continue;
+			}
+			Found_nu += 8;
+			SpeciesWeights[3] = fGiReader->SpeciesWght;
+			LOG(SAM) << "\tGiBUU File: " << rawinputs << " -- ev: " << nevt
+			         << " has IS nu (" << isnu->fPID
+			         << "), species weight: " << fGiReader->SpeciesWght << std::endl;
+			if ((fGiReader->SpeciesWght < 0.5) &&
+			        (maskHW > 1)) {  // If we only care about a single species, then
+				// species-weight might not be filled.
+				continue;
+			}
+			IsNuBarDominant = true;
+			flux = nuebFlux;
+			LOG(SAM) << "\tInput file: " << rawinputs
+			         << " determined to be nuebar dominated vector." << std::endl;
+			break;
+		}
+		case 14: {
+			if ((Found_nu & 1)) {
+				continue;
+			}
+			Found_nu += 1;
+			SpeciesWeights[0] = fGiReader->SpeciesWght;
+			LOG(SAM) << "\tGiBUU File: " << rawinputs << " -- ev: " << nevt
+			         << " has IS nu (" << isnu->fPID
+			         << "), species weight: " << fGiReader->SpeciesWght << std::endl;
+			if ((fGiReader->SpeciesWght < 0.5) &&
+			        (maskHW > 1)) {  // If we only care about a single species, then
+				// species-weight might not be filled.
+				continue;
+			}
+			flux = numuFlux;
+			LOG(SAM) << "\tInput file: " << rawinputs
+			         << " determined to be numu dominated vector." << std::endl;
+			break;
+		}
+		case -14: {
+			if ((Found_nu & 2)) {
+				continue;
+			}
+			Found_nu += 2;
+			SpeciesWeights[1] = fGiReader->SpeciesWght;
+			LOG(SAM) << "\tGiBUU File: " << rawinputs << " -- ev: " << nevt
+			         << " has IS nu (" << isnu->fPID
+			         << "), species weight: " << fGiReader->SpeciesWght << std::endl;
+			if ((fGiReader->SpeciesWght < 0.5) &&
+			        (maskHW > 1)) {  // If we only care about a single species, then
+				// species-weight might not be filled.
+				continue;
+			}
+			IsNuBarDominant = true;
+			flux = numubFlux;
+			LOG(SAM) << "\tInput file: " << rawinputs
+			         << " determined to be numubar dominated vector." << std::endl;
+			break;
+		}
+		default: {}
+		}
+	}
+
+	if (Found_nu != Found_nuMask) {
+		ERR(FTL) << "Input GiBUU file (" << rawinputs
+		         << ") appeared to not contain all the relevant incoming neutrino "
+		         "species: Found (numu:"
+		         << ((Found_nu & (1 << 0)) ? 1 : 0)
+		         << ",numub:" << ((Found_nu & (1 << 1)) ? 1 : 0)
+		         << ",nue:" << ((Found_nu & (1 << 2)) ? 1 : 0)
+		         << ",nueb:" << ((Found_nu & (1 << 3)) ? 1 : 0)
+		         << "), expected: (numu:" << ((Found_nuMask & (1 << 0)) ? 1 : 0)
+		         << ",numub:" << ((Found_nuMask & (1 << 1)) ? 1 : 0)
+		         << ",nue:" << ((Found_nuMask & (1 << 2)) ? 1 : 0)
+		         << ",nueb:" << ((Found_nuMask & (1 << 3)) ? 1 : 0) << ")"
+		         << std::endl;
+		throw;
+	}
+
+	if (!flux) {
+		ERR(FTL) << "Couldn't find: "
+		         << (IsNuBarDominant ? "nuXb_flux" : "nuX_flux")
+		         << " in input file: " << rootFile->GetName() << std::endl;
+		throw;
+	}
+
+	if (numuFlux) {
+		if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[0])) {
+			numuFlux->Scale(SpeciesWeights[0]);
+		}
+
+		TH1D* numuEvt =
+		    static_cast<TH1D*>(numuFlux->Clone((fName + "_numu_EVT").c_str()));
+		numuEvt->Reset();
+		numuEvt->SetBinContent(1, SpeciesWeights[0] * double(fNEvents) /
+		                       numuEvt->GetXaxis()->GetBinWidth(1));
+
+		TH1D* numuXSec =
+		    static_cast<TH1D*>(numuEvt->Clone((fName + "_numu_XSEC").c_str()));
+		numuXSec->Divide(flux);
+
+		numuXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
+	}
+	if (numubFlux) {
+		if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[1])) {
+			numubFlux->Scale(SpeciesWeights[1]);
+		}
+		TH1D* numubEvt =
+		    static_cast<TH1D*>(numubFlux->Clone((fName + "_numub_EVT").c_str()));
+		numubEvt->Reset();
+		numubEvt->SetBinContent(1, SpeciesWeights[1] * double(fNEvents) /
+		                        numubEvt->GetXaxis()->GetBinWidth(1));
+
+		TH1D* numubXSec =
+		    static_cast<TH1D*>(numubEvt->Clone((fName + "_numub_XSEC").c_str()));
+		numubXSec->Divide(flux);
+
+		numubXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
+	}
+	if (nueFlux) {
+		if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[2])) {
+			nueFlux->Scale(SpeciesWeights[2]);
+		}
+		TH1D* nueEvt =
+		    static_cast<TH1D*>(nueFlux->Clone((fName + "_nue_EVT").c_str()));
+		nueEvt->Reset();
+		nueEvt->SetBinContent(1, SpeciesWeights[2] * double(fNEvents) /
+		                      nueEvt->GetXaxis()->GetBinWidth(1));
+
+		TH1D* nueXSec =
+		    static_cast<TH1D*>(nueEvt->Clone((fName + "_nue_XSEC").c_str()));
+		nueXSec->Divide(flux);
+
+		nueXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
+	}
+	if (nuebFlux) {
+		if ((maskHW > 1) && !GeneralUtils::IsSmallNum(SpeciesWeights[3])) {
+			nuebFlux->Scale(SpeciesWeights[3]);
+		}
+		TH1D* nuebEvt =
+		    static_cast<TH1D*>(nuebFlux->Clone((fName + "_nueb_EVT").c_str()));
+		nuebEvt->Reset();
+		nuebEvt->SetBinContent(1, SpeciesWeights[3] * double(fNEvents) /
+		                       nuebEvt->GetXaxis()->GetBinWidth(1));
+
+		TH1D* nuebXSec =
+		    static_cast<TH1D*>(nuebEvt->Clone((fName + "_nueb_XSEC").c_str()));
+		nuebXSec->Divide(flux);
+
+		nuebXSec->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
+	}
+
+	fGIBUUTree->GetEntry(0);
+
+	LOG(SAM) << "\tInput GiBUU file species weights: (numu:" << SpeciesWeights[0]
+	         << ",numub:" << SpeciesWeights[1] << ",nue:" << SpeciesWeights[2]
+	         << ",nueb:" << SpeciesWeights[3] << ")" << std::endl;
+
+	flux->SetNameTitle(
+	    (fName + "_FLUX").c_str(),
+	    (fName + "; E_{#nu} (GeV);" +
+	     (IsNuBarDominant ? "#Phi_{#bar{#nu}} (A.U.)" : "#Phi_{#nu} (A.U.)"))
+	    .c_str());
+
+	TH1D* eventhist = static_cast<TH1D*>(flux->Clone((fName + "_EVT").c_str()));
+	eventhist->Reset();
+	eventhist->SetBinContent(1, double(fNEvents) *
+	                         TotalIntegratedFlux(0, 1.E5, "width") /
+	                         fEventHist->GetXaxis()->GetBinWidth(1));
+
+	TH1D* xsechist = static_cast<TH1D*>(eventhist->Clone((fName + "_XSEC").c_str()));
+	xsechist->Divide(flux);
+
+	xsechist->SetTitle((fName + "; E_{#nu} (GeV);XSec").c_str());
+
+	RegisterJointInput(rawinputs, fNEvents, flux, eventhist);
+	SetupJointInputs();
+
+
+};
+
+
+FitEvent* GIBUUInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+	// Check out of bounds
+	if (entry >= (UInt_t)fNEvents) return NULL;
+
+	// Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+	fGIBUUTree->GetEntry(entry);
+
+	// Run NUISANCE Vector Filler
+	if (!lightweight) {
+		CalcNUISANCEKinematics();
+	}
+
+	return fNUISANCEEvent;
+}
+
+int GIBUUInputHandler::GetGIBUUParticleStatus(int status, int pdg) {
+	int state = kUndefinedState;
+	switch (status) {
+	case 0:   // Incoming
+	case 11:  // Struck nucleon
+		state = kInitialState;
+		break;
+
+	case 1:  // Good Final State
+		state = kFinalState;
+		break;
+
+	default:  // Other
+		break;
+	}
+
+	// Set Nuclear States Flag
+	if (pdg > 1000000) {
+		if (state == kInitialState)
+			state = kNuclearInitial;
+		else if (state == kFinalState)
+			state = kNuclearRemnant;
+		else
+			state = kUndefinedState;
+	}
+
+	return state;
+}
+
+void GIBUUInputHandler::CalcNUISANCEKinematics() {
+
+	// Reset all variables
+	fNUISANCEEvent->ResetEvent();
+	FitEvent* evt = fNUISANCEEvent;
+	evt->fMode = fGiReader->GiBUU2NeutCode;
+	evt->Mode = evt->fMode;
+	evt->fEventNo = 0.0;
+	evt->fTotCrs = 0;
+	evt->fTargetA = 0.0; // Change to get these from nuclear remnant.
+	evt->fTargetZ = 0.0;
+	evt->fTargetH = 0;
+	evt->fBound = 0.0;
+
+	// Extra GiBUU Input Weight
+	evt->InputWeight = fGiReader->EvtWght;
+
+	// Check Stack N
+	int npart = fGiReader->StdHepN;
+	int kmax = evt->kMaxParticles;
+	if ((UInt_t)npart > (UInt_t)kmax) {
+		ERR(FTL) << "GiBUU has too many particles. Expanding Stack." << std::endl;
+		fNUISANCEEvent->ExpandParticleStack(npart);
+	}
+
+	// Create Stack
+	evt->fNParticles = 0;
+	for (int i = 0; i < npart; i++) {
+
+		// State
+		int state = GetGIBUUParticleStatus(fGiReader->StdHepStatus[i],
+		                                   fGiReader->StdHepPdg[i]);
+		int curpart = evt->fNParticles;
+
+		// Set State
+		evt->fParticleState[evt->fNParticles] = state;
+
+		// Mom
+		evt->fParticleMom[curpart][0] = fGiReader->StdHepP4[i][0] * 1.E3;
+		evt->fParticleMom[curpart][1] = fGiReader->StdHepP4[i][1] * 1.E3;
+		evt->fParticleMom[curpart][2] = fGiReader->StdHepP4[i][2] * 1.E3;
+		evt->fParticleMom[curpart][3] = fGiReader->StdHepP4[i][3] * 1.E3;
+
+		// PDG
+		evt->fParticlePDG[curpart] = fGiReader->StdHepPdg[i];
+
+		// Add to total particles
+		evt->fNParticles++;
+	}
+
+	// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent->OrderStack();
+	return;
+}
+
+void GIBUUInputHandler::Print() {}
+#endif
+
diff --git a/src/InputHandler/GIBUUInputHandler.h b/src/InputHandler/GIBUUInputHandler.h
new file mode 100644
index 0000000..7d5fcbe
--- /dev/null
+++ b/src/InputHandler/GIBUUInputHandler.h
@@ -0,0 +1,68 @@
+#ifndef GIBUUINPUTHANDLER_H
+#define GIBUUINPUTHANDLER_H
+#ifdef __GiBUU_ENABLED__
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+#include "InputHandler.h"
+#include "PlotUtils.h"
+#include "StdHepEvt.h"
+
+/// GIBUU Generator Container to save extra particle status codes.
+class GIBUUGeneratorInfo : public GeneratorInfoBase {
+public:
+	GIBUUGeneratorInfo() {};
+	virtual ~GIBUUGeneratorInfo();
+
+	/// Assigns information to branches
+	void AddBranchesToTree(TTree* tn);
+
+	/// Setup reading information from branches
+	void SetBranchesFromTree(TTree* tn);
+
+	/// Allocate any dynamic arrays for a new particle stack size
+	void AllocateParticleStack(int stacksize);
+
+	/// Clear any dynamic arrays
+	void DeallocateParticleStack();
+
+	/// Read extra GIBUU information from the event
+	void FillGeneratorInfo(GiBUUStdHepReader* nevent);
+
+	/// Reset extra information to default/empty values
+	void Reset();
+
+	// int  kMaxParticles; ///< Number of particles in stack
+	// int* fNEUTParticleStatusCode; ///<GIBUU Particle Status Flags
+	// int* fNEUTParticleAliveCode; ///< GIBUU Alive Code (0 dead, 1 final state)
+	// int fNEUTParticleN; ///< Number of particles
+};
+
+
+/// GiBUU Handler to read in Luke's formatted GiBUU events
+class GIBUUInputHandler : public InputHandlerBase {
+public:
+
+	/// Standard constructor given name and inputs
+	GIBUUInputHandler(std::string const& handle, std::string const& rawinputs);
+	~GIBUUInputHandler() {};
+
+	/// Returns NUISANCE Format Event from GiReader
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight = false);
+
+	/// Convert GiBUU Code to NUISANCE Event Code
+	int GetGIBUUParticleStatus(int status, int pdg);
+
+	/// Fill NUISANCE Particle Stack
+	void CalcNUISANCEKinematics();
+
+	/// Print event information
+	void Print();
+
+private:
+	GiBUUStdHepReader* fGiReader; ///< GiBUU Event Reader
+	TChain* fGIBUUTree;           ///< GiBUU Event Tree
+};
+#endif
+#endif
diff --git a/src/FitBase/NuanceEvent.h b/src/InputHandler/GeneratorInfoBase.h
similarity index 60%
copy from src/FitBase/NuanceEvent.h
copy to src/InputHandler/GeneratorInfoBase.h
index 18bd6dd..4623916 100644
--- a/src/FitBase/NuanceEvent.h
+++ b/src/InputHandler/GeneratorInfoBase.h
@@ -1,65 +1,39 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#ifndef NUANCE_H_SEEN
-#define NUANCE_H_SEEN
-
-#ifdef __NUANCE_ENABLED__
+#ifndef GENERATOR_INFO_BASE_SEEN_H
+#define GENERATOR_INFO_BASE_SEEN_H
 /*!
- *  \addtogroup FitBase
+ *  \addtogroup InputHandler
  *  @{
  */
 
-class NuanceEvent {
- public:
-
-  bool cc;
-  bool bound;
-  int neutrino;
-  int target;
-  float iniQ;
-  float finQ;
-  int lepton0;
-  float polar;
-  int channel;
-  float qsq;
-  float w;
-  float x;
-  float y;
-
-  float p_neutrino[4];
-  float p_targ[5];
-  float vertex[4];
-  float start[4];
-  float depth;
-  float flux;
-
-  int n_leptons;
-  
-  float p_ltot[5];
-  int lepton[200];
-  float p_lepton[5][200];
-  
-  int n_hadrons;
-  float p_htot[5];
-  int hadron[200];
-  float p_hadron[5][200];
+/// Base Box object that allows user to save extra generator level info
+/// by overriding functions. For an example see GENIEGeneratorInfo
+class GeneratorInfoBase {
+public:
+  inline GeneratorInfoBase(){};
+  inline virtual ~GeneratorInfoBase(){};
+  inline virtual void AddBranchesToTree(TTree* tn){};
+  inline virtual void SetBranchesFromTree(TTree* tn){};
+  inline virtual void AllocateParticleStack(int stacksize){};
+  inline virtual void DeallocateParticleStack(){};
+  inline virtual void Reset(){};
 };
-#endif
+/*! @} */
 #endif
diff --git a/src/InputHandler/GeneratorUtils.cxx b/src/InputHandler/GeneratorUtils.cxx
new file mode 100644
index 0000000..0a17f3e
--- /dev/null
+++ b/src/InputHandler/GeneratorUtils.cxx
@@ -0,0 +1,58 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include <iostream>
+
+#include "GeneratorUtils.h"
+#include "FitLogger.h"
+
+#ifdef __NIWG_ENABLED__
+niwg::rew::NIWGEvent * GeneratorUtils::GetNIWGEvent(NeutVect* nvect)
+{
+  niwg::rew::NIWGEvent * fDummyNIWGEvent = NULL;
+
+  fDummyNIWGEvent = new niwg::rew::NIWGEvent();
+  fDummyNIWGEvent->detid = 1;   // MiniBooNE (apply CCQE LowE variations)
+  fDummyNIWGEvent->neutmode = nvect->Mode;
+  fDummyNIWGEvent->targetA = nvect->TargetA;
+  fDummyNIWGEvent->recenu_ccqe_sk = -1;
+  if (nvect->Ibound==0) fDummyNIWGEvent->targetA = 1;//RT: identifies as H, rather than O16
+
+  // Fill initial particle stack
+  for (int ip=0; ip<nvect->Npart(); ++ip) {
+
+    niwg::rew::NIWGPartStack fDummyPartStack;
+
+    fDummyPartStack.p = (nvect->PartInfo(ip)->fP)*0.001;  // Convert to GeV
+
+    fDummyPartStack.pdg = nvect->PartInfo(ip)->fPID;
+    fDummyPartStack.chase = nvect->PartInfo(ip)->fIsAlive;
+    fDummyPartStack.parent = nvect->ParentIdx(ip)-1;       // WARNING: this needs to be tested with a NeutRoot file
+
+    fDummyNIWGEvent->part_stack.push_back(fDummyPartStack);
+  }
+  fDummyNIWGEvent->CalcKinematics();
+
+  return fDummyNIWGEvent;
+}
+#endif // neut enabled
+
+// #endif
+
+
diff --git a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h b/src/InputHandler/GeneratorUtils.h
similarity index 69%
copy from src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
copy to src/InputHandler/GeneratorUtils.h
index ce6fd7d..ea5fa12 100644
--- a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
+++ b/src/InputHandler/GeneratorUtils.h
@@ -1,35 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
+#ifndef GENERATOR_UTILS_H
+#define GENERATOR_UTILS_H
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
 
-#ifndef K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
-#define K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
-
-#include "Measurement1D.h"
-
-class K2K_NC1pi0_Evt_1Dppi0_nu : public Measurement1D {
-public:
+#ifdef __NIWG_ENABLED__
+#include "NIWGEvent.h"
+#include "NIWGSyst.h"
+#endif
 
-  K2K_NC1pi0_Evt_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~K2K_NC1pi0_Evt_1Dppi0_nu() {};
+namespace GeneratorUtils {
+#ifdef __NIWG_ENABLED__
+  niwg::rew::NIWGEvent* GetNIWGEvent(NeutVect* nvect);
+#endif
 
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
 };
-  
+/*! @} */
 #endif
diff --git a/src/InputHandler/HepMCTextInputHandler.cxx b/src/InputHandler/HepMCTextInputHandler.cxx
new file mode 100644
index 0000000..d7c82b1
--- /dev/null
+++ b/src/InputHandler/HepMCTextInputHandler.cxx
@@ -0,0 +1,171 @@
+#ifdef __HEPMC_ENABLED__
+#include "HepMCTextInputHandler.h"
+
+HepMCTextInputHandler::~HepMCTextInputHandler(){
+                                                                                                                                                                         
+};
+
+
+HepMCTextInputHandler::HepMCTextInputHandler(std::string const& handle, std::string const& rawinputs) {
+
+	LOG(SAM) << "Creating HepMCTextInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+	jointinput = false;
+	jointindexswitch = 0;
+
+	// Get initial flags
+	fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+
+	// Form list of all inputs, remove brackets if required.
+	std::vector<std::string> inputs = GeneralUtils::ParseToStr(rawinputs, ",");
+	if (inputs.front()[0] == '(') {
+		inputs.front() = inputs.front().substr(1);
+	}
+	if (inputs.back()[inputs.back().size() - 1] == ')') {
+		inputs.back() = inputs.back().substr(0, inputs.back().size() - 1);
+	}
+	for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
+		if (LOG_LEVEL(SAM)) {
+			std::cout << "\t\t|-> Input File " << inp_it
+			          << "      : " << inputs[inp_it] << std::endl;
+		}
+	}
+
+	fEventType = kHEPMC;
+
+	fASCIIStream = std::ifstream(inputs[0].c_str());
+	fHepMCEvent = HepMC::GenEvent();
+
+	// Loop through events and get N
+	fNEvents = 0;
+	while (fASCIIStream){
+	  fHepMCEvent.read(fASCIIStream);
+	  fNEvents++;
+	}
+	fASCIIStream.seekg(0);
+
+	fEventHist = new TH1D("eventhist","eventhist",10,0.0,1.0);
+	fFluxHist = new TH1D("eventhist","eventhist",10,0.0,1.0);
+
+	fNUISANCEEvent = new FitEvent(kHEPMC);
+        fNUISANCEEvent->HardReset();
+        fBaseEvent = static_cast<BaseFitEvt*>(fNUISANCEEvent);
+
+};
+
+
+FitEvent* HepMCTextInputHandler::GetNuisanceEvent(const UInt_t entry) {
+
+	// Catch too large entries
+  if (entry >= (UInt_t)fNEvents){
+    fASCIIStream.seekg(0);
+    return NULL;
+  }
+
+  // If no event get the first one
+  if (!fHepMCEvent.is_valid()){
+    fHepMCEvent.read(fASCIIStream);
+  }
+
+  // Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+  if (fHepMCEvent.event_number() != entry){
+
+    // If have to read backwords skip to start of ifstream
+    if (fHepMCEvent.event_number() > entry){
+      fASCIIStream.seekg(0);
+      fHepMCEvent.read(fASCIIStream);
+    }
+    
+    // Loop to event before if reading forwards
+    while (fHepMCEvent.event_number() < entry - 1 and fASCIIStream){
+      fHepMCEvent.read(fASCIIStream);
+    }
+    
+    fHepMCEvent.read(fASCIIStream);
+  }
+
+  // Setup Input scaling for joint inputs
+  if (jointinput) {
+    fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+  } else {
+    fNUISANCEEvent->InputWeight = 1.0;
+  }
+  
+  // Run NUISANCE Vector Filler
+  CalcNUISANCEKinematics();
+  
+  // Return event pointer
+  return fNUISANCEEvent;
+}
+
+int HepMCTextInputHandler::ConvertHepMCStatus() {
+
+  // Status for HepMC convertor
+  return 0;
+}
+
+void HepMCTextInputHandler::CalcNUISANCEKinematics() {
+
+	// Reset all variables
+	fNUISANCEEvent->ResetEvent();
+
+	// Read all particles from fHepMCEvent
+	std::vector<HepMC::GenParticle*> allstateparticles;
+	for ( HepMC::GenEvent::particle_iterator p = fHepMCEvent.particles_begin();
+	      p != fHepMCEvent.particles_end(); ++p ){
+	  allstateparticles.push_back(*p);
+
+	  int pdg = (*p)->pdg_id();
+	  int status = (*p)->status();
+	  //	  FourVector vect = (*p)->momentum();
+
+	  int state = ConvertHepMCStatus(status);
+
+	  int curpart = fNUISANCEEvent->fNParticles;
+	  fNUISANCEEvent->fParticleState[curpart] = state;
+
+	  // Mom                                                                                                                                                                                                                      
+	  //	  fNUISANCEEvent->fParticleMom[curpart][0] = vect.px();
+	  //	  fNUISANCEEvent->fParticleMom[curpart][1] = vect.py();
+	  //	  fNUISANCEEvent->fParticleMom[curpart][2] = vect.pz();
+	  //	  fNUISANCEEvent->fParticleMom[curpart][3] = vect.e();
+
+	  // PDG                                                                                                                                                                                                                      
+	  fNUISANCEEvent->fParticlePDG[curpart] = pdg;
+
+	  // Add up particle count                                                                                                                                                                                                    
+	  fNUISANCEEvent->fNParticles++;
+
+	}
+	
+		// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent-> OrderStack();
+	return;
+}
+
+
+double HepMCTextInputHandler::GetInputWeight(const UInt_t entry) {
+
+	// Find Switch Scale
+	while ( entry < (UInt_t)jointindexlow[jointindexswitch] ||
+	        entry >= (UInt_t)jointindexhigh[jointindexswitch] ) {
+		jointindexswitch++;
+
+		// Loop Around
+		if (jointindexswitch == jointindexlow.size()) {
+			jointindexswitch = 0;
+		}
+	}
+	return jointindexscale[jointindexswitch];
+};
+
+
+BaseFitEvt* HepMCTextInputHandler::GetBaseEvent(const UInt_t entry) {
+
+	// Read entry from TTree to fill NEUT Vect in BaseFitEvt;
+	if (entry >= (UInt_t)fNEvents) return NULL;
+	return (BaseFitEvent*)GetNuisanceEvent(entry);
+}
+#endif
diff --git a/src/InputHandler/HepMCTextInputHandler.h b/src/InputHandler/HepMCTextInputHandler.h
new file mode 100644
index 0000000..7e8dfde
--- /dev/null
+++ b/src/InputHandler/HepMCTextInputHandler.h
@@ -0,0 +1,40 @@
+#ifndef HEPMCINPUTHANDLER_H
+#define HEPMCINPUTHANDLER_H
+
+#ifdef __HEPMC_ENABLED__
+#include "SimpleVector.h"
+#include "Flow.h"
+#include "GenParticle.h"
+#include "GenEvent.h"
+#include "InputHandler.h"
+#include "TargetUtils.h"
+#include "PlotUtils.h"
+
+/// NEUT Input Convertor to read in NeutVects and convert to FitEvents
+class HepMCTextInputHandler : public InputHandlerBase {
+public:
+
+	/// Main constructor. Can read in single or joint inputs.
+	HepMCTextInputHandler(std::string const& handle, std::string const& rawinputs);
+	~HepMCTextInputHandler();
+
+	/// Returns NUISANCE Format event from entry in fNEUTTree
+	FitEvent* GetNuisanceEvent(const UInt_t entry);
+
+	/// Returns BaseEvent (just NeutVect pointer) from entry in fNEUTTree
+	BaseFitEvt* GetBaseEvent(const UInt_t entry);
+
+	/// eads fNeutVect and fills into fNUISANCEEvent.
+	void CalcNUISANCEKinematics();
+
+	/// Convert status codes to our format
+	int ConvertHepMCStatus();
+
+	/// Calculates weight if using joint inputs
+	double GetInputWeight(const UInt_t entry);
+
+	HepMC::GenEvent fHepMCEvent;
+	std::ifstream fASCIIStream;
+};
+#endif
+#endif
diff --git a/src/InputHandler/InputFactory.cxx b/src/InputHandler/InputFactory.cxx
new file mode 100644
index 0000000..7d539ea
--- /dev/null
+++ b/src/InputHandler/InputFactory.cxx
@@ -0,0 +1,107 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "InputFactory.h"
+
+
+namespace InputUtils {
+
+InputHandlerBase* CreateInputHandler(std::string const& handle,
+                                     InputUtils::InputType inpType,
+                                     std::string const& inputs) {
+  InputHandlerBase* input = NULL;
+  std::string newinputs = InputUtils::ExpandInputDirectories(inputs);
+
+  switch (inpType) {
+
+
+  case (kNEUT_Input):
+#ifdef __NEUT_ENABLED__
+    input = new NEUTInputHandler(handle, newinputs);
+#else
+    ERROR(FTL, "Tried to create NEUTInputHandler : "
+        << handle << " " << inpType << " " << inputs);
+    THROW("NEUT is not enabled!");
+#endif
+    break;
+
+  case (kGENIE_Input):
+#ifdef __GENIE_ENABLED__
+    input = new GENIEInputHandler(handle, newinputs);
+#else
+    ERROR(FTL, "Tried to create GENIEInputHandler : " 
+        << handle << " " << inpType << " " << inputs);
+    THROW("GENIE is not enabled!");
+#endif
+    break;
+
+
+  case (kNUWRO_Input):
+#ifdef __NUWRO_ENABLED__
+    input = new NuWroInputHandler(handle, newinputs);
+#else
+    ERROR(FTL, "Tried to create NuWroInputHandler : "
+        << handle << " " << inpType << " " << inputs);
+    THROW("NuWro is not enabled!");
+#endif
+    break;
+
+  case (kGiBUU_Input):
+#ifdef __GiBUU_ENABLED__
+    input = new GIBUUInputHandler(handle, newinputs);
+#else
+    ERROR(FTL, "Tried to create GiBUUInputHandler : "
+        << handle << " " << inpType << " " << inputs);
+    THROW("GiBUU is not enabled!");
+#endif
+    break;
+
+  case (kNUANCE_Input):
+#ifdef __NUANCE_ENABLED__
+    input = new NUANCEInputHandler(handle, newinputs);
+#else
+    ERROR(FTL, "Tried to create NUANCEInputHandler : "
+        << handle << " " << inpType << " " << inputs);
+    THROW("NUANCE is not enabled!");
+#endif
+    break;
+
+  case (kFEVENT_Input):
+    input = new FitEventInputHandler(handle, newinputs);
+    break;
+
+  case (kEVSPLN_Input):
+    input = new SplineInputHandler(handle, newinputs);
+    break;
+
+  default:
+    break;
+  }
+
+  /// Input failed
+  if (!input) {
+    ERR(FTL) << "Input handler creation failed!" << std::endl;
+    std::cout << "Generator Type " << inpType << " not enabled!" << std::endl;
+    throw;
+  }
+
+
+  return input;
+};
+}
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h b/src/InputHandler/InputFactory.h
similarity index 62%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
copy to src/InputHandler/InputFactory.h
index 7658b4a..ed5ab42 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
+++ b/src/InputHandler/InputFactory.h
@@ -1,41 +1,45 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
+#ifndef INPUT_FACTORY_H
+#define INPUT_FACTORY_H
 
-#include "Measurement1D.h"
+#include <string>
+#include "TFile.h"
+#include "InputUtils.h"
+#include "InputHandler.h"
+#include "NEUTInputHandler.h"
+#include "GENIEInputHandler.h"
+#include "NuWroInputHandler.h"
+#include "GIBUUInputHandler.h"
+#include "NUANCEInputHandler.h"
+#include "FitEventInputHandler.h"
+#include "SplineInputHandler.h"
 
-class ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu : public Measurement1D {
+namespace InputUtils {
 
-public:
-  ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu() {};
+InputHandlerBase* CreateInputHandler(std::string const& handle, 
+                                     InputUtils::InputType inpType,
+                                     std::string const& inputs);
 
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
+}
 
 
- private:
 
-};
-  
 #endif
diff --git a/src/InputHandler/InputHandler.cxx b/src/InputHandler/InputHandler.cxx
new file mode 100644
index 0000000..c6b0b79
--- /dev/null
+++ b/src/InputHandler/InputHandler.cxx
@@ -0,0 +1,258 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "InputHandler.h"
+
+InputHandlerBase::InputHandlerBase() {
+  fName = "";
+  fFluxHist = NULL;
+  fEventHist = NULL;
+  fNEvents = 0;
+  fNUISANCEEvent = NULL;
+  fBaseEvent = NULL;
+  kRemoveUndefParticles = FitPar::Config().GetParB("RemoveUndefParticles");
+  kRemoveFSIParticles = FitPar::Config().GetParB("RemoveFSIParticles");
+  kRemoveNuclearParticles = FitPar::Config().GetParB("RemoveNuclearParticles");
+  fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+  fTTreePerformance= NULL;
+
+};
+
+InputHandlerBase::~InputHandlerBase() {
+
+    if (fFluxHist) delete fFluxHist;
+    if (fEventHist) delete fEventHist;
+    if (fXSecHist) delete fXSecHist;
+    if (fNUISANCEEvent) delete fNUISANCEEvent;
+    jointfluxinputs.clear();
+    jointeventinputs.clear();
+    jointindexlow.clear();
+    jointindexhigh.clear();
+    jointindexallowed.clear();
+    jointindexscale.clear();
+    
+    if (fTTreePerformance){
+      fTTreePerformance->SaveAs(("ttreeperfstats_" + fName + ".root").c_str());
+    }
+  }
+
+void InputHandlerBase::Print() {
+};
+
+TH1D* InputHandlerBase::GetXSecHistogram(void) {
+  fXSecHist = (TH1D*)fFluxHist->Clone();
+  fXSecHist->Divide(fEventHist);
+  return fXSecHist;
+};
+
+double InputHandlerBase::PredictedEventRate(double low, double high,
+    std::string intOpt) {
+
+  int minBin = fFluxHist->GetXaxis()->FindBin(low);
+  int maxBin = fFluxHist->GetXaxis()->FindBin(high);
+
+  return fEventHist->Integral(minBin, maxBin + 1, intOpt.c_str());
+};
+
+double InputHandlerBase::TotalIntegratedFlux(double low, double high,
+    std::string intOpt) {
+
+  Int_t minBin = fFluxHist->GetXaxis()->FindFixBin(low);
+  Int_t maxBin = fFluxHist->GetXaxis()->FindFixBin(high);
+
+  if ((fFluxHist->IsBinOverflow(minBin) && (low != -9999.9))) {
+    minBin = 1;
+  }
+
+  if ((fFluxHist->IsBinOverflow(maxBin) && (high != -9999.9))) {
+    maxBin = fFluxHist->GetXaxis()->GetNbins() + 1;
+  }
+
+  // If we are within a single bin
+  if (minBin == maxBin) {
+    // Get the contained fraction of the single bin's width
+    return ((high - low) / fFluxHist->GetXaxis()->GetBinWidth(minBin)) *
+           fFluxHist->Integral(minBin, minBin, intOpt.c_str());
+  }
+
+  double lowBinUpEdge = fFluxHist->GetXaxis()->GetBinUpEdge(minBin);
+  double highBinLowEdge = fFluxHist->GetXaxis()->GetBinLowEdge(maxBin);
+
+  double lowBinfracIntegral =
+    ((lowBinUpEdge - low) / fFluxHist->GetXaxis()->GetBinWidth(minBin)) *
+    fFluxHist->Integral(minBin, minBin, intOpt.c_str());
+  double highBinfracIntegral =
+    ((high - highBinLowEdge) / fFluxHist->GetXaxis()->GetBinWidth(maxBin)) *
+    fFluxHist->Integral(maxBin, maxBin, intOpt.c_str());
+
+  // If they are neighbouring bins
+  if ((minBin + 1) == maxBin) {
+    std::cout << "Get lowfrac + highfrac" << std::endl;
+    // Get the contained fraction of the two bin's width
+    return lowBinfracIntegral + highBinfracIntegral;
+  }
+
+  // If there are filled bins between them
+  return lowBinfracIntegral + highBinfracIntegral +
+         fFluxHist->Integral(minBin + 1, maxBin - 1, intOpt.c_str());
+  // return fFluxHist->Integral(minBin + 1, maxBin - 1, intOpt.c_str());
+}
+
+
+std::vector<TH1*> InputHandlerBase::GetFluxList(void) {
+  return std::vector<TH1*>(1, fFluxHist);
+};
+
+std::vector<TH1*> InputHandlerBase::GetEventList(void) {
+  return std::vector<TH1*>(1, fEventHist);
+};
+
+std::vector<TH1*> InputHandlerBase::GetXSecList(void) {
+  return std::vector<TH1*>(1, GetXSecHistogram());
+};
+
+FitEvent* InputHandlerBase::FirstNuisanceEvent() {
+  fCurrentIndex = 0;
+  return GetNuisanceEvent(fCurrentIndex);
+};
+
+
+
+FitEvent* InputHandlerBase::NextNuisanceEvent() {
+  fCurrentIndex++;
+
+  return GetNuisanceEvent(fCurrentIndex);
+};
+
+
+BaseFitEvt* InputHandlerBase::FirstBaseEvent() {
+  fCurrentIndex = 0;
+  return GetBaseEvent(fCurrentIndex);
+};
+
+BaseFitEvt* InputHandlerBase::NextBaseEvent() {
+  fCurrentIndex++;
+
+  if (jointinput and fMaxEvents != -1) {
+    while ( fCurrentIndex < jointindexlow[jointindexswitch] ||
+            fCurrentIndex >= jointindexhigh[jointindexswitch] ) {
+      jointindexswitch++;
+
+      // Loop Around
+      if (jointindexswitch == jointindexlow.size()) {
+        jointindexswitch = 0;
+      }
+    }
+
+
+    if (fCurrentIndex > jointindexlow[jointindexswitch] + jointindexallowed[jointindexswitch]) {
+      fCurrentIndex = jointindexlow[jointindexswitch];
+    }
+  }
+
+  return GetBaseEvent(fCurrentIndex);
+};
+
+
+void InputHandlerBase::RegisterJointInput(std::string input, int n, TH1D* f, TH1D* e) {
+
+  if (jointfluxinputs.size() == 0){
+    jointindexswitch = 0;
+  }
+
+  // Push into individual input vectors
+  jointfluxinputs.push_back(  (TH1D*) f->Clone() );
+  jointeventinputs.push_back( (TH1D*) e->Clone() );
+
+  jointindexlow.push_back(fNEvents);
+  jointindexhigh.push_back(fNEvents + n);
+  fNEvents += n;
+
+  // Add to the total flux/event hist
+  if (!fFluxHist) fFluxHist = (TH1D*) f->Clone();
+  else fFluxHist->Add(f);
+
+  if (!fEventHist) fEventHist = (TH1D*) e->Clone();
+  else fEventHist->Add(e);
+
+}
+
+
+void InputHandlerBase::SetupJointInputs() {
+
+    if (jointeventinputs.size() == 1){
+      jointinput = false;
+    } else {
+      jointinput= true;
+    }
+  fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+
+  for (size_t i = 0; i < jointeventinputs.size(); i++) {
+    TH1D* eventhist = (TH1D*) jointeventinputs.at(i)->Clone();
+
+    double scale = double(fNEvents) / fEventHist->Integral("width");
+    scale *= eventhist->Integral("width");
+    scale /= double(jointindexhigh[i] - jointindexlow[i]);
+
+    jointindexscale .push_back(scale);
+  }
+
+  fEventHist->SetNameTitle((fName + "_EVT").c_str(), (fName + "_EVT").c_str());
+  fFluxHist->SetNameTitle((fName + "_FLUX").c_str(), (fName + "_FLUX").c_str());
+
+  // Setup Max Events
+  if (fMaxEvents > 1 && fMaxEvents < fNEvents) {
+    if (LOG_LEVEL(SAM)) {
+      std::cout << "\t\t|-> Read Max Entries : " << fMaxEvents << std::endl;
+    }
+    fNEvents = fMaxEvents;
+  }
+
+  // Print out Status
+  if (LOG_LEVEL(SAM)) {
+    std::cout << "\t\t|-> Total Entries    : " << fNEvents << std::endl
+              << "\t\t|-> Event Integral   : " << fEventHist->Integral("width") * 1.E-38 << " events/nucleon" << std::endl
+              << "\t\t|-> Flux Integral    : " << fFluxHist->Integral("width") << " /cm2" << std::endl
+              << "\t\t|-> Event/Flux       : "
+              << fEventHist->Integral("width") * 1.E-38 / fFluxHist->Integral("width") << " cm2/nucleon" <<  std::endl;
+  }
+
+}
+
+BaseFitEvt* InputHandlerBase::GetBaseEvent(const UInt_t entry) {
+  return static_cast<BaseFitEvt*>(GetNuisanceEvent(entry, true));
+}
+
+double InputHandlerBase::GetInputWeight(int entry) {
+
+  if (!jointinput) return 1.0;
+
+  // Find Switch Scale
+  while ( entry < jointindexlow[jointindexswitch] ||
+          entry >= jointindexhigh[jointindexswitch] ) {
+    jointindexswitch++;
+
+    // Loop Around
+    if (jointindexswitch == jointindexlow.size()) {
+      jointindexswitch = 0;
+    }
+  }
+
+  return jointindexscale[jointindexswitch];
+};
+
diff --git a/src/InputHandler/InputHandler.h b/src/InputHandler/InputHandler.h
new file mode 100644
index 0000000..44bfa77
--- /dev/null
+++ b/src/InputHandler/InputHandler.h
@@ -0,0 +1,146 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef INPUTHANDLER2_H
+#define INPUTHANDLER2_H
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+#include "TH1D.h"
+#include "FitEvent.h"
+#include "BaseFitEvt.h"
+#include "TTreePerfStats.h"
+#include "InputUtils.h"
+
+/// Base InputHandler class defining how events are requested and setup.
+class InputHandlerBase {
+public:
+
+  /// Base constructor resets everything to default
+  InputHandlerBase();
+
+  /// Removes flux/event rate histograms
+  virtual ~InputHandlerBase();
+
+  /// Return NUISANCE FitEvent Class from given event entry. 
+  /// Must be overriden by GeneratorInputHandler. Lightweight allows a faster option
+  /// to be given where only RW information is needed.
+  virtual FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight=false) = 0;
+  /// Calls GetNuisanceEvent(entry, TRUE);
+  virtual BaseFitEvt* GetBaseEvent(const UInt_t entry);
+
+
+  /// Print current event information
+  virtual void Print();
+
+
+  /// Return handler ID
+  inline std::string GetName (void) {return fName;     };
+  /// Return Handler Event Type Index
+  inline int         GetType (void) {return fEventType;};
+
+
+  /// Get Total Number of Events being Handled
+  inline virtual int   GetNEvents        (void) {return fNEvents;  };
+  /// Get the Total Flux Histogram these events were generated with
+  inline virtual TH1D* GetFluxHistogram  (void) {return fFluxHist; };
+  /// Get the Total Event Histogram these events were generated with
+  inline virtual TH1D* GetEventHistogram (void) {return fEventHist;};
+  /// Get the Total Cross-section Histogram (EventHist/FluxHist)
+  virtual TH1D* GetXSecHistogram(void);
+
+
+  /// Return all Flux Histograms for all InputFiles.
+  virtual std::vector<TH1*> GetFluxList(void);
+  /// Return all Event Histograms for all InputFiles
+  virtual std::vector<TH1*> GetEventList(void);
+  /// Return all Xsec Histograms for all InputFiles
+  virtual std::vector<TH1*> GetXSecList(void);
+
+
+  /// Placeholder to create a cache to speed up reads in GeneratorInputHandler
+  inline virtual void CreateCache(){};
+  /// Placeholder to remove optional cache to free up memory
+  inline virtual void RemoveCache(){};
+
+
+  /// Return starting NUISANCE event pointer (entry=0)
+  FitEvent* FirstNuisanceEvent();
+  /// Iterate to next NUISANCE event. Returns NULL when entry > fNEvents.
+  FitEvent* NextNuisanceEvent();
+  /// Returns starting Base Event Pointer (entry=0)
+  BaseFitEvt* FirstBaseEvent();
+  /// Iterate to next NUISANCE Base Event. Returns NULL when entry > fNEvents.
+  BaseFitEvt* NextBaseEvent();
+
+
+  /// Register an input file and update event/flux information
+  virtual void RegisterJointInput(std::string input, int n, TH1D* f, TH1D* e);
+  /// Finalise setup of Input event/flux information and calculate
+  /// joint input weights if joint input is provided.
+  virtual void SetupJointInputs();
+  /// Calculate a weight for the event given the joint input information.
+  /// Used to scale the relative proportion of multiple inputs correctly
+  /// with respect to one another.
+  virtual double GetInputWeight(int entry);
+
+
+  /// Returns the total predicted event rate for this input given the
+  /// low and high energy ranges. intOpt specifies the option the ROOT
+  /// TH1D integral should use. e.g. "" or "width"
+  double PredictedEventRate(double low, double high,
+                            std::string intOpt);
+
+  /// Returns the total generated flux for this input given the
+  /// low and high energy ranges. intOpt specifies the option the ROOT
+  /// TH1D integral should use. e.g. "" or "width"
+  double TotalIntegratedFlux(double low = -9999.9, double high = -9999.9,
+                             std::string intOpt = "");
+
+
+  /// Actual data members.
+  std::vector<TH1D*> jointfluxinputs;
+  std::vector<TH1D*> jointeventinputs;
+  std::vector<int> jointindexlow;
+  std::vector<int> jointindexhigh;
+  std::vector<int> jointindexallowed;
+  size_t jointindexswitch;
+  bool jointinput;
+  std::vector<double> jointindexscale;
+
+  std::string fName;
+  TH1D* fFluxHist;
+  TH1D* fEventHist;
+  TH1D* fXSecHist;
+  int fNEvents;
+  int fMaxEvents;
+  FitEvent* fNUISANCEEvent;
+  BaseFitEvt* fBaseEvent;
+  int fEventType;
+  int fCurrentIndex;
+  int fCacheSize;
+  bool kRemoveUndefParticles;
+  bool kRemoveFSIParticles;
+  bool kRemoveNuclearParticles;
+  TTreePerfStats* fTTreePerformance;
+
+
+};
+/*! @} */
+#endif
diff --git a/src/InputHandler/InputTypes.h b/src/InputHandler/InputTypes.h
new file mode 100644
index 0000000..8cead5d
--- /dev/null
+++ b/src/InputHandler/InputTypes.h
@@ -0,0 +1,149 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef INPUTTYPES_SEEN_H
+#define INPUTTYPES_SEEN_H
+
+/// Global Enum to define generator type being read with FitEvent
+/// Have to define kNORM as if its a generator for the time being.
+enum generator_event_type {
+  kUNKNOWN = 999,
+  kNEUT = 0,
+  kNIWG = 1,
+  kNUWRO = 2,
+  kT2K = 3,
+  kCUSTOM = 4,
+  kGENIE = 5,
+  kEVTSPLINE = 6,
+  kNUANCE = 7,
+  kGiBUU = 8,
+  kNORM = 9,
+  kMODENORM = 10,
+  kEMPTY = 11,
+  kINPUTFITEVENT = 12,
+  kNEWSPLINE = 13,
+  kLIKEWEIGHT = 14,
+  kSPLINEPARAMETER = 15,
+  kHEPMC = 16,
+};
+
+namespace InputUtils {
+
+enum InputType {
+  kNEUT_Input = 0,
+  kNUWRO_Input = 1,
+  kGENIE_Input = 2,
+  kGiBUU_Input,
+  kNUANCE_Input,
+  kEVSPLN_Input,
+  kEMPTY_Input,
+  kFEVENT_Input,
+  kJOINT_Input, // Kept for backwards compatibility
+  kInvalid_Input,
+  kHIST_Input,   // Not sure if this are currently used.
+  kBNSPLN_Input  // Not sure if this are currently used.
+};
+
+}
+
+inline std::ostream& operator<<(std::ostream& os,
+                                generator_event_type const& gs) {
+  switch (gs) {
+  case kUNKNOWN: {
+    return os << "kUNKNOWN";
+  }
+  case kNEUT: {
+    return os << "kNEUT";
+  }
+  case kNIWG: {
+    return os << "kNIWG";
+  }
+  case kNUWRO: {
+    return os << "kNUWRO";
+  }
+  case kT2K: {
+    return os << "kT2K";
+  }
+  case kCUSTOM: {
+    return os << "kCUSTOM";
+  }
+  case kGENIE: {
+    return os << "kGENIE";
+  }
+  case kEVTSPLINE: {
+    return os << "kEVTSPLINE";
+  }
+  case kNUANCE: {
+    return os << "kNUANCE";
+  }
+  case kGiBUU: {
+    return os << "kGiBUU";
+  }
+  case kNORM: {
+    return os << "kNORM";
+  }
+  case kMODENORM: {
+    return os << "kMODENORM";
+  }
+  case kHEPMC: {
+    return os << "kHEPMC";
+  }
+  default: { return os << "kUNKNOWN"; }
+  }
+}
+
+
+inline std::ostream &operator<<(std::ostream &os, InputUtils::InputType it) {
+  switch (it) {
+  case InputUtils::kNEUT_Input: {
+    return os << "kNEUT_Input";
+  }
+  case InputUtils::kNUWRO_Input: {
+    return os << "kNUWRO_Input";
+  }
+  case InputUtils::kGENIE_Input: {
+    return os << "kGENIE_Input";
+  }
+  case InputUtils::kGiBUU_Input: {
+    return os << "kGiBUU_Input";
+  }
+  case InputUtils::kNUANCE_Input: {
+    return os << "kNUANCE_Input";
+  }
+  case InputUtils::kEVSPLN_Input: {
+    return os << "kEVSPLN_Input";
+  }
+  case InputUtils::kEMPTY_Input: {
+    return os << "kEMPTY_Input";
+  }
+  case InputUtils::kFEVENT_Input: {
+    return os << "kFEVENT_Input";
+  }
+  case InputUtils::kJOINT_Input: {
+    return os << "kJOINT_Input";
+  }
+  case InputUtils::kInvalid_Input:
+  case InputUtils::kHIST_Input:
+  case InputUtils::kBNSPLN_Input:
+  default: { return os << "kInvalid_Input"; }
+  }
+}
+
+
+
+#endif
diff --git a/src/FitBase/InputUtils.cxx b/src/InputHandler/InputUtils.cxx
similarity index 68%
rename from src/FitBase/InputUtils.cxx
rename to src/InputHandler/InputUtils.cxx
index 3e7bf7b..9389a4f 100644
--- a/src/FitBase/InputUtils.cxx
+++ b/src/InputHandler/InputUtils.cxx
@@ -1,152 +1,169 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FitParameters.h"
 #include "GeneralUtils.h"
 #include "GeneratorUtils.h"
 
 #include "InputUtils.h"
+#include "InputHandler.h"
 
 namespace InputUtils {
-//********************************************************************
+
+std::vector<std::string> ParseInputFileList(std::string const& inpFile) {
+
+  std::vector<std::string> inputs = GeneralUtils::ParseToStr(inpFile, ",");
+  if (inputs.front()[0] == '(') {
+    inputs.front() = inputs.front().substr(1);
+  }
+  if (inputs.back()[inputs.back().size() - 1] == ')') {
+    inputs.back() = inputs.back().substr(0, inputs.back().size() - 1);
+  }
+  return inputs;
+
+}
+
 InputType ParseInputType(std::string const &inp) {
-  //********************************************************************
 
   // The hard-coded list of supported input generators
   const static std::string filetypes[] = {"NEUT",  "NUWRO",  "GENIE",
                                           "GiBUU", "NUANCE", "EVSPLN",
-                                          "EMPTY", "FEVENT", "JOINT"};
+                                          "EMPTY", "FEVENT", "JOINT"
+                                         };
 
   size_t nInputTypes = GeneralUtils::GetArraySize(filetypes);
 
   for (size_t i = 0; i < nInputTypes; i++) {
     if (inp == filetypes[i]) {
       return InputType(i);
     }
   }
 
   return kInvalid_Input;
 }
-//********************************************************************
+
 bool IsJointInput(std::string const &inputs) {
-  //********************************************************************
 
   bool isJoint = (inputs[0] == '(');
   if (isJoint && (inputs[inputs.length() - 1] != ')')) {
     ERR(FTL) << "Inputs specifier: \"" << inputs
              << "\" looks like a composite input specifier -- "
-                "(filea.root,fileb.root), however, it did not end in a \')\', "
-                "it ended in a \'"
+             "(filea.root,fileb.root), however, it did not end in a \')\', "
+             "it ended in a \'"
              << inputs[inputs.length() - 1] << "\'" << std::endl;
     throw;
   }
   return isJoint;
 }
 
-//********************************************************************
 std::string ExpandInputDirectories(std::string const &inputs) {
-  //********************************************************************
 
   // Parse the "environement" flags in the fitter config
   // Can specify NEUT_DIR = "" and others in parameters/fitter.config.dat
   const static std::string filedir[] = {"NEUT_DIR",   "NUWRO_DIR",
                                         "GENIE_DIR",  "NUANCE_DIR",
-                                        "EVSPLN_DIR", "GIBUU_DIR"};
+                                        "EVSPLN_DIR", "GIBUU_DIR"
+                                       };
   size_t nfiledir = GeneralUtils::GetArraySize(filedir);
   std::string expandedInputs = inputs;
 
   for (size_t i = 0; i < nfiledir; i++) {
     std::string tempdir = "@" + filedir[i];
-    std::string const &event_folder =
-        EnsureTrailSlash(FitPar::Config().GetParS(filedir[i]));
     size_t torpl = expandedInputs.find(tempdir);
-    while (torpl != std::string::npos) {
+    if (torpl != std::string::npos) {
+      std::string event_folder = FitPar::Config().GetParS(filedir[i]);
       expandedInputs.replace(torpl, tempdir.size(), event_folder);
-      torpl = expandedInputs.find(tempdir);
+      break;
     }
   }
 
-  return RemoveDoubleSlash(expandedInputs);
+  return expandedInputs;
 }
 
 InputType GuessInputTypeFromFile(TFile *inpF) {
+  /*
+    const std::string NEUT_TreeName = "neuttree";
+  const std::string NuWro_TreeName = "treeout";
+  const std::string GENIE_TreeName = "gtree";
+  const std::string GiBUU_TreeName = "giRooTracker";
   if (!inpF) {
     return kInvalid_Input;
   }
   TTree *NEUT_Input =
-      dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::NEUT_TreeName.c_str()));
+    dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::NEUT_TreeName.c_str()));
   if (NEUT_Input) {
     return kNEUT_Input;
   }
   TTree *NUWRO_Input =
-      dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::NuWro_TreeName.c_str()));
+    dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::NuWro_TreeName.c_str()));
   if (NUWRO_Input) {
     return kNUWRO_Input;
   }
   TTree *GENIE_Input =
-      dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::GENIE_TreeName.c_str()));
+    dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::GENIE_TreeName.c_str()));
   if (GENIE_Input) {
     return kGENIE_Input;
   }
   TTree *GiBUU_Input =
-      dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::GiBUU_TreeName.c_str()));
+    dynamic_cast<TTree *>(inpF->Get(GeneratorUtils::GiBUU_TreeName.c_str()));
   if (GiBUU_Input) {
     return kGiBUU_Input;
   }
-
+*/
   return kInvalid_Input;
 }
 
 std::string PrependGuessedInputTypeToName(std::string const &inpFName) {
   TFile *inpF = TFile::Open(inpFName.c_str(), "READ");
   if (!inpF || !inpF->IsOpen()) {
     ERR(FTL) << "Couldn't open \"" << inpFName << "\" for reading."
              << std::endl;
     throw;
   }
   InputType iType = GuessInputTypeFromFile(inpF);
   if (iType == kInvalid_Input) {
-    ERR(FTL) << "Couldn't determine input type from file: " << inpFName << "."
-             << std::endl;
+    ERR(FTL) << "Couldn't determine input type from file: " << inpFName
+             << "." << std::endl;
     throw;
   }
   inpF->Close();
   delete inpF;
 
   switch (iType) {
-    case kNEUT_Input: {
-      return "NEUT:" + inpFName;
-    }
-    case kNUWRO_Input: {
-      return "NUWRO:" + inpFName;
-    }
-    case kGENIE_Input: {
-      return "GENIE:" + inpFName;
-    }
-    case kGiBUU_Input: {
-      return "GiBUU:" + inpFName;
-    }
-    default: {
-      ERR(FTL) << "Input type from file: " << inpFName << " was invalid."
-               << std::endl;
-      throw;
-    }
+  case kNEUT_Input: {
+    return "NEUT:" + inpFName;
+  }
+  case kNUWRO_Input: {
+    return "NUWRO:" + inpFName;
+  }
+  case kGENIE_Input: {
+    return "GENIE:" + inpFName;
+  }
+  case kGiBUU_Input: {
+    return "GiBUU:" + inpFName;
+  }
+  default: {
+    ERR(FTL) << "Input type from file: " << inpFName << " was invalid."
+             << std::endl;
+    throw;
+  }
   }
 }
+
 }
diff --git a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h b/src/InputHandler/InputUtils.h
similarity index 53%
copy from src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
copy to src/InputHandler/InputUtils.h
index 1f6f04d..ad53852 100644
--- a/src/BNL/BNL_CC1ppip_Evt_1DcosthAdler_nu.h
+++ b/src/InputHandler/InputUtils.h
@@ -1,40 +1,49 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
-#define BNL_CC1PPIP_EVT_1DCOSTHADLER_NU_H_SEEN
+#ifndef INPUT_UTILS_H
+#define INPUT_UTILS_H
 
-#include "Measurement1D.h"
+#include <string>
+#include "TFile.h"
+#include "InputTypes.h"
 
-class BNL_CC1ppip_Evt_1DcosthAdler_nu : public Measurement1D {
+namespace InputUtils {
 
-public:
-  BNL_CC1ppip_Evt_1DcosthAdler_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~BNL_CC1ppip_Evt_1DcosthAdler_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  //void ScaleEvents();
-  bool isSignal(FitEvent *event);
-  //void FillHistograms();
+/// Extract Input Type from start of filename
+InputType ParseInputType(std::string const &inp);
 
- private:
+/// Check for comma seperated joint input files
+bool IsJointInput(std::string const &inputs);
+
+/// Replace Input Event Diretory tags with Full Names from Config
+std::string ExpandInputDirectories(std::string const &inputs);
+
+/// Open ROOT file and guess what the file type is from the tree names
+InputType GuessInputTypeFromFile(TFile *inpF);
+
+/// Guess file input type and form an updated filename with it
+std::string PrependGuessedInputTypeToName(std::string const &inpFName);
+
+/// Split file inputs by commas and remove brackets before putting into a vector
+std::vector<std::string> ParseInputFileList(std::string const& inpFile);
+
+}
 
-};
-  
 #endif
diff --git a/src/InputHandler/InteractionModes.h b/src/InputHandler/InteractionModes.h
new file mode 100644
index 0000000..f381f30
--- /dev/null
+++ b/src/InputHandler/InteractionModes.h
@@ -0,0 +1,91 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef INTERACTION_MODES_H
+#define INTERACTION_MODES_H
+
+namespace InputHandler {
+
+enum InteractionModes {
+	kCCQE       = 1,
+	kCC2p2h     = 2,
+	kCC1piponp  = 11,
+	kCC1pi0onn  = 12,
+	kCC1piponn  = 13,
+	kCCCoherent = 16,
+	kCC1gamma   = 17,
+	kCCmultipi  = 21,
+	kCC1etaonn  = 22,
+	kCC1kaonp   = 23,
+	kCCDIS      = 26,
+	kNC1pi0onn  = 31,
+	kNC1pi0onp  = 32,
+	kNC1pimonn  = 33,
+	kNC1piponp  = 34,
+	kNCCoherent = 36,
+	kNC1gamman  = 38,
+	kNC1gammap  = 39,
+	kNCmultipi  = 41,
+	kNC1etaonn  = 42,
+	kNC1etaonp  = 43,
+	kNC1kaon0   = 44,
+	kNC1kaonp   = 45,
+	kNCDIS      = 46,
+	kNCELonp    = 51,
+	kNCELonn    = 52,
+	kNC2p2h     = 53
+} 
+}
+
+inline std::ostream &operator<<(std::ostream &os, InputHandler::InteractionModes it) {
+
+	switch(it){
+		case InputHandler::kCCQE:       return os << "CCQE";
+		case InputHandler::kCC2p2h:     return os << "CC2p2h";
+		case InputHandler::kCC1piponp:  return os << "CC1piponp";
+		case InputHandler::kCC1pi0onn:  return os << "CC1pi0onn";
+		case InputHandler::kCC1piponn:  return os << "CC1piponn";
+		case InputHandler::kCCCoherent: return os << "CCCoherent";
+		case InputHandler::kCC1gamma:   return os << "CC1gamma";
+		case InputHandler::kCCmultipi:  return os << "CCmultipi";
+		case InputHandler::kCC1etaonn:  return os << "CC1etaonn";
+		case InputHandler::kCC1kaonp:   return os << "CC1kaonp";
+		case InputHandler::kCCDIS:      return os << "CCDIS";
+		case InputHandler::kNC1pi0onn:  return os << "NC1pi0onn";
+		case InputHandler::kNC1pi0onp:  return os << "NC1pi0onp";
+		case InputHandler::kNC1pimonn:  return os << "NC1pimonn";
+		case InputHandler::kNC1piponp:  return os << "NC1piponp";
+		case InputHandler::kNCCoherent: return os << "NCCoherent";
+		case InputHandler::kNC1gamman:  return os << "NC1gamman";
+		case InputHandler::kNC1gammap:  return os << "NC1gammap";
+		case InputHandler::kNCmultipi:  return os << "NCmultipi";
+		case InputHandler::kNC1etaonn:  return os << "NC1etaonn";
+		case InputHandler::kNC1etaonp:  return os << "NC1etaonp";
+		case InputHandler::kNC1kaon0:   return os << "NC1kaon0";
+		case InputHandler::kNC1kaonp:   return os << "NC1kaonp";
+		case InputHandler::kNCDIS:      return os << "NCDIS";
+		case InputHandler::kNCELonp:    return os << "NCELonp";
+		case InputHandler::kNCELonn:    return os << "NCELonn";
+		case InputHandler::kNC2p2h:     return os << "NC2p2h";
+		default: return os << "UNKNOWN";
+	}
+	return os << "UNKNOWN";
+
+}
+
+#endif
diff --git a/src/InputHandler/NEUTInputHandler.cxx b/src/InputHandler/NEUTInputHandler.cxx
new file mode 100644
index 0000000..f4fea23
--- /dev/null
+++ b/src/InputHandler/NEUTInputHandler.cxx
@@ -0,0 +1,435 @@
+#ifdef __NEUT_ENABLED__
+#include "NEUTInputHandler.h"
+
+NEUTGeneratorInfo::~NEUTGeneratorInfo() {
+	DeallocateParticleStack();
+}
+
+void NEUTGeneratorInfo::AddBranchesToTree(TTree * tn) {
+	tn->Branch("NEUTParticleN",          fNEUTParticleN,          "NEUTParticleN/I");
+	tn->Branch("NEUTParticleStatusCode", fNEUTParticleStatusCode, "NEUTParticleStatusCode[NEUTParticleN]/I");
+	tn->Branch("NEUTParticleAliveCode",  fNEUTParticleAliveCode,  "NEUTParticleAliveCode[NEUTParticleN]/I");
+}
+
+void NEUTGeneratorInfo::SetBranchesFromTree(TTree* tn) {
+	tn->SetBranchAddress("NEUTParticleN",          &fNEUTParticleN );
+	tn->SetBranchAddress("NEUTParticleStatusCode", &fNEUTParticleStatusCode );
+	tn->SetBranchAddress("NEUTParticleAliveCode",  &fNEUTParticleAliveCode  );
+
+}
+
+void NEUTGeneratorInfo::AllocateParticleStack(int stacksize) {
+	fNEUTParticleN = 0;
+	fNEUTParticleStatusCode = new int[stacksize];
+	fNEUTParticleStatusCode = new int[stacksize];
+}
+
+void NEUTGeneratorInfo::DeallocateParticleStack() {
+	delete fNEUTParticleStatusCode;
+	delete fNEUTParticleAliveCode;
+}
+
+void NEUTGeneratorInfo::FillGeneratorInfo(NeutVect* nevent) {
+	Reset();
+	for (int i = 0; i < nevent->Npart(); i++) {
+		fNEUTParticleStatusCode[i] = nevent->PartInfo(i)->fStatus;
+		fNEUTParticleAliveCode[i]  = nevent->PartInfo(i)->fIsAlive;
+		fNEUTParticleN++;
+	}
+}
+
+void NEUTGeneratorInfo::Reset() {
+	for (int i = 0; i < fNEUTParticleN; i++) {
+		fNEUTParticleStatusCode[i] = -1;
+		fNEUTParticleAliveCode[i]  = 9;
+	}
+	fNEUTParticleN = 0;
+}
+
+
+
+NEUTInputHandler::NEUTInputHandler(std::string const& handle, std::string const& rawinputs) {
+	LOG(SAM) << "Creating NEUTInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+
+	// Setup the TChain
+	fNEUTTree = new TChain("neuttree");
+	fSaveExtra = FitPar::Config().GetParB("SaveExtraNEUT");
+	fCacheSize = FitPar::Config().GetParI("CacheSize");
+	fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+
+	// Loop over all inputs and grab flux, eventhist, and nevents
+	std::vector<std::string> inputs = InputUtils::ParseInputFileList(rawinputs);
+	for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
+
+		// Open File for histogram access
+		TFile* inp_file = new TFile(inputs[inp_it].c_str(), "READ");
+		if (!inp_file or inp_file->IsZombie()) {
+			THROW( "NEUT File IsZombie() at : '" << inputs[inp_it] << "'" << std::endl
+			       << "Check that your file paths are correct and the file exists!" << std::endl
+			       << "$ ls -lh " << inputs[inp_it] );
+		}
+
+		// Get Flux/Event hist
+		TH1D* fluxhist  = (TH1D*)inp_file->Get(
+		                      (PlotUtils::GetObjectWithName(inp_file, "flux")).c_str());
+		TH1D* eventhist = (TH1D*)inp_file->Get(
+		                      (PlotUtils::GetObjectWithName(inp_file, "evt")).c_str());
+		if (!fluxhist or !eventhist) {
+			ERROR(FTL, "Input File Contents: " << inputs[inp_it] );
+			inp_file->ls();
+			THROW( "NEUT FILE doesn't contain flux/xsec info. You may have to regenerate your MC!" );
+		}
+
+		// Get N Events
+		TTree* neuttree = (TTree*)inp_file->Get("neuttree");
+		if (!neuttree) {
+			ERROR(FTL, "neuttree not located in NEUT file: " << inputs[inp_it]);
+			THROW("Check your inputs, they may need to be completely regenerated!");
+			throw;
+		}
+		int nevents = neuttree->GetEntries();
+		if (nevents <= 0) {
+			THROW("Trying to a TTree with " << nevents << " to TChain from : " << inputs[inp_it]);
+		}
+
+		// Register input to form flux/event rate hists
+		RegisterJointInput(inputs[inp_it], nevents, fluxhist, eventhist);
+
+		// Add To TChain
+		fNEUTTree->AddFile( inputs[inp_it].c_str() );
+	}
+
+
+	// Registor all our file inputs
+	SetupJointInputs();
+
+	// Assign to tree
+	fEventType = kNEUT;
+	fNeutVect = NULL;
+	fNEUTTree->SetBranchAddress("vectorbranch", &fNeutVect);
+
+	// Create Fit Event
+	fNUISANCEEvent = new FitEvent();
+	fNUISANCEEvent->SetNeutVect(fNeutVect);
+
+	if (fSaveExtra) {
+		fNeutInfo = new NEUTGeneratorInfo();
+		fNUISANCEEvent->AddGeneratorInfo(fNeutInfo);
+	}
+
+	fNUISANCEEvent->HardReset();
+};
+
+NEUTInputHandler::~NEUTInputHandler() {
+	if (fNEUTTree) delete fNEUTTree;
+	if (fNeutVect) delete fNeutVect;
+	if (fNeutInfo) delete fNeutInfo;
+};
+
+void NEUTInputHandler::CreateCache() {
+	if (fCacheSize > 0) {
+		// fNEUTTree->SetCacheEntryRange(0, fNEvents);
+		fNEUTTree->AddBranchToCache("vectorbranch", 1);
+		fNEUTTree->SetCacheSize(fCacheSize);
+	}
+}
+
+void NEUTInputHandler::RemoveCache() {
+	// fNEUTTree->SetCacheEntryRange(0, fNEvents);
+	fNEUTTree->AddBranchToCache("vectorbranch", 0);
+	fNEUTTree->SetCacheSize(0);
+}
+
+FitEvent* NEUTInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+	// Catch too large entries
+	if (entry >= (UInt_t)fNEvents) return NULL;
+
+	// Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+	fNEUTTree->GetEntry(entry);
+
+	// Setup Input scaling for joint inputs
+	fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+
+	// Run NUISANCE Vector Filler
+	if (!lightweight) {
+		CalcNUISANCEKinematics();
+	}
+
+	// Return event pointer
+	return fNUISANCEEvent;
+}
+
+int NEUTInputHandler::GetNeutParticleStatus(NeutPart * part) {
+
+	// State
+	int state = kUndefinedState;
+
+	// fStatus == -1 means initial  state
+	if (part->fIsAlive == false && part->fStatus == -1) {
+		state = kInitialState;
+
+		// NEUT has a bit of a strange convention for fIsAlive and fStatus
+		// combinations
+		// for NC and neutrino particle isAlive true/false and status 2 means
+		// final state particle
+		// for other particles in NC status 2 means it's an FSI particle
+		// for CC it means it was an FSI particle
+	} else if (part->fStatus == 2) {
+		// NC case is a little strange... The outgoing neutrino might be alive or
+		// not alive. Remaining particles with status 2 are FSI particles that
+		// reinteracted
+		if (abs(fNeutVect->Mode) > 30 &&
+		        (abs(part->fPID) == 14 || abs(part->fPID) == 12)) {
+			state = kFinalState;
+			// The usual CC case
+		} else if (part->fIsAlive == true) {
+			state = kFSIState;
+		}
+	} else if (part->fIsAlive == true && part->fStatus == 2 &&
+	           (abs(part->fPID) == 14 || abs(part->fPID) == 12)) {
+		state = kFinalState;
+
+	} else if (part->fIsAlive == true && part->fStatus == 0) {
+		state = kFinalState;
+
+	} else if (part->fIsAlive == true) {
+		ERR(WRN) << "Undefined NEUT state "
+		         << " Alive: " << part->fIsAlive << " Status: " << part->fStatus
+		         << " PDG: " << part->fPID << std::endl;
+		throw;
+	}
+
+	return state;
+}
+
+void NEUTInputHandler::CalcNUISANCEKinematics() {
+
+	// Reset all variables
+	fNUISANCEEvent->ResetEvent();
+
+	// Fill Globals
+	fNUISANCEEvent->fMode    = fNeutVect->Mode;
+	fNUISANCEEvent->Mode     = fNeutVect->Mode;
+	fNUISANCEEvent->fEventNo = fNeutVect->EventNo;
+	fNUISANCEEvent->fTargetA = fNeutVect->TargetA;
+	fNUISANCEEvent->fTargetZ = fNeutVect->TargetZ;
+	fNUISANCEEvent->fTargetH = fNeutVect->TargetH;
+	fNUISANCEEvent->fBound   = bool(fNeutVect->Ibound);
+
+	if (fNUISANCEEvent->fBound) {
+		fNUISANCEEvent->fTargetPDG = TargetUtils::GetTargetPDGFromZA(fNUISANCEEvent->fTargetZ,
+		                             fNUISANCEEvent->fTargetA);
+	} else {
+		fNUISANCEEvent->fTargetPDG = 1000010010;
+	}
+
+	// Check Particle Stack
+	UInt_t npart = fNeutVect->Npart();
+	UInt_t kmax = fNUISANCEEvent->kMaxParticles;
+	if (npart > kmax) {
+		ERR(FTL) << "NEUT has too many particles. Expanding stack." << std::endl;
+		fNUISANCEEvent->ExpandParticleStack(npart);
+		throw;
+	}
+
+	// Fill Particle Stack
+	for (size_t i = 0; i < npart; i++) {
+
+		// Get Current Count
+		int curpart = fNUISANCEEvent->fNParticles;
+
+		// Get NEUT Particle
+		NeutPart* part = fNeutVect->PartInfo(i);
+
+		// State
+		int state = GetNeutParticleStatus(part);
+
+		// Remove Undefined
+		if (kRemoveUndefParticles &&
+		        state == kUndefinedState) continue;
+
+		// Remove FSI
+		if (kRemoveFSIParticles &&
+		        state == kFSIState) continue;
+
+		// Remove Nuclear
+		if (kRemoveNuclearParticles &&
+		        (state == kNuclearInitial || state == kNuclearRemnant)) continue;
+
+		// State
+		fNUISANCEEvent->fParticleState[curpart] = state;
+
+		// Mom
+		fNUISANCEEvent->fParticleMom[curpart][0] = part->fP.X();
+		fNUISANCEEvent->fParticleMom[curpart][1] = part->fP.Y();
+		fNUISANCEEvent->fParticleMom[curpart][2] = part->fP.Z();
+		fNUISANCEEvent->fParticleMom[curpart][3] = part->fP.T();
+
+		// PDG
+		fNUISANCEEvent->fParticlePDG[curpart] = part->fPID;
+
+		// Add up particle count
+		fNUISANCEEvent->fNParticles++;
+	}
+
+	// Save Extra Generator Info
+	if (fSaveExtra) {
+		fNeutInfo->FillGeneratorInfo(fNeutVect);
+	}
+
+
+	// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent-> OrderStack();
+	return;
+}
+
+void NEUTUtils::FillNeutCommons(NeutVect* nvect) {
+
+	// WARNING: This has only been implemented for a neuttree and not GENIE
+	// This should be kept in sync with T2KNIWGUtils::GetNIWGEvent(TTree)
+
+	//NEUT version info.  Can't get it to compile properly with this yet
+	//neutversion_.corev  =   nvect->COREVer;
+	//neutversion_.nucev  =   nvect->NUCEVer;
+	//neutversion_.nuccv  =   nvect->NUCCVer;
+
+	// Documentation: See nework.h
+	nework_.modene = nvect->Mode;
+	nework_.numne = nvect->Npart();
+
+	nemdls_.mdlqeaf = nvect->QEVForm;
+	nemdls_.mdlqe = nvect->QEModel;
+	nemdls_.mdlspi = nvect->SPIModel;
+	nemdls_.mdldis = nvect->DISModel;
+	nemdls_.mdlcoh = nvect->COHModel;
+	neutcoh_.necohepi = nvect->COHModel;
+
+	nemdls_.xmaqe = nvect->QEMA;
+	nemdls_.xmvqe = nvect->QEMV;
+	nemdls_.kapp  = nvect->KAPPA;
+
+	//nemdls_.sccfv = SCCFVdef;
+	//nemdls_.sccfa = SCCFAdef;
+	//nemdls_.fpqe = FPQEdef;
+
+	nemdls_.xmaspi = nvect->SPIMA;
+	nemdls_.xmvspi = nvect->SPIMV;
+	nemdls_.xmares = nvect->RESMA;
+	nemdls_.xmvres = nvect->RESMV;
+
+	neut1pi_.xmanffres = nvect->SPIMA;
+	neut1pi_.xmvnffres = nvect->SPIMV;
+	neut1pi_.xmarsres = nvect->RESMA;
+	neut1pi_.xmvrsres = nvect->RESMV;
+	neut1pi_.neiff    = nvect->SPIForm;
+	neut1pi_.nenrtype = nvect->SPINRType;
+	neut1pi_.rneca5i  = nvect->SPICA5I;
+	neut1pi_.rnebgscl = nvect->SPIBGScale;
+
+	nemdls_.xmacoh = nvect->COHMA;
+	nemdls_.rad0nu = nvect->COHR0;
+	//nemdls_.fa1coh = nvect->COHA1err;
+	//nemdls_.fb1coh = nvect->COHb1err;
+
+	//neutdis_.nepdf = NEPDFdef;
+	//neutdis_.nebodek = NEBODEKdef;
+
+	neutcard_.nefrmflg  = nvect->FrmFlg;
+	neutcard_.nepauflg  = nvect->PauFlg;
+	neutcard_.nenefo16  = nvect->NefO16;
+	neutcard_.nemodflg  = nvect->ModFlg;
+	//neutcard_.nenefmodl = 1;
+	//neutcard_.nenefmodh = 1;
+	//neutcard_.nenefkinh = 1;
+	//neutpiabs_.neabspiemit = 1;
+
+	nenupr_.iformlen    =  nvect->FormLen;
+
+	neutpiless_.ipilessdcy = nvect->IPilessDcy;
+	neutpiless_.rpilessdcy = nvect->RPilessDcy;
+
+
+	neutpiless_.ipilessdcy = nvect->IPilessDcy;
+	neutpiless_.rpilessdcy = nvect->RPilessDcy;
+
+	neffpr_.fefqe   = nvect->NuceffFactorPIQE;
+	neffpr_.fefqeh  = nvect->NuceffFactorPIQEH;
+	neffpr_.fefinel = nvect->NuceffFactorPIInel;
+	neffpr_.fefabs  = nvect->NuceffFactorPIAbs;
+	neffpr_.fefcx   = nvect->NuceffFactorPICX;
+	neffpr_.fefcxh  = nvect->NuceffFactorPICXH;
+
+	neffpr_.fefcoh =  nvect->NuceffFactorPICoh;
+	neffpr_.fefqehf = nvect->NuceffFactorPIQEHKin;
+	neffpr_.fefcxhf = nvect->NuceffFactorPICXKin;
+	neffpr_.fefcohf = nvect->NuceffFactorPIQELKin;
+
+	for ( int i = 0; i < nework_.numne; i++ ) {
+		nework_.ipne[i] = nvect->PartInfo(i)->fPID;
+		nework_.pne[i][0] = (float)nvect->PartInfo(i)->fP.X() / 1000; // VC(NE)WORK in M(G)eV
+		nework_.pne[i][1] = (float)nvect->PartInfo(i)->fP.Y() / 1000; // VC(NE)WORK in M(G)eV
+		nework_.pne[i][2] = (float)nvect->PartInfo(i)->fP.Z() / 1000; // VC(NE)WORK in M(G)eV
+	}
+	// fsihist.h
+
+
+	// neutroot fills a dummy object for events with no FSI to prevent memory leak when
+	// reading the TTree, so check for it here
+
+	if ( (int)nvect->NfsiVert() == 1 ) { // An event with FSI must have at least two vertices
+		//    if (nvect->NfsiPart()!=1 || nvect->Fsiprob!=-1)
+		//      ERR(WRN) << "T2KNeutUtils::fill_neut_commons(TTree) NfsiPart!=1 or Fsiprob!=-1 when NfsiVert==1" << std::endl;
+
+		fsihist_.nvert = 0;
+		fsihist_.nvcvert = 0;
+		fsihist_.fsiprob = 1;
+	}
+	else { // Real FSI event
+		fsihist_.nvert = (int)nvect->NfsiVert();
+		for (int ivert = 0; ivert < fsihist_.nvert; ivert++) {
+			fsihist_.iflgvert[ivert] = nvect->FsiVertInfo(ivert)->fVertID;
+			fsihist_.posvert[ivert][0] = (float)nvect->FsiVertInfo(ivert)->fPos.X();
+			fsihist_.posvert[ivert][1] = (float)nvect->FsiVertInfo(ivert)->fPos.Y();
+			fsihist_.posvert[ivert][2] = (float)nvect->FsiVertInfo(ivert)->fPos.Z();
+		}
+
+		fsihist_.nvcvert = nvect->NfsiPart();
+		for (int ip = 0; ip < fsihist_.nvcvert; ip++) {
+			fsihist_.abspvert[ip] = (float)nvect->FsiPartInfo(ip)->fMomLab;
+			fsihist_.abstpvert[ip] = (float)nvect->FsiPartInfo(ip)->fMomNuc;
+			fsihist_.ipvert[ip] = nvect->FsiPartInfo(ip)->fPID;
+			fsihist_.iverti[ip] = nvect->FsiPartInfo(ip)->fVertStart;
+			fsihist_.ivertf[ip] = nvect->FsiPartInfo(ip)->fVertEnd;
+			fsihist_.dirvert[ip][0] = (float)nvect->FsiPartInfo(ip)->fDir.X();
+			fsihist_.dirvert[ip][1] = (float)nvect->FsiPartInfo(ip)->fDir.Y();
+			fsihist_.dirvert[ip][2] = (float)nvect->FsiPartInfo(ip)->fDir.Z();
+		}
+		fsihist_.fsiprob = nvect->Fsiprob;
+	}
+
+	neutcrscom_.crsx = nvect->Crsx;
+	neutcrscom_.crsy = nvect->Crsy;
+	neutcrscom_.crsz = nvect->Crsz;
+	neutcrscom_.crsphi = nvect->Crsphi;
+	neutcrscom_.crsq2 = nvect->Crsq2;
+
+	neuttarget_.numbndn = nvect->TargetA - nvect->TargetZ;
+	neuttarget_.numbndp = nvect->TargetZ;
+	neuttarget_.numfrep = nvect->TargetH;
+	neuttarget_.numatom = nvect->TargetA;
+	posinnuc_.ibound = nvect->Ibound;
+
+	// put empty nucleon FSI history (since it is not saved in the NeutVect format)
+	//Comment out as NEUT does not have the necessary proton FSI information yet
+	//  nucleonfsihist_.nfnvert = 0;
+	//  nucleonfsihist_.nfnstep = 0;
+
+
+}
+
+
+#endif
diff --git a/src/InputHandler/NEUTInputHandler.h b/src/InputHandler/NEUTInputHandler.h
new file mode 100644
index 0000000..4ff2144
--- /dev/null
+++ b/src/InputHandler/NEUTInputHandler.h
@@ -0,0 +1,99 @@
+#ifndef NEUTINPUTHANDLER_H
+#define NEUTINPUTHANDLER_H
+
+#ifdef __NEUT_ENABLED__
+#include "InputHandler.h"
+#include "TargetUtils.h"
+#include "neutpart.h"
+#include "neutvect.h"
+#include "PlotUtils.h"
+#include "TTreePerfStats.h"
+#include "nefillverC.h"
+#include "necardC.h"
+#include "neutmodelC.h"
+#include "neutparamsC.h"
+#include "neworkC.h"
+#include "fsihistC.h"
+#include "neutcrsC.h"
+#include "neutvect.h"
+#include "neutpart.h"
+#include "neutfsipart.h"
+#include "neutfsivert.h"
+#include "neutrootTreeSingleton.h"
+#include "NModeDefn.h"
+#include "NSyst.h"
+#include "NFortFns.h" // Contains all the NEUT common blocks
+
+#ifdef __NEUT_NUCFSI_ENABLED__
+#include "nucleonfsihistC.h"
+#include "neutnucfsivert.h"
+#include "neutnucfsistep.h"
+#endif
+
+/// NEUT Generator Container to save extra particle status codes.
+class NEUTGeneratorInfo : public GeneratorInfoBase {
+public:
+	NEUTGeneratorInfo() {};
+	virtual ~NEUTGeneratorInfo();
+
+	/// Assigns information to branches
+	void AddBranchesToTree(TTree* tn);
+
+	/// Setup reading information from branches
+	void SetBranchesFromTree(TTree* tn);
+
+	/// Allocate any dynamic arrays for a new particle stack size
+	void AllocateParticleStack(int stacksize);
+
+	/// Clear any dynamic arrays
+	void DeallocateParticleStack();
+
+	/// Read extra NEUT information from the event
+	void FillGeneratorInfo(NeutVect* nevent);
+
+	/// Reset extra information to default/empty values
+	void Reset();
+
+	int  kMaxParticles; ///< Number of particles in stack
+	int* fNEUTParticleStatusCode; ///<NEUT Particle Status Flags
+	int* fNEUTParticleAliveCode; ///< NEUT Alive Code (0 dead, 1 final state)
+	int fNEUTParticleN; ///< Number of particles
+};
+
+/// NEUT Input Convertor to read in NeutVects and convert to FitEvents
+class NEUTInputHandler : public InputHandlerBase {
+public:
+
+	/// Main constructor. Can read in single or joint inputs.
+	NEUTInputHandler(std::string const& handle, std::string const& rawinputs);
+	~NEUTInputHandler();
+
+	/// Returns NUISANCE Format event from entry in fNEUTTree
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight);
+
+	/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+
+	/// Convert NEUT particle status codes to NUISANCE format status
+	int GetNeutParticleStatus(NeutPart* part);
+
+	/// eads fNeutVect and fills into fNUISANCEEvent.
+	void CalcNUISANCEKinematics();
+
+	bool fSaveExtra; ///< Save Extra NEUT information in to fNeutInfo
+	TChain* fNEUTTree; ///< TTree for reading neut vectors.
+	NeutVect* fNeutVect;  ///< Neut vector format event.
+	NEUTGeneratorInfo* fNeutInfo; ///< NEUT Generator Info container.
+};
+
+namespace NEUTUtils {
+#ifdef __NEUT_ENABLED__
+void FillNeutCommons(NeutVect* nvect);
+#endif
+}
+
+#endif
+#endif
diff --git a/src/InputHandler/NUANCEInputHandler.cxx b/src/InputHandler/NUANCEInputHandler.cxx
new file mode 100644
index 0000000..cf7e4f4
--- /dev/null
+++ b/src/InputHandler/NUANCEInputHandler.cxx
@@ -0,0 +1,834 @@
+#ifdef __NUANCE_ENABLED__
+#include "NUANCEInputHandler.h"
+
+
+NUANCEGeneratorInfo::~NUANCEGeneratorInfo() {
+	DeallocateParticleStack();
+}
+
+void NUANCEGeneratorInfo::AddBranchesToTree(TTree * tn) {
+	// tn->Branch("NEUTParticleN",          fNEUTParticleN,          "NEUTParticleN/I");
+	// tn->Branch("NEUTParticleStatusCode", fNEUTParticleStatusCode, "NEUTParticleStatusCode[NEUTParticleN]/I");
+	// tn->Branch("NEUTParticleAliveCode",  fNEUTParticleAliveCode,  "NEUTParticleAliveCode[NEUTParticleN]/I");
+}
+
+void NUANCEGeneratorInfo::SetBranchesFromTree(TTree* tn) {
+	// tn->SetBranchAddress("NEUTParticleN",          &fNEUTParticleN );
+	// tn->SetBranchAddress("NEUTParticleStatusCode", &fNEUTParticleStatusCode );
+	// tn->SetBranchAddress("NEUTParticleAliveCode",  &fNEUTParticleAliveCode  );
+}
+
+void NUANCEGeneratorInfo::AllocateParticleStack(int stacksize) {
+	// fNEUTParticleN = 0;
+	// fNEUTParticleStatusCode = new int[stacksize];
+	// fNEUTParticleStatusCode = new int[stacksize];
+}
+
+void NUANCEGeneratorInfo::DeallocateParticleStack() {
+	// delete fNEUTParticleStatusCode;
+	// delete fNEUTParticleAliveCode;
+}
+
+void NUANCEGeneratorInfo::FillGeneratorInfo(NuanceEvent* nevent) {
+	Reset();
+	// for (int i = 0; i < nevent->Npart(); i++) {
+	// fNEUTParticleStatusCode[i] = nevent->PartInfo(i)->fStatus;
+	// fNEUTParticleAliveCode[i]  = nevent->PartInfo(i)->fIsAlive;
+	// fNEUTParticleN++;
+	// }
+}
+
+void NUANCEGeneratorInfo::Reset() {
+	// for (int i = 0; i < fNEUTParticleN; i++) {
+	// fNEUTParticleStatusCode[i] = -1;
+	// fNEUTParticleAliveCode[i]  = 9;
+	// }
+	// fNEUTParticleN = 0;
+}
+
+
+NUANCEInputHandler::NUANCEInputHandler(std::string const& handle, std::string const& rawinputs) {
+	LOG(SAM) << "Creating NUANCEInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+	fSaveExtra = FitPar::Config().GetParB("SaveExtraNUANCE");
+	fCacheSize = FitPar::Config().GetParI("CacheSize");
+	fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+
+	// Parse Inputs
+	std::vector<std::string> inputs = InputUtils::ParseInputFileList(rawinputs);
+	if (inputs.size() > 1) {
+		ERR(FTL) << "NUANCE is not currently setup to handle joint inputs sorry!" << std::endl
+		         << "If you know how to correctly normalise the events for this"
+		         << " please let us know!" << std::endl;
+	}
+
+	// Read in NUANCE Tree
+	fNUANCETree = new TChain("h3");
+	fNUANCETree->AddFile(rawinputs.c_str());
+
+	// Get entries and fNuwroEvent
+	int nevents = fNUANCETree->GetEntries();
+
+	double EnuMin = 0.0;
+	double EnuMax = 1000.0;
+
+	TH1D* fluxhist = new TH1D((fName + "_FLUX").c_str(), (fName + "_FLUX").c_str(),
+	                          100, EnuMin, EnuMax);
+	for (int i = 0; i < fluxhist->GetNbinsX(); i++) {
+		fluxhist->SetBinContent(i + 1, 1.0);
+	}
+	fluxhist->Scale(1.0 / fluxhist->Integral());
+
+	TH1D* eventhist = new TH1D((fName + "_EVT").c_str(), (fName + "_EVT").c_str(), 100,
+	                           EnuMin, EnuMax);
+	for (int i = 0; i < fluxhist->GetNbinsX(); i++) {
+		eventhist->SetBinContent(i + 1, 1.0);
+	}
+	eventhist->Scale(1.0 / eventhist->Integral());
+
+	RegisterJointInput( rawinputs, nevents, fluxhist, eventhist );
+	SetupJointInputs();
+
+	// Setup Reader
+	fNuanceEvent = new NuanceEvent();
+	fNuanceEvent->SetBranchAddresses(fNUANCETree);
+
+	// Setup Event in FitEvent
+	fNUISANCEEvent = new FitEvent();
+	fNUISANCEEvent->SetNuanceEvent(fNuanceEvent);
+
+	// Setup extra if needed
+	if (fSaveExtra){
+		ERR(FTL) << "NO SAVEExtra Implemented for NUANCE YET!" << std::endl;
+		throw;
+		// fNuanceInfo = new NUANCEGeneratorInfo();
+		// fNUISANCEEvent->AddGeneratorInfo(fNuanceInfo);
+	}
+
+};
+
+NUANCEInputHandler::~NUANCEInputHandler() {
+	if (fNuanceEvent) delete fNuanceEvent;
+	if (fNUANCETree)  delete fNUANCETree;
+	// if (fNuanceInfo)  delete fNuanceInfo;
+}
+
+void NUANCEInputHandler::CreateCache() {
+	if (fCacheSize > 0) {
+		fNUANCETree->SetCacheEntryRange(0, fNEvents);
+		fNUANCETree->AddBranchToCache("h3", 1);
+		fNUANCETree->SetCacheSize(fCacheSize);
+	}
+}
+
+void NUANCEInputHandler::RemoveCache() {
+	fNUANCETree->SetCacheEntryRange(0, fNEvents);
+	fNUANCETree->AddBranchToCache("h3", 0);
+	fNUANCETree->SetCacheSize(0);
+}
+
+FitEvent* NUANCEInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+	// Check out of bounds
+	if (entry >= (UInt_t)fNEvents) return NULL;
+
+	// Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+	fNUANCETree->GetEntry(entry);
+
+	// Setup Input scaling for joint inputs
+	fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+
+	// Run NUISANCE Vector Filler
+	if (!lightweight) {
+		CalcNUISANCEKinematics();
+	}
+
+	return fNUISANCEEvent;
+}
+
+void NUANCEInputHandler::CalcNUISANCEKinematics() {
+
+	// Reset all variables
+	fNUISANCEEvent->ResetEvent();
+
+	// Get shortened pointer
+	FitEvent* evt = fNUISANCEEvent;
+
+	// Fill Global
+	evt->fMode = ConvertNuanceMode(fNuanceEvent);
+	evt->Mode = evt->fMode;
+	evt->fEventNo = 0.0;
+	evt->fTotCrs = 1.0;
+	evt->fTargetA = 0.0;
+	evt->fTargetZ = 0.0;
+	evt->fTargetH = 0;
+	evt->fBound = 0.0;
+
+	// Fill particle Stack
+	evt->fNParticles = 0;
+
+	// Check Particle Stack
+	UInt_t npart = 2 + fNuanceEvent->n_leptons + fNuanceEvent->n_hadrons;
+	UInt_t kmax = evt->kMaxParticles;
+	if (npart > kmax) {
+		ERR(FTL) << "NUANCE has too many particles" << std::endl;
+		ERR(FTL) << "npart=" << npart << " kMax=" << kmax << std::endl;
+		throw;
+	}
+
+	// Fill Neutrino
+	evt->fParticleState[0] = kInitialState;
+	evt->fParticleMom[0][0] = fNuanceEvent->p_neutrino[0];
+	evt->fParticleMom[0][1] = fNuanceEvent->p_neutrino[1];
+	evt->fParticleMom[0][2] = fNuanceEvent->p_neutrino[2];
+	evt->fParticleMom[0][3] = fNuanceEvent->p_neutrino[3];
+	evt->fParticlePDG[0] = fNuanceEvent->neutrino;
+
+	// Fill Target Nucleon
+	evt->fParticleState[1] = kInitialState;
+	evt->fParticleMom[1][0] = fNuanceEvent->p_targ[0];
+	evt->fParticleMom[1][1] = fNuanceEvent->p_targ[1];
+	evt->fParticleMom[1][2] = fNuanceEvent->p_targ[2];
+	evt->fParticleMom[1][3] = fNuanceEvent->p_targ[3];
+	evt->fParticlePDG[1] = fNuanceEvent->target;
+	evt->fNParticles = 2;
+
+	// Fill Outgoing Leptons
+	for (int i = 0; i < fNuanceEvent->n_leptons; i++) {
+		evt->fParticleState[evt->fNParticles] = kFinalState;
+		evt->fParticleMom[evt->fNParticles][0] = fNuanceEvent->p_lepton[i][0];
+		evt->fParticleMom[evt->fNParticles][1] = fNuanceEvent->p_lepton[i][1];
+		evt->fParticleMom[evt->fNParticles][2] = fNuanceEvent->p_lepton[i][2];
+		evt->fParticleMom[evt->fNParticles][3] = fNuanceEvent->p_lepton[i][3];
+		evt->fParticlePDG[evt->fNParticles] = fNuanceEvent->lepton[i];
+		evt->fNParticles++;
+	}
+
+	// Fill Outgoing Hadrons
+	for (int i = 0; i < fNuanceEvent->n_hadrons; i++) {
+		evt->fParticleState[evt->fNParticles] = kFinalState;
+		evt->fParticleMom[evt->fNParticles][0] = fNuanceEvent->p_hadron[i][0];
+		evt->fParticleMom[evt->fNParticles][1] = fNuanceEvent->p_hadron[i][1];
+		evt->fParticleMom[evt->fNParticles][2] = fNuanceEvent->p_hadron[i][2];
+		evt->fParticleMom[evt->fNParticles][3] = fNuanceEvent->p_hadron[i][3];
+		evt->fParticlePDG[evt->fNParticles] = fNuanceEvent->hadron[i];
+		evt->fNParticles++;
+	}
+
+	// Save Extra info
+	if (fSaveExtra) {
+		// fNuanceInfo->FillGeneratorInfo(fNuanceEvent);
+	}
+
+	// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent-> OrderStack();
+	return;
+}
+
+void NUANCEInputHandler::Print() {}
+
+int NUANCEInputHandler::ConvertNuanceMode(NuanceEvent * evt) {
+	int ch = evt->channel;
+	int sg = 1;
+	if (evt->neutrino < 0) sg = -1;
+
+	switch (ch) {
+	//  1 NUANCE CCQE -> NEUT CCQE 1
+	case 1: return sg * 1;
+	//  2 NUANCE NCEL -> NEUT NCEL 51,52 -> Set from whether target is p or n
+	case 2:
+		if (evt->target == 2212) return sg * 51;
+		else return sg * 52;
+
+	// 3 NUANCE CCPIP -> NEUT CCPIP 11
+	case 3: return sg * 11;
+	// 4 NUANCE CCPI0 -> NEUT CCPI0 = 12
+	case 4: return sg * 12;
+	// 5 NUANCE CCPIPn -> NEUT CCPIPn 13
+	case 5: return sg * 13;
+	// 6 NUANCE NCpPI0 -> NEUT NCpPI0  32
+	case 6: return sg * 32;
+	// 7 NUANCE NCpPI+ -> NEUT NCpPI+  34
+	case 7: return sg * 34;
+	// 8 NUANCE NCnPI0 -> NEUT NCnPI0  31
+	case 8: return sg * 31;
+	// 9  NUANCE NCnPIM -> NEUT NCnPIM  33
+	case 9: return sg * 33;
+	// 10 NUANCE CCPIP -> NEUT CCPIP -11
+	case 10: return sg * 11;
+	// 11 NUANCE CCPI0 -> NEUT CCPI0 -12
+	case 11: return sg * 12;
+	// 12 NUANCE CCPIPn -> NEUT CCPIPn 13
+	case 12: return sg * 13;
+	// 13 NUANCE NCpPI0 -> NEUT NCnPI0 -32
+	case 13: return sg * 32;
+	// 14 NUANCE NCpPI+ -> NEUT NCpPI+ -34
+	case 14: return sg * 34;
+	// 15 NUANCE NCnPI0 -> NEUT NCnPI0 -31
+	case 15: return sg * 31;
+	// 16 NUANCE NCnPIM -> NEUT NCnPIM -33
+	case 16: return sg * 33;
+	// 17 NUANCE -> NEUT 21 CC MULTIPI
+	case 17: return sg * 21;
+	// 18 NUANCE -> NEUT 21 CC MULTIPI
+	case 18: return sg * 21;
+	// 19 NUANCE -> NEUT 21 CC MULTIPI
+	case 19: return sg * 21;
+	// 20 NUANCE -> NEUT 21  CC MULTIPI
+	case 20: return sg * 21;
+	// 21 NUANCE -> NEUT 21  CC MULTIPI
+	case 21: return sg * 21;
+	// 22 NUANCE -> NEUT 41 NC MULTIPI
+	case 22: return sg * 41;
+	// 23 NUANCE -> NEUT 41 NC MULTIPI
+	case 23: return sg * 41;
+	// 24 NUANCE -> NEUT 41 NC MULTIPI
+	case 24: return sg * 41;
+	// 25 NUANCE -> NEUT 41 NC MULTIPI
+	case 25: return sg * 41;
+	// 26 NUANCE -> NEUT 41 NC MULTIPI
+	case 26: return sg * 41;
+	// 27 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 27: return sg * 41;
+	// 28 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
+	case 28: return sg * 21;
+	// 29 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
+	case 29: return sg * 21;
+	// 30 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
+	case 30: return sg * 21;
+	// 31 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
+	case 31: return sg * 21;
+	// 32 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV)
+	case 32: return sg * 21;
+	// 33 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 33: return sg * 41;
+	// 34 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 34: return sg * 41;
+	// 35 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 35: return sg * 41;
+	// 36 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 36: return sg * 41;
+	// 37 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 37: return sg * 41;
+	// 38 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV)
+	case 38: return sg * 41;
+
+	// 39 NUANCE -> NEUT 22
+	case 39: return sg * 22;
+	// 40 NUANCE -> NEUT 22
+	case 40: return sg * 22;
+	// 41 NUANCE -> NEUT 22
+	case 41: return sg * 22;
+	// 42 NUANCE -> NEUT 43
+	case 42: return sg * 43;
+	// 43 NUANCE -> NEUT 43
+	case 43: return sg * 43;
+	// 44 NUANCE -> NUET 42
+	case 44: return sg * 42;
+	// 45 NUANCE -> NEUT -42
+	case 45: return sg * 42;
+	// 46 NUANCE -> NEUT -22
+	case 46: return sg * 22;
+	// 47 NUANCE -> NEUT -22
+	case 47: return sg * 22;
+	// 48 NUANCE -> NEUT -22
+	case 48: return sg * 22;
+	// 49 NUANCE -> NEUT -43
+	case 49: return sg * 43;
+	// 50 NUANCE -> NEUT -43
+	case 50: return sg * 43;
+	// 51 NUANCE -> NEUT -42
+	case 51: return sg * 42;
+	// 52 NUANCE -> NEUT -42
+	case 52: return sg * 42;
+
+	// 53 NUANCE -> NEUT 23 CC 1K
+	case 53: return sg * 23;
+	// 54 NUANCE -> NEUT 23 CC 1K
+	case 54: return sg * 23;
+	// 55 NUANCE -> NEUT 23 CC 1K
+	case 55: return sg * 23;
+	// 56 NUANCE -> NEUT 45 NC 1K
+	case 56: return sg * 45;
+	// 57 NUANCE -> NEUT 44 NC 1K
+	case 57: return sg * 44;
+	// 58 NUANCE -> NEUT 44 NC 1K
+	case 58: return sg * 44;
+	// 59 NUANCE -> NEUT 44 NC 1K
+	case 59: return sg * 44;
+	// 60 NUANCE -> NEUT -23 CC 1K
+	case 60: return sg * 23;
+	// 61 NUANCE -> NEUT -23 CC 1K
+	case 61: return sg * 23;
+	// 62 NUANCE -> NEUT -23 CC 1K
+	case 62: return sg * 23;
+	// 63 NUANCE -> NEUT -23 CC 1K
+	case 63: return sg * 23;
+	// 64 NUANCE -> NEUT -44 NC 1K
+	case 64: return sg * 44;
+	// 65 NUANCE -> NEUT -44 NC 1K
+	case 65: return sg * 44;
+	// 66 NUANCE -> NEUT -45 NC 1K
+	case 66: return sg * 45;
+	// 67  NUANCE -> NEUT 22  CC1eta
+	case 67: return sg * 22;
+	// 68 NUANCE -> NEUT 43 NC p eta
+	case 68: return sg * 43;
+	// 69 NUANCE -> NEUT 43 NC n eta
+	case 69: return sg * 43;
+	// 70 NUANCE -> NEUT -22 CC1eta
+	case 70: return sg * 22;
+	// 71 NUANCE -> NEUT -43 NC p eta
+	case 71: return sg * 43;
+	// 72 NUANCE -> NEUT 42 NC n eta
+	case 72: return sg * 42;
+
+	// 73 NUANCE -> NEUT 21 CC Multi Pi
+	case 73: return sg * 21;
+	// 74 NUANCE -> NEUT 41 NC Multi Pi
+	case 74: return sg * 41;
+	// 75 NUANCE -> NEUT 41 NC Multi Pi
+	case 75: return sg * 41;
+	// 76 NUANCE -> NEUT -21 CC Multi Pi
+	case 76: return sg * 21;
+	// 77 NUANCE -> NEUT -41 NC Multi Pi
+	case 77: return sg * 41;
+	// 78 NUANCE -> NEUT -41 NC Multi Pi
+	case 78: return sg * 41;
+	//  79  NUANCE -> NEUT 21 CC Multi Pi
+	case 79: return sg * 21;
+	// 80 NUANCE -> NEUT 21 CC Multi Pi
+	case 80: return sg * 21;
+	// 81 NUANCE -> NEUT 41 NC Multi Pi
+	case 81: return sg * 41;
+	// 82 NUANCE -> NEUT 41 NC Multi Pi
+	case 82: return sg * 41;
+	// 83 NUANCE -> NEUT 41 NC Multi Pi
+	case 83: return sg * 41;
+	// 84 NUANCE -> NEUT 41 NC Multi Pi
+	case 84: return sg * 84;
+	// 85 NUANCE -> NEUT -21 CC Multi Pi
+	case 85: return sg * 21;
+	// 86 NUANCE -> NEUT -21  CC Multi Pi
+	case 86: return sg * 21;
+	// 87 NUANCE -> NEUT -41 CC Multi Pi
+	case 87: return sg * 41;
+	// 88 NUANCE -> NEUT -41
+	case 88: return sg * 41;
+	// 89 NUANCE -> NEUT -41
+	case 89: return sg * 41;
+	// 90 NUANCE -> NEUT -41
+	case 90: return sg * 41;
+
+	// 91 NUANCE -> NEUT 26  CC DIS
+	case 91: return sg * 26;
+	// 92 NUANCE -> NEUT 46  NC DIS
+	case 92: return sg * 46;
+	// 93 NUANCE -> NEUT 17 1#gamma from #Delta
+	case 93: return sg * 17;
+	// 94 NUANCE -> NEUT 39 1#gamma from #Delta
+	case 94: return sg * 39;
+	// 95 -> UNKOWN NEUT MODE
+	case 95: return sg * 0;
+	// 96 NUANCE -> NEUT 36 NC COH
+	case 96: return sg * 36;
+	// 97 NUANCE -> NEUT 16
+	case 97: return sg * 16;
+	// 98 -> UNKNOWN NEUT MODE
+	case 98: return sg * 0;
+	// 99 -> UNKNOWN NEUT MODE
+	case 99: return sg * 0;
+	default:
+		ERR(FTL) << "Unknown Nuance Channel ID = " << ch << std::endl;
+		throw ("Exiting.");
+		return 0;
+	}
+	return 0;
+
+}
+
+
+/*
+// Notes copied from NuanceChannels.pdf
+1 NUANCE CCQE -> NEUT CCQE 1
+CC, numu n --> mu- p
+Cabibbo-allowed quasi-elastic scattering from nucleons
+2 NUANCE NCEL -> NEUT NCEL 51,52 -> Set from whether target is p or n
+NC, numu N --> num N, (N=n,p)
+(quasi)-elastic scattering from nucleons
+3 NUANCE CCPIP -> NEUT CCPIP 11
+CC, numu p --> mu- p pi+
+resonant single pion production
+4 NUANCE CCPI0 -> NEUT CCPI0 = 12
+CC, numu n --> mu- p pi0
+resonant single pion production
+5 NUANCE CCPIPn -> NEUT CCPIPn 13
+CC, numu n --> mu- n pi+
+resonant single pion production
+6 NUANCE NCpPI0 -> NEUT NCpPI0  32
+NC, numu p --> numu p pi0
+resonant single pion production
+7 NUANCE NCpPI+ -> NEUT NCpPI+  34
+NC, numu p --> numu n pi+
+resonant single pion production
+8 NUANCE NCnPI0 -> NEUT NCnPI0  31
+NC, numu n --> numu n pi0
+resonant single pion production
+9  NUANCE NCnPIM -> NEUT NCnPIM  33
+NC, numu n --> numu p pi-
+resonant single pion production
+10 NUANCE CCPIP -> NEUT CCPIP -11
+CC, numubar p --> mu- p pi+
+resonant single pion production
+11 NUANCE CCPI0 -> NEUT CCPI0 -12
+CC, numubar n --> mu- p pi0
+resonant single pion production
+12 NUANCE CCPIPn -> NEUT CCPIPn -13
+CC, numubar n --> mu- n pi+
+resonant single pion production
+13 NUANCE NCpPI0 -> NEUT NCnPI0 -32
+NC, numubar p --> numubar p pi0
+resonant single pion production
+14 NUANCE NCpPI+ -> NEUT NCpPI+ -34
+NC, numubar p --> numubar n pi+
+resonant single pion production
+15 NUANCE NCnPI0 -> NEUT NCnPI0 -31
+NC, numubar n --> numubar n pi0
+resonant single pion production
+16 NUANCE NCnPIM -> NEUT NCnPIM -33
+NC, numubar n --> numubar p pi-
+resonant single pion production
+
+
+17 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numu p --> mu- Delta+ pi+
+resonant processes involving more than a single pion
+18 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numu p --> mu- Delta++ pi0
+resonant processes involving more than a single pion
+19 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numu n --> mu- Delta+ pi0
+resonant processes involving more than a single pion
+20 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numu n --> mu- Delta0 pi+
+resonant processes involving more than a single pion
+21 NUANCE -> NEUT 21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numu n --> mu- Delta++ pi-
+resonant processes involving more than a single pion
+
+22 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numu p+ --> numu Delta+ pi0
+resonant processes involving more than a single pion
+23 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC,numu p --> numu Delta0 pi+
+resonant processes involving more than a single pion
+24 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numu p --> numu Delta++ pi-
+resonant processes involving more than a single pion
+25 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numu n --> numu Delta+ pi-
+resonant processes involving more than a single pion
+26 NUANCE -> NEUT 41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numu n --> numu Delta0 pi0
+resonant processes involving more than a single pion
+
+27 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar n --> numubar Delta- pi+
+resonant processes involving more than a single pion
+28 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numubar p --> mu- Delta+ pi+
+resonant processes involving more than a single pion
+29 UANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numubar p --> mu- Delta++ pi0
+resonant processes involving more than a single pion
+30 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numubar n --> mu- Delta+ pi0
+resonant processes involving more than a single pion
+31 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numubar n --> mu- Delta0 pi+
+resonant processes involving more than a single pion
+32 NUANCE -> NEUT -21 CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi
+CC, numubar n --> mu- Delta++ pi-
+resonant processes involving more than a single pion
+33 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar p+ --> numubar Delta+ pi0
+resonant processes involving more than a single pion
+34 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC,numubar p --> numubar Delta0 pi+
+resonant processes involving more than a single pion
+35 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar p --> numubar Delta++ pi-
+resonant processes involving more than a single pion
+36 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar n --> numubar Delta+ pi-
+resonant processes involving more than a single pion
+37 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar n --> numubar Delta0 pi0
+resonant processes involving more than a single pion
+38 NUANCE -> NEUT -41 "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi"
+NC, numubar n --> numubar Delta- pi+
+resonant processes involving more than a single pion
+
+
+// RHO Production lumped in with eta production
+22 CCeta
+43 NCeta on p
+42 NCeta on n
+
+39 NUANCE -> NEUT 22
+CC, numu p --> mu- p rho+(770)
+resonant processes involving more than a single pion
+40 NUANCE -> NEUT 22
+CC, numu n --> mu- p rho0(770)
+resonant processes involving more than a single pion
+41 NUANCE -> NEUT 22
+CC, numu n --> mu- n rho+(770)
+resonant processes involving more than a single pion
+42 NUANCE -> NEUT 43
+NC, numu p --> numu p rho0(770)
+resonant processes involving more than a single pion
+43 NUANCE -> NEUT 43
+NC, numu p --> numu n rho+(770)
+resonant processes involving more than a single pion
+44 NUANCE -> NUET 42
+NC, numu n --> numu n rho0(770)
+resonant processes involving more than a single pion
+45 NUANCE -> NEUT -42
+NC, numubar n --> numubar p rho-(770)
+resonant processes involving more than a single pion
+46 NUANCE -> NEUT -22
+CC, numubar p --> mu- p rho+(770)
+resonant processes involving more than a single pion
+47 NUANCE -> NEUT -22
+CC, numubar n --> mu- p rho0(770)
+resonant processes involving more than a single pion
+48 NUANCE -> NEUT -22
+CC, numubar n --> mu- n rho+(770)
+resonant processes involving more than a single pion
+49 NUANCE -> NEUT -43
+NC, numubar p --> numubar p rho0(770)
+resonant processes involving more than a single pion
+50 NUANCE -> NEUT -43
+NC, numubar p --> numubar n rho+(770)
+resonant processes involving more than a single pion
+51 NUANCE -> NEUT -42
+NC, numubar n --> numubar n rho0(770)
+resonant processes involving more than a single pion
+52 NUANCE -> NEUT -42
+NC, numubar n --> numubar p rho-(770)
+resonant processes involving more than a single pion
+
+
+53 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numu p --> mu- Sigma+ K+
+resonant processes involving more than a single pion
+54 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numu n --> mu- Sigma0 K+
+resonant processes involving more than a single pion
+55 NUANCE -> NEUT 23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numu n --> mu- Sigma+ K0
+resonant processes involving more than a single pion
+56 NUANCE -> NEUT 45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
+NC, numu p --> numu Sigma0 K+
+resonant processes involving more than a single pion
+57 NUANCE -> NEUT 44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
+NC, numu p --> numu Sigma+ K0
+resonant processes involving more than a single pion
+58 NUANCE -> NEUT 44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
+NC, numu n --> numu Sigma0 K0
+resonant processes involving more than a single pion
+59 NUANCE -> NEUT 45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
+NC, numu n --> numu Sigma- K+
+resonant processes involving more than a single pion
+60 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numubar p --> mu- Sigma+ K+
+resonant processes involving more than a single pion
+61 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numubar n --> mu- Sigma0 K+
+resonant processes involving more than a single pion
+62 NUANCE -> NEUT -23 CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}
+CC, numubar n --> mu- Sigma+ K0
+resonant processes involving more than a single pion
+63 NUANCE -> NEUT -45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
+NC, numubar p --> numubar Sigma0 K+
+resonant processes involving more than a single pion
+64 NUANCE -> NEUT -44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
+NC, numubar p --> numubar Sigma+ K0
+resonant processes involving more than a single pion
+65 NUANCE -> NEUT -44 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}
+NC, numubar n --> numubar Sigma0 K0
+resonant processes involving more than a single pion
+66 NUANCE -> NEUT -45 NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}
+NC, numubar n --> numubar Sigma- K+
+resonant processes involving more than a single pion
+
+67  NUANCE -> NEUT 22
+ModeStack[22]->SetTitle("CC1#eta^{0} on n");
+CC, numu n --> mu- p eta
+resonant processes involving more than a single pion
+68 NUANCE -> NEUT 43
+NC, numu p --> numu p eta
+resonant processes involving more than a single pion
+69 NUANCE -> NEUT 42
+NC, numu n --> numu n eta
+resonant processes involving more than a single pion
+70 NUANCE -> NEUT -22
+ModeStack[22]->SetTitle("CC1#eta^{0} on n");
+CC, numubar n --> mu- p eta
+resonant processes involving more than a single pion
+71 NUANCE -> NEUT -43
+ModeStack[43]->SetTitle("NC1#eta^{0} on p");
+NC, numubar p --> numubar p eta
+resonant processes involving more than a single pion
+72 NUANCE -> NEUT -42
+ModeStack[42]->SetTitle("NC1#eta^{0} on n");
+NC, numubar n --> numubar n eta
+resonant processes involving more than a single pion
+
+73 NUANCE -> NEUT 21
+ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+CC, numu n --> mu- K+ Lambda
+resonant processes involving more than a single pion
+74 NUANCE -> NEUT 41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numu p --> numu K+ Lambda
+resonant processes involving more than a single pion
+75 NUANCE -> NEUT 41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numu n --> numu K0 Lambda
+resonant processes involving more than a single pion
+76 NUANCE -> NEUT -21
+ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+CC, numubar n --> mu- K+ Lambda
+resonant processes involving more than a single pion
+77 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar p --> numubar K+ Lambda
+resonant processes involving more than a single pion
+78 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar n --> numubar K0 Lambda
+resonant processes involving more than a single pion
+
+CC Multipi  ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC Multipi  ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+79  NUANCE -> NEUT 21
+CC, numu n --> mu- p pi+ pi-
+two pion production
+80 NUANCE -> NEUT 21
+CC, numu n --> mu- p pi0 pi0
+two pion production
+81 NUANCE -> NEUT 41
+NC, numu p --> numu p pi+ pi-
+two pion production
+82 NUANCE -> NEUT 41
+NC, numu p --> numu p pi0 pi0
+two pion production
+83 NUANCE -> NEUT 41
+NC, numu n --> numu n pi+ pi-
+two pion production
+84 NUANCE -> NEUT 41
+NC, numu n --> numu n pi0 pi0
+two pion production
+85 NUANCE -> NEUT -21
+CC, numubar n --> mu- p pi+ pi-
+two pion production
+86 NUANCE -> NEUT -21
+CC, numubar n --> mu- p pi0 pi0
+two pion production
+87 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar p --> numubar p pi+ pi-
+two pion production
+88 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar p --> numubar p pi0 pi0
+two pion production
+89 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar n --> numubar n pi+ pi-
+two pion production
+90 NUANCE -> NEUT -41
+ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
+NC, numubar n --> numubar n pi0 pi0
+two pion production
+
+
+91 NUANCE -> NEUT 26
+ModeStack[26]->SetTitle("DIS (W > 2.0)");
+CC, numu N --> mu- X (where N=n,p)
+deep inelastic scattering (nu or nubar)
+92 NUANCE -> NEUT 46
+ModeStack[46]->SetTitle("DIS (W > 2.0)");
+NC, numu N --> numu X (where N=n,p)
+deep inelastic scattering (nu or nubar)
+
+93 NUANCE -> NEUT 17 1#gamma from #Delta: #nu_{l} n #rightarrow l^{-} p #gamma
+CC, numu n --> mu- p gamma
+Delta radiative decay, Delta --> N gamma (only in NUANCE versions v3 and and higher)
+94 NUANCE -> NEUT 39 1#gamma from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma
+neutModeID[15] = 38;  neutModeName[15] = "ncngam"; neutModeTitle[15] = "1#gamma from #Delta: #nu_{l} n #rightarrow #nu_{l} n #gamma";
+neutModeID[16] = 39;  neutModeName[16] = "ncpgam"; neutModeTitle[16] = "1#gamma from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma";
+NC, numu N --> numu N gamma
+Delta radiative decay, Delta --> N gamma (only in NUANCE versions v3 and and higher)
+
+95 -> UNKOWN NEUT MODE
+CC, numubar p --> mu+ Lambda, numubar n -- > mu+ Sigma-, numubar p --> mu+ Sigma0
+Cabibbo-suppressed QE hyperon production from nucleons
+
+96 NUANCE -> NEUT 36
+neutModeID[14] = 36;  neutModeName[14] = "nccoh";  neutModeTitle[14] = "NC coherent-#pi: #nu_{l} ^{16}O #rightarrow #nu_{l} ^{16}O #pi^{0}";
+NC, numu A --> numu pi0 A
+coherent or diffractive pi0 production
+97 NUANCE -> NEUT 16
+neutModeID[4] = 16;   neutModeName[4] = "cccoh";   neutModeTitle[4] = "CC coherent-#pi: #nu_{l} ^{16}O #rightarrow l^{-} ^{16}O #pi^{+}";
+CC, numu A --> mu- pi+ A (or numubar A -->
+coherent or diffractive pi0 production
+
+98 -> UNKNOWN NEUT MODE
+NC, numu e- --> numu e- (or numubar e- -->
+neutrino + electron elastic scattering
+99 -> UNKNOWN NEUT MODE
+CC, numu e- --> mu- nue
+neutrino + electron inverse muon decay
+
+NEUT Modes:
+// CC Modes
+ neutModeID[0] = 1;    neutModeName[0] = "ccqe";    neutModeTitle[0] = "CCQE: #nu_{l} n #rightarrow l^{-} p";
+ neutModeID[1] = 11;   neutModeName[1] = "ccppip";  neutModeTitle[1] = "CC 1#pi: #nu_{l} p #rightarrow l^{-} p #pi^{+}";
+ neutModeID[2] = 12;   neutModeName[2] = "ccppi0";  neutModeTitle[2] = "CC 1#pi: #nu_{l} n #rightarrow l^{-} p #pi^{0}";
+ neutModeID[3] = 13;   neutModeName[3] = "ccnpip";  neutModeTitle[3] = "CC 1#pi: #nu_{l} n #rightarrow l^{-} n #pi^{+}";
+ neutModeID[4] = 16;   neutModeName[4] = "cccoh";   neutModeTitle[4] = "CC coherent-#pi: #nu_{l} ^{16}O #rightarrow l^{-} ^{16}O #pi^{+}";
+ neutModeID[5] = 17;   neutModeName[5] = "ccgam";   neutModeTitle[5] = "1#gamma from #Delta: #nu_{l} n #rightarrow l^{-} p #gamma";
+ neutModeID[6] = 21;   neutModeName[6] = "ccmpi";   neutModeTitle[6] = "CC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow l^{-} N' multi-#pi";
+ neutModeID[7] = 22;   neutModeName[7] = "cceta";   neutModeTitle[7] = "CC 1#eta: #nu_{l} n #rightarrow l^{-} p #eta";
+ neutModeID[8] = 23;   neutModeName[8] = "cck";     neutModeTitle[8] = "CC 1K: #nu_{l} n #rightarrow l^{-} #Lambda K^{+}";
+ neutModeID[9] = 26;   neutModeName[9] = "ccdis";   neutModeTitle[9] = "CC DIS (2 GeV < W): #nu_{l} N #rightarrow l^{-} N' mesons";
+
+neutModeID[10] = 31;  neutModeName[10] = "ncnpi0"; neutModeTitle[10] = "NC 1#pi: #nu_{l} n #rightarrow #nu_{l} n #pi^{0}";
+neutModeID[11] = 32;  neutModeName[11] = "ncppi0"; neutModeTitle[11] = "NC 1#pi: #nu_{l} p #rightarrow #nu_{l} p #pi^{0}";
+neutModeID[12] = 33;  neutModeName[12] = "ncppim"; neutModeTitle[12] = "NC 1#pi: #nu_{l} n #rightarrow #nu_{l} p #pi^{-}";
+neutModeID[13] = 34;  neutModeName[13] = "ncnpip"; neutModeTitle[13] = "NC 1#pi: #nu_{l} p #rightarrow #nu_{l} n #pi^{+}";
+
+neutModeID[14] = 36;  neutModeName[14] = "nccoh";  neutModeTitle[14] = "NC coherent-#pi: #nu_{l} ^{16}O #rightarrow #nu_{l} ^{16}O #pi^{0}";
+neutModeID[15] = 38;  neutModeName[15] = "ncngam"; neutModeTitle[15] = "1#gamma from #Delta: #nu_{l} n #rightarrow #nu_{l} n #gamma";
+neutModeID[16] = 39;  neutModeName[16] = "ncpgam"; neutModeTitle[16] = "1#gamma from #Delta: #nu_{l} p #rightarrow #nu_{l} p #gamma";
+
+neutModeID[17] = 41;  neutModeName[17] = "ncmpi";  neutModeTitle[17] = "NC (1.3 < W < 2 GeV): #nu_{l} N #rightarrow #nu_{l} N multi-#pi";
+
+neutModeID[18] = 42;  neutModeName[18] = "ncneta"; neutModeTitle[18] = "NC 1#eta: #nu_{l} n #rightarrow #nu_{l} n #eta";
+neutModeID[19] = 43;  neutModeName[19] = "ncpeta"; neutModeTitle[19] = "NC 1#eta: #nu_{l} p #rightarrow #nu_{l} p #eta";
+
+neutModeID[20] = 44;  neutModeName[20] = "nck0";   neutModeTitle[20] = "NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{0}";
+neutModeID[21] = 45;  neutModeName[21] = "nckp";   neutModeTitle[21] = "NC 1K: #nu_{l} n #rightarrow #nu_{l} #Lambda K^{+}";
+
+neutModeID[22] = 46;  neutModeName[22] = "ncdis";  neutModeTitle[22] = "NC DIS (2 GeV < W): #nu_{l} N #rightarrow #nu_{l} N' mesons";
+
+neutModeID[23] = 51;  neutModeName[23] = "ncqep";  neutModeTitle[23] = "NC elastic: #nu_{l} p #rightarrow #nu_{l} p";
+neutModeID[24] = 52;  neutModeName[24] = "ncqen";  neutModeTitle[24] = "NC elastic: #nu_{l} n #rightarrow #nu_{l} n";
+*/
+
+#endif
+
diff --git a/src/InputHandler/NUANCEInputHandler.h b/src/InputHandler/NUANCEInputHandler.h
new file mode 100644
index 0000000..a6c1b4c
--- /dev/null
+++ b/src/InputHandler/NUANCEInputHandler.h
@@ -0,0 +1,92 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#ifndef NUANCEINPUTHANDLER_H
+#define NUANCEINPUTHANDLER_H
+#ifdef __NUANCE_ENABLED__
+/*!
+ *  \addtogroup InputHandler
+ *  @{
+ */
+#include "InputHandler.h"
+#include "PlotUtils.h"
+
+/// NUANCE Generator Container to save extra particle status codes.
+class NUANCEGeneratorInfo : public GeneratorInfoBase {
+public:
+	NUANCEGeneratorInfo() {};
+	virtual ~NUANCEGeneratorInfo();
+
+	/// Assigns information to branches
+	void AddBranchesToTree(TTree* tn);
+
+	/// Setup reading information from branches
+	void SetBranchesFromTree(TTree* tn);
+
+	/// Allocate any dynamic arrays for a new particle stack size
+	void AllocateParticleStack(int stacksize);
+
+	/// Clear any dynamic arrays
+	void DeallocateParticleStack();
+
+	/// Read extra NUANCE information from the event
+	void FillGeneratorInfo(NuanceEvent* nevent);
+
+	/// Reset extra information to default/empty values
+	void Reset();
+
+	// int  kMaxParticles; ///< Number of particles in stack
+	// int* fNEUTParticleStatusCode; ///<NEUT Particle Status Flags
+	// int* fNEUTParticleAliveCode; ///< NEUT Alive Code (0 dead, 1 final state)
+	// int fNEUTParticleN; ///< Number of particles
+};
+
+/// Handler to read NUANCE TTrees directly into NUISANCE Format
+class NUANCEInputHandler : public InputHandlerBase {
+public:
+
+	/// Standard  constructor given name and input file list
+	NUANCEInputHandler(std::string const& handle, std::string const& rawinputs);
+	~NUANCEInputHandler();
+
+	/// Returns NUISANCE format event by reading fNUANCETree
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight = false);
+
+	/// Converts events from the current TTree entry into NUISANCE event.
+	void CalcNUISANCEKinematics();
+
+	/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+
+	/// Print event information
+	void Print();
+
+	/// Converts Nuance Interaction Mode to NUISANCE codes
+	int ConvertNuanceMode(NuanceEvent * evt);
+
+	bool fSaveExtra; ///< Save Extra NUANCE information in to fNuanceInfo
+	NUANCEGeneratorInfo fNuanceInfo; ///< Generator Info Saver
+	NuanceEvent* fNuanceEvent; ///< NUANCE Reader
+	TChain* fNUANCETree;       ///< Pointer to TTree in file
+};
+#endif
+/*! @} */
+#endif
diff --git a/src/InputHandler/NuWroInputHandler.cxx b/src/InputHandler/NuWroInputHandler.cxx
new file mode 100644
index 0000000..e0625e8
--- /dev/null
+++ b/src/InputHandler/NuWroInputHandler.cxx
@@ -0,0 +1,465 @@
+#ifdef __NUWRO_ENABLED__
+#include "NuWroInputHandler.h"
+
+NuWroGeneratorInfo::~NuWroGeneratorInfo(){
+	delete fNuWroParticlePDGs;
+}
+
+void NuWroGeneratorInfo::AddBranchesToTree(TTree* tn) {
+	tn->Branch("NuWroParticlePDGs", &fNuWroParticlePDGs, "NuWroParticlePDGs/I");
+}
+
+void NuWroGeneratorInfo::SetBranchesFromTree(TTree* tn) {
+	tn->SetBranchAddress("NuWroParticlePDGs", &fNuWroParticlePDGs);
+}
+
+void NuWroGeneratorInfo::AllocateParticleStack(int stacksize) {
+	fNuWroParticlePDGs = new int[stacksize];
+}
+
+void NuWroGeneratorInfo::DeallocateParticleStack() {
+	delete fNuWroParticlePDGs;
+}
+
+void NuWroGeneratorInfo::FillGeneratorInfo(event* e) {
+	Reset();
+}
+
+void NuWroGeneratorInfo::Reset() {
+	for (int i = 0; i < kMaxParticles; i++) {
+		fNuWroParticlePDGs[i] = 0;
+	}
+}
+
+NuWroInputHandler::NuWroInputHandler(std::string const& handle, std::string const& rawinputs) {
+	LOG(SAM) << "Creating NuWroInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+	fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+	fSaveExtra =  false; //FitPar::Config().GetParB("NuWroSaveExtra");
+	// Setup the TChain
+	fNuWroTree = new TChain("treeout");
+
+	// Loop over all inputs and grab flux, eventhist, and nevents
+	std::vector<std::string> inputs = InputUtils::ParseInputFileList(rawinputs);
+	for (size_t inp_it = 0; inp_it < inputs.size(); ++inp_it) {
+
+		// Open File for histogram access
+		TFile* inp_file = new TFile(inputs[inp_it].c_str(), "READ");
+		if (!inp_file or inp_file->IsZombie()) {
+			ERR(FTL) << "nuwro File IsZombie() at " << inputs[inp_it] << std::endl;
+			throw;
+		}
+
+		// Get Flux/Event hist
+		TH1D* fluxhist  = (TH1D*)inp_file->Get(
+		                      (PlotUtils::GetObjectWithName(inp_file, "FluxHist")).c_str());
+		TH1D* eventhist = (TH1D*)inp_file->Get(
+		                      (PlotUtils::GetObjectWithName(inp_file, "EvtHist")).c_str());
+		if (!fluxhist or !eventhist) {
+			ERR(FTL) << "nuwro FILE doesn't contain flux/xsec info" << std::endl;
+			if (FitPar::Config().GetParB("regennuwro")) {
+				ERR(FTL) << "Regen NuWro has not been added yet. Email the developers!" << std::endl;
+				         // ProcessNuWroInputFlux(inputs[inp_it]);
+				throw;
+			} else {
+				ERR(FTL) << "If you would like NUISANCE to generate these for you "
+				         << "please set parameter regennuwro=1 and re-run." << std::endl;
+				throw;
+			}
+		}
+
+		// Get N Events
+		TTree* nuwrotree = (TTree*)inp_file->Get("treeout");
+		if (!nuwrotree) {
+			ERR(FTL) << "treeout not located in nuwro file! " << inputs[inp_it] << std::endl;
+			throw;
+		}
+		int nevents = nuwrotree->GetEntries();
+
+		// Register input to form flux/event rate hists
+		RegisterJointInput(inputs[inp_it], nevents, fluxhist, eventhist);
+
+		// Add to TChain
+		fNuWroTree->Add( inputs[inp_it].c_str() );
+	}
+
+	// Registor all our file inputs
+	SetupJointInputs();
+
+	// Setup Events
+	fNuWroEvent = NULL;
+	fNuWroTree->SetBranchAddress("e", &fNuWroEvent);
+
+	fNUISANCEEvent = new FitEvent();
+	fNUISANCEEvent->SetNuwroEvent(fNuWroEvent);
+	fNUISANCEEvent->HardReset();
+
+	if (fSaveExtra) {
+		fNuWroInfo = new NuWroGeneratorInfo();
+		fNUISANCEEvent->AddGeneratorInfo(fNuWroInfo);
+	}
+
+};
+
+NuWroInputHandler::~NuWroInputHandler(){
+	if (fNuWroTree) delete fNuWroTree;
+}
+
+void NuWroInputHandler::CreateCache() {
+	// fNuWroTree->SetCacheEntryRange(0, fNEvents);
+	fNuWroTree->AddBranchToCache("*", 1);
+	fNuWroTree->SetCacheSize(fCacheSize);
+}
+
+void NuWroInputHandler::RemoveCache() {
+	// fNuWroTree->SetCacheEntryRange(0, fNEvents);
+	fNuWroTree->AddBranchToCache("*", 0);
+	fNuWroTree->SetCacheSize(0);
+}
+
+void NuWroInputHandler::ProcessNuWroInputFlux(const std::string file) {
+}
+
+FitEvent* NuWroInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+	// Catch too large entries
+	if (entry >= (UInt_t)fNEvents) return NULL;
+
+	// Read Entry from TTree to fill NEUT Vect in BaseFitEvt;
+	fNuWroTree->GetEntry(entry);
+
+	// Setup Input scaling for joint inputs
+	fNUISANCEEvent->InputWeight = GetInputWeight(entry);
+
+	// Run NUISANCE Vector Filler
+	if (!lightweight) {
+		CalcNUISANCEKinematics();
+	}
+	
+	return fNUISANCEEvent;
+}
+
+int NuWroInputHandler::ConvertNuwroMode (event * e) {
+
+	Int_t proton_pdg, neutron_pdg, pion_pdg, pion_plus_pdg, pion_minus_pdg,
+	      lambda_pdg, eta_pdg, kaon_pdg, kaon_plus_pdg;
+	proton_pdg = 2212;
+	eta_pdg = 221;
+	neutron_pdg = 2112;
+	pion_pdg = 111;
+	pion_plus_pdg = 211;
+	pion_minus_pdg = -211;
+	//O_16_pdg = 100069;   // oznacznie z Neuta
+	lambda_pdg = 3122;
+	kaon_pdg = 311;
+	kaon_plus_pdg = 321;
+
+
+	if (e->flag.qel)		// kwiazielastyczne oddziaływanie
+	{
+		if (e->flag.anty)		// jeśli jest to oddziaływanie z antyneutrinem
+		{
+			if (e->flag.cc)
+				return -1;
+			else
+			{
+				if (e->nof (proton_pdg))
+					return -51;
+				else if (e->nof (neutron_pdg))
+					return -52;	// sprawdzam dodatkowo ?
+			}
+		}
+		else			// oddziaływanie z neutrinem
+		{
+			if (e->flag.cc)
+				return 1;
+			else
+			{
+				if (e->nof (proton_pdg))
+					return 51;
+				else if (e->nof (neutron_pdg))
+					return 52;
+			}
+		}
+	}
+
+	if (e->flag.mec) {
+		if (e->flag.anty) return -2;
+		else return 2;
+	}
+
+
+	if (e->flag.res)		//rezonansowa produkcja: pojedynczy pion, pojed.eta, kaon, multipiony
+	{
+		Int_t liczba_pionow, liczba_kaonow;
+
+		liczba_pionow =
+		    e->nof (pion_pdg) + e->nof (pion_plus_pdg) + e->nof (pion_minus_pdg);
+		liczba_kaonow = e->nof (kaon_pdg) + e->nof (kaon_pdg);
+
+		if (liczba_pionow > 1 || liczba_pionow == 0)	// multipiony
+		{
+			if (e->flag.anty)
+			{
+				if (e->flag.cc)
+					return -21;
+				else
+					return -41;
+			}
+			else
+			{
+				if (e->flag.cc)
+					return 21;
+				else
+					return 41;
+			}
+		}
+
+		if (liczba_pionow == 1)
+		{
+			if (e->flag.anty)	// jeśli jest to oddziaływanie z antyneutrinem
+			{
+				if (e->flag.cc)
+				{
+					if (e->nof (neutron_pdg) && e->nof (pion_minus_pdg))
+						return -11;
+					if (e->nof (neutron_pdg) && e->nof (pion_pdg))
+						return -12;
+					if (e->nof (proton_pdg) && e->nof (pion_minus_pdg))
+						return -13;
+				}
+				else
+				{
+					if (e->nof (proton_pdg))
+					{
+						if (e->nof (pion_minus_pdg))
+							return -33;
+						else if (e->nof (pion_pdg))
+							return -32;
+					}
+					else if (e->nof (neutron_pdg))
+					{
+						if (e->nof (pion_plus_pdg))
+							return -34;
+						else if (e->nof (pion_pdg))
+							return -31;
+					}
+				}
+			}
+			else			// oddziaływanie z neutrinem
+			{
+				if (e->flag.cc)
+				{
+					if (e->nof (proton_pdg) && e->nof (pion_plus_pdg))
+						return 11;
+					if (e->nof (proton_pdg) && e->nof (pion_pdg))
+						return 12;
+					if (e->nof (neutron_pdg) && e->nof (pion_plus_pdg))
+						return 13;
+				}
+				else
+				{
+					if (e->nof (proton_pdg))
+					{
+						if (e->nof (pion_minus_pdg))
+							return 33;
+						else if (e->nof (pion_pdg))
+							return 32;
+					}
+					else if (e->nof (neutron_pdg))
+					{
+						if (e->nof (pion_plus_pdg))
+							return 34;
+						else if (e->nof (pion_pdg))
+							return 31;
+					}
+				}
+			}
+		}
+
+		if (e->nof (eta_pdg))	// produkcja rezonansowa ety
+		{
+			if (e->flag.anty)	// jeśli jest to oddziaływanie z antyneutrinem
+			{
+				if (e->flag.cc)
+					return -22;
+				else
+				{
+					if (e->nof (neutron_pdg))
+						return -42;
+					else if (e->nof (proton_pdg))
+						return -43;	// sprawdzam dodatkowo ?
+				}
+			}
+			else			// oddziaływanie z neutrinem
+			{
+				if (e->flag.cc)
+					return 22;
+				else
+				{
+					if (e->nof (neutron_pdg))
+						return 42;
+					else if (e->nof (proton_pdg))
+						return 43;
+				}
+			}
+		}
+
+		if (e->nof (lambda_pdg) == 1 && liczba_kaonow == 1)	// produkcja rezonansowa kaonu
+		{
+			if (e->flag.anty)	// jeśli jest to oddziaływanie z antyneutrinem
+			{
+				if (e->flag.cc && e->nof (kaon_pdg))
+					return -23;
+				else
+				{
+					if (e->nof (kaon_pdg))
+						return -44;
+					else if (e->nof (kaon_plus_pdg))
+						return -45;
+				}
+			}
+			else			// oddziaływanie z neutrinem
+			{
+				if (e->flag.cc && e->nof (kaon_plus_pdg))
+					return 23;
+				else
+				{
+					if (e->nof (kaon_pdg))
+						return 44;
+					else if (e->nof (kaon_plus_pdg))
+						return 45;
+				}
+			}
+
+
+		}
+
+	}
+
+	if (e->flag.coh)		// koherentne  oddziaływanie tylko na O(16)
+	{
+		Int_t _target;
+		_target = e->par.nucleus_p + e->par.nucleus_n;	// liczba masowa  O(16)
+
+		if (_target == 16)
+		{
+			if (e->flag.anty)	// jeśli jest to oddziaływanie z antyneutrinem
+			{
+				if (e->flag.cc && e->nof (pion_minus_pdg))
+					return -16;
+				else if (e->nof (pion_pdg))
+					return -36;
+			}
+			else			// oddziaływanie z neutrinem
+			{
+				if (e->flag.cc && e->nof (pion_plus_pdg))
+					return 16;
+				else if (e->nof (pion_pdg))
+					return 36;
+			}
+		}
+	}
+
+	// gleboko nieelastyczne rozpraszanie
+	if (e->flag.dis)
+	{
+		if (e->flag.anty)
+		{
+			if (e->flag.cc)
+				return -26;
+			else
+				return -46;
+		}
+		else
+		{
+			if (e->flag.cc)
+				return 26;
+			else
+				return 46;
+		}
+	}
+
+	return 9999;
+}
+
+void NuWroInputHandler::CalcNUISANCEKinematics() {
+	// std::cout << "NuWro Event Address " << fNuWroEvent << std::endl;
+	// Reset all variables
+	fNUISANCEEvent->ResetEvent();
+	FitEvent* evt = fNUISANCEEvent;
+
+	// Sort Event Info
+	evt->fMode = ConvertNuwroMode(fNuWroEvent);
+	if (abs(evt->fMode) > 60) evt->fMode = 0;
+
+	evt->Mode = evt->fMode;
+	evt->fEventNo = 0.0;
+	evt->fTotCrs = 0.0;
+	evt->fTargetA = fNuWroEvent->par.nucleus_p + fNuWroEvent->par.nucleus_n;
+	evt->fTargetZ = fNuWroEvent->par.nucleus_p;
+	evt->fTargetH = 0;
+	evt->fBound = (evt->fTargetA) == 1;
+
+	// Check Particle Stack
+	UInt_t npart_in = fNuWroEvent->in.size();
+	UInt_t npart_out = fNuWroEvent->out.size();
+	UInt_t npart_post = fNuWroEvent->post.size();
+	UInt_t npart = npart_in + npart_out + npart_post;
+	UInt_t kmax = evt->kMaxParticles;
+
+	if (npart > kmax) {
+		ERR(WRN) << "NUWRO has too many particles. Expanding stack." << std::endl;
+	    fNUISANCEEvent->ExpandParticleStack(npart);
+	}
+
+	// Sort Particles
+	evt->fNParticles = 0;
+	std::vector<particle>::iterator p_iter;
+
+	// Initial State
+	for (p_iter = fNuWroEvent->in.begin(); p_iter != fNuWroEvent->in.end(); p_iter++) {
+		AddNuWroParticle(fNUISANCEEvent, (*p_iter), kInitialState);
+	}
+
+	// FSI State
+	for (size_t i = 0; i < npart_in; i++ ) {
+		AddNuWroParticle(fNUISANCEEvent, (*p_iter), kFSIState);
+	}
+
+	// Final State
+	for (p_iter = fNuWroEvent->post.begin(); p_iter != fNuWroEvent->post.end(); p_iter++) {
+		AddNuWroParticle(fNUISANCEEvent, (*p_iter), kFinalState);
+	}
+
+	// Fill Generator Info
+	if (fSaveExtra) fNuWroInfo->FillGeneratorInfo(fNuWroEvent);
+
+	// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent->OrderStack();
+	return;
+}
+
+void NuWroInputHandler::AddNuWroParticle(FitEvent * evt, const particle & p, int state) {
+
+	// Add Mom
+	evt->fParticleMom[evt->fNParticles][0] = p.p4().x;
+	evt->fParticleMom[evt->fNParticles][1] = p.p4().y;
+	evt->fParticleMom[evt->fNParticles][2] = p.p4().z;
+	evt->fParticleMom[evt->fNParticles][3] = p.p4().t;
+
+	// Status/PDG
+	evt->fParticleState[evt->fNParticles] = state;
+	evt->fParticlePDG[evt->fNParticles] = p.pdg;
+
+	// Add to particle count
+	evt->fNParticles++;
+}
+
+void NuWroInputHandler::Print(){
+}
+
+#endif
+
diff --git a/src/InputHandler/NuWroInputHandler.h b/src/InputHandler/NuWroInputHandler.h
new file mode 100644
index 0000000..4b498ed
--- /dev/null
+++ b/src/InputHandler/NuWroInputHandler.h
@@ -0,0 +1,78 @@
+#ifndef NuWroINPUTHANDLER_H
+#define NuWroINPUTHANDLER_H
+#ifdef __NUWRO_ENABLED__
+#include "GeneratorUtils.h"
+#include "InputHandler.h"
+#include "PlotUtils.h"
+
+/// NuWro Generator Container to save extra particle status codes.
+class NuWroGeneratorInfo : public GeneratorInfoBase {
+public:
+	NuWroGeneratorInfo() {};
+	virtual ~NuWroGeneratorInfo();
+
+	/// Assigns information to branches
+	void AddBranchesToTree(TTree* tn);
+
+	/// Setup reading information from branches
+	void SetBranchesFromTree(TTree* tn);
+
+	/// Allocate any dynamic arrays for a new particle stack size
+	void AllocateParticleStack(int stacksize);
+
+	/// Clear any dynamic arrays
+	void DeallocateParticleStack();
+
+	/// Read extra genie information from the event
+	void FillGeneratorInfo(event* e);
+
+	/// Reset extra information to default/empty values
+	void Reset();
+
+	int  kMaxParticles; ///< Number of particles in stack
+	int* fNuWroParticlePDGs; ///< NuWro Particle PDGs (example)
+};
+
+/// Main NuWro Input Reader. Requires events have flux and xsec TH1Ds saved into them.
+class NuWroInputHandler : public InputHandlerBase {
+public:
+
+	/// Constructor. Can handle single and joint inputs.
+	NuWroInputHandler(std::string const& handle, std::string const& rawinputs);
+	~NuWroInputHandler();
+
+	/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+
+	/// Returns filled NUISANCEEvent for given entry.
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight = false);
+
+	/// Fills fNUISANCEEvent from fNuWroEvent
+	void CalcNUISANCEKinematics();
+
+	/// (LEGACY) Automatically creates nuwro flux/event histograms that
+	/// nuisance needs to normalise events.
+	void ProcessNuWroInputFlux(const std::string file);
+
+	/// Calculates a True Interaction code for NuWro events
+	int ConvertNuwroMode (event * e);
+
+	/// Adds a new particle to NUISANCE stack for given NuWro particle
+	void AddNuWroParticle(FitEvent* evt, const particle& p, int state);
+
+	event* fNuWroEvent;  ///< Pointer to NuWro Format Events
+
+	/// Print Event Information
+	void Print();
+
+	TChain* fNuWroTree; ///< TTree for reading NuWro event vectors
+	bool fSaveExtra;    ///< Save Extra NuWro info into Nuisance Event
+	NuWroGeneratorInfo *fNuWroInfo; ///< Extra NuWro Generator Info
+
+};
+/*! @} */
+#endif
+#endif
diff --git a/src/InputHandler/NuanceEvent.cxx b/src/InputHandler/NuanceEvent.cxx
new file mode 100644
index 0000000..dd9118c
--- /dev/null
+++ b/src/InputHandler/NuanceEvent.cxx
@@ -0,0 +1,59 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+/*!
+ *  \addtogroup FitBase
+ *  @{
+ */
+#ifdef __NUANCE_ENABLED__
+#include "NuanceEvent.h"
+
+void NuanceEvent::SetBranchAddresses(TTree* tn) {
+
+	tn->SetBranchAddress("neutrino", &neutrino);
+	tn->SetBranchAddress("target", &target);
+	tn->SetBranchAddress("channel", &channel);
+	tn->SetBranchAddress("iniQ", &iniQ);
+	tn->SetBranchAddress("finQ", &finQ);
+	tn->SetBranchAddress("lepton0", &lepton0);
+	tn->SetBranchAddress("polar", &polar);
+	tn->SetBranchAddress("qsq", &qsq);
+
+	tn->SetBranchAddress("w", &w);
+	tn->SetBranchAddress("x", &x);
+	tn->SetBranchAddress("y", &y);
+
+	tn->SetBranchAddress("p_neutrino", p_neutrino);
+	tn->SetBranchAddress("p_targ", p_targ);
+	tn->SetBranchAddress("vertex", vertex);
+	tn->SetBranchAddress("start", start);
+	tn->SetBranchAddress("depth", &depth);
+	tn->SetBranchAddress("flux", &flux);
+
+	tn->SetBranchAddress("n_leptons", &n_leptons);
+	tn->SetBranchAddress("p_ltot", p_ltot);
+	tn->SetBranchAddress("lepton", lepton);
+	tn->SetBranchAddress("p_lepton", p_lepton);
+
+	tn->SetBranchAddress("n_hadrons", &n_hadrons);
+	tn->SetBranchAddress("p_htot", p_htot);
+	tn->SetBranchAddress("hadron", hadron);
+	tn->SetBranchAddress("p_hadron", p_hadron);
+
+}
+#endif
diff --git a/src/FitBase/NuanceEvent.h b/src/InputHandler/NuanceEvent.h
similarity index 54%
rename from src/FitBase/NuanceEvent.h
rename to src/InputHandler/NuanceEvent.h
index 18bd6dd..09c620e 100644
--- a/src/FitBase/NuanceEvent.h
+++ b/src/InputHandler/NuanceEvent.h
@@ -1,65 +1,74 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef NUANCE_H_SEEN
 #define NUANCE_H_SEEN
-
-#ifdef __NUANCE_ENABLED__
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
+#ifdef __NUANCE_ENABLED__
+#include "TTree.h"
+
+/// TTree Reader for Nuance TTree Events
 class NuanceEvent {
  public:
 
-  bool cc;
-  bool bound;
-  int neutrino;
-  int target;
+  /// Empty constructor
+  NuanceEvent(){};
+
+  /// Reads values from the tTree
+  void SetBranchAddresses(TTree* tn);
+
+  bool cc;       ///< Is Charged Current
+  bool bound;    ///< On Bound Target
+  int neutrino;  ///< Neutrino PDG
+  int target;    ///< Target PDG
   float iniQ;
   float finQ;
-  int lepton0;
+  int lepton0;  
   float polar;
   int channel;
   float qsq;
   float w;
-  float x;
-  float y;
+  float x;       ///< Event Bjorken x
+  float y;       ///< Event Bjorken y
 
-  float p_neutrino[4];
-  float p_targ[5];
-  float vertex[4];
-  float start[4];
+  float p_neutrino[4]; ///< Neutrino 4-Mom
+  float p_targ[5];     ///< Target 5-mom
+  float vertex[4];     ///< Vertex Position
+  float start[4];      ///< Start Position 
   float depth;
   float flux;
 
-  int n_leptons;
-  
-  float p_ltot[5];
-  int lepton[200];
-  float p_lepton[5][200];
+  int n_leptons;       ///< Number of final state leptons
+  float p_ltot[5];     ///< Total 5-momentum of leptonic side
+  int lepton[200];     ///< Lepton PDGs
+  float p_lepton[5][200]; ///< Lepton 5-momentum
   
-  int n_hadrons;
-  float p_htot[5];
-  int hadron[200];
-  float p_hadron[5][200];
+  int n_hadrons;       ///< Number of final state hadrons
+  float p_htot[5];     ///< Total 5-momentum of hadronic side
+  int hadron[200];     ///< Hadron PDGs
+  float p_hadron[5][200]; ///< Hadron 5-momentum
 };
 #endif
+/*! @} */
 #endif
+
+
diff --git a/src/InputHandler/SplineInputHandler.cxx b/src/InputHandler/SplineInputHandler.cxx
new file mode 100644
index 0000000..9209f19
--- /dev/null
+++ b/src/InputHandler/SplineInputHandler.cxx
@@ -0,0 +1,133 @@
+#include "SplineInputHandler.h"
+
+SplineInputHandler::SplineInputHandler(std::string const& handle, std::string const& rawinputs) {
+	LOG(SAM) << "Creating SplineInputHandler : " << handle << std::endl;
+
+	// Run a joint input handling
+	fName = handle;
+	fCacheSize = FitPar::Config().GetParI("CacheSize");
+	fMaxEvents = FitPar::Config().GetParI("MAXEVENTS");
+
+	// Setup the TChain
+	fFitEventTree = new TChain("nuisance_events");
+
+	// Open File for histogram access
+	TFile* inp_file = new TFile(rawinputs.c_str(), "READ");
+	if (!inp_file or inp_file->IsZombie()) {
+		ERR(FTL) << "FitEvent File IsZombie() at " << rawinputs << std::endl;
+		throw;
+	}
+
+	// Get Flux/Event hist
+	TH1D* fluxhist  = (TH1D*)inp_file->Get("nuisance_fluxhist");
+	TH1D* eventhist = (TH1D*)inp_file->Get("nuisance_eventhist");
+	if (!fluxhist or !eventhist) {
+		ERR(FTL) << "FitEvent FILE doesn't contain flux/xsec info" << std::endl;
+		throw;
+	}
+
+	// Get N Events
+	TTree* eventtree = (TTree*)inp_file->Get("nuisance_events");
+	if (!eventtree) {
+		ERR(FTL) << "nuisance_events not located in FitSpline file! " << rawinputs << std::endl;
+		throw;
+	}
+	int nevents = eventtree->GetEntries();
+
+	// Register input to form flux/event rate hists
+	RegisterJointInput(rawinputs, nevents, fluxhist, eventhist);
+	SetupJointInputs();
+
+	// Add to TChain
+	fFitEventTree->Add( rawinputs.c_str() );
+
+	// Setup NEvents and the FitEvent
+	fNEvents = fFitEventTree->GetEntries();
+	fEventType = kSPLINEPARAMETER;
+	fNUISANCEEvent = new FitEvent();
+	fNUISANCEEvent->SetBranchAddress(fFitEventTree);
+
+	// Setup Spline Reader
+	LOG(SAM) << "Loading Spline Reader." << std::endl;
+
+	fSplRead = new SplineReader();
+	fSplRead->Read( (TTree*)inp_file->Get("spline_reader") );
+	fNUISANCEEvent->fSplineRead = this->fSplRead;
+
+	// Setup Matching Spline TTree
+	fSplTree = (TTree*)inp_file->Get("spline_tree");
+	fSplTree->SetBranchAddress( "SplineCoeff", fSplineCoeff );
+	fNUISANCEEvent->fSplineCoeff = this->fSplineCoeff;
+
+	// Load into memory
+	for (int j = 0; j < fNEvents; j++) {
+		std::vector<float> tempval;
+		fFitEventTree->GetEntry(j);
+		fStartingWeights.push_back( GetInputWeight(j) );
+	}
+
+};
+
+SplineInputHandler::~SplineInputHandler() {
+	if (fFitEventTree) delete fFitEventTree;
+	if (fSplTree) delete fSplTree;
+	if (fSplRead) delete fSplRead;
+	fStartingWeights.clear();
+}
+
+void SplineInputHandler::CreateCache() {
+	if (fCacheSize > 0) {
+		fFitEventTree->SetCacheEntryRange(0, fNEvents);
+		fFitEventTree->AddBranchToCache("*", 1);
+		fFitEventTree->SetCacheSize(fCacheSize);
+
+		fSplTree->SetCacheEntryRange(0, fNEvents);
+		fSplTree->AddBranchToCache("*", 1);
+		fSplTree->SetCacheSize(fCacheSize);
+	}
+}
+
+void SplineInputHandler::RemoveCache() {
+	fFitEventTree->SetCacheEntryRange(0, fNEvents);
+	fFitEventTree->AddBranchToCache("*", 0);
+	fFitEventTree->SetCacheSize(0);
+
+	fSplTree->SetCacheEntryRange(0, fNEvents);
+	fSplTree->AddBranchToCache("*", 0);
+	fSplTree->SetCacheSize(0);
+}
+
+
+FitEvent* SplineInputHandler::GetNuisanceEvent(const UInt_t entry, const bool lightweight) {
+
+	// Make sure events setup
+	if (entry >= (UInt_t)fNEvents) return NULL;
+
+	// Reset all variables before tree read
+	fNUISANCEEvent->ResetEvent();
+
+	// Read NUISANCE Tree
+	if (!lightweight)
+		fFitEventTree->GetEntry(entry);
+
+	// Get Spline Coefficients
+	fSplTree->GetEntry(entry);
+	fNUISANCEEvent->fSplineCoeff = fSplineCoeff;
+
+	// Setup Input scaling for joint inputs
+	fNUISANCEEvent->InputWeight = fStartingWeights[entry];
+
+	// Run Initial, FSI, Final, Other ordering.
+	fNUISANCEEvent-> OrderStack();
+
+	return fNUISANCEEvent;
+}
+
+double SplineInputHandler::GetInputWeight(int entry) {
+	double w = InputHandlerBase::GetInputWeight(entry);
+	return w * fNUISANCEEvent->SavedRWWeight;
+}
+
+void SplineInputHandler::Print() {}
+
+
diff --git a/src/InputHandler/SplineInputHandler.h b/src/InputHandler/SplineInputHandler.h
new file mode 100644
index 0000000..be6b681
--- /dev/null
+++ b/src/InputHandler/SplineInputHandler.h
@@ -0,0 +1,41 @@
+#ifndef SPLINE_INPUTHANDLER_H
+#define SPLINE_INPUTHANDLER_H
+
+#include "InputHandler.h"
+#include "FitEvent.h"
+#include "PlotUtils.h"
+
+/// Spline InputHandler. Almost functionally identical to FitEventInputHandler
+/// with an extension to handle the spline co-efficients.
+class SplineInputHandler : public InputHandlerBase {
+public:
+
+	/// Standard constructor with name and file input
+	SplineInputHandler(std::string const& handle, std::string const& rawinputs);
+	virtual ~SplineInputHandler();
+
+	/// Returns NUISANCE FitEvent with Spline Coefficients included.
+	/// If lightweight, only spline coefficients are updated.
+	FitEvent* GetNuisanceEvent(const UInt_t entry, const bool lightweight = false);
+
+		/// Create a TTree Cache to speed up file read
+	void CreateCache();
+
+	/// Remove TTree Cache to save memory
+	void RemoveCache();
+
+	/// Return extra input weighting
+	double GetInputWeight(int entry);
+
+	/// Prints Event/Spline Information
+	void Print();
+
+	TChain* fFitEventTree;   ///< Main Fit Event Tree
+	TTree* fSplTree;	     ///< Main Spline Coefficient Tree
+	SplineReader* fSplRead;  ///< Spline Reader Object used to interpret splines
+	float fSplineCoeff[1000];///< Coefficients. Currently a hardcoded limit of 1000.
+
+	/// Starting RW Input Weights corresponding to nominal spline weight
+	std::vector<float> fStartingWeights;
+};
+#endif
diff --git a/src/FitBase/StdHepEvt.cxx b/src/InputHandler/StdHepEvt.cxx
similarity index 100%
rename from src/FitBase/StdHepEvt.cxx
rename to src/InputHandler/StdHepEvt.cxx
diff --git a/src/FitBase/StdHepEvt.h b/src/InputHandler/StdHepEvt.h
similarity index 100%
rename from src/FitBase/StdHepEvt.h
rename to src/InputHandler/StdHepEvt.h
diff --git a/src/K2K/CMakeLists.txt b/src/K2K/CMakeLists.txt
index 756b444..37c56c5 100644
--- a/src/K2K/CMakeLists.txt
+++ b/src/K2K/CMakeLists.txt
@@ -1,51 +1,54 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 K2K_NC1pi0_Evt_1Dppi0_nu.cxx
 )
 
 set(HEADERFILES
 K2K_NC1pi0_Evt_1Dppi0_nu.h
 )
 
 set(LIBNAME expK2K)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.cxx b/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.cxx
index 513af71..e93aee9 100644
--- a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.cxx
+++ b/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.cxx
@@ -1,56 +1,73 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "K2K_NC1pi0_Evt_1Dppi0_nu.h"
 
 // The constructor
-K2K_NC1pi0_Evt_1Dppi0_nu::K2K_NC1pi0_Evt_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
+K2K_NC1pi0_Evt_1Dppi0_nu::K2K_NC1pi0_Evt_1Dppi0_nu(nuiskey samplekey){
   
-  fName = "K2K_NC1pi0_Evt_1Dppi0_nu";
-  fPlotTitles = "; p_{#pi^{0}} (MeV/c); Number of events";
-  EnuMin = 0.;
-  EnuMax = 5.;
-  fIsDiag = true;
-  fNormError = 0.15;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+// Sample overview ---------------------------------------------------
+  std::string descrip = "K2K_NC1pi0_Evt_1Dppi0_nu sample. \n" \
+                        "Target: D2 \n" \
+                        "Flux:  \n" \
+                        "Signal:  \n";
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/K2K/nc1pi0/ppi0.csv");
-  this->SetupDefaultHist();
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi^{0}} (MeV/c)");
+  fSettings.SetYTitle("Number of events");
+  fSettings.SetAllowedTypes("EVT/SHAPE/DIAG", "EVT/SHAPE/DIAG/Q2CORR/MASK");
+  fSettings.SetEnuRange(0.0, 5.0);
+  fSettings.DefineAllowedTargets("H,O");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // plot information
+  fSettings.SetTitle("K2K_NC1pi0_Evt_1Dppi0_nu");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "K2K/nc1pi0/ppi0.csv");
 
-  this->fScaleFactor = 1; // No need to care about scaling factors for shape measurements
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor for shape
+  fScaleFactor = (fDataHist->Integral() / (fNEvents + 0.));
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 };
 
 void K2K_NC1pi0_Evt_1Dppi0_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0)
     return;
 
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   double ppi0 = FitUtils::p(Ppi0)*1000.;
   fXVar = ppi0;
 
   return;
 };
 
 bool K2K_NC1pi0_Evt_1Dppi0_nu::isSignal(FitEvent *event) {
   return SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax); // Check this signal definition
 }
diff --git a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h b/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
index ce6fd7d..d9ae82c 100644
--- a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
+++ b/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
@@ -1,35 +1,35 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
 #define K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class K2K_NC1pi0_Evt_1Dppi0_nu : public Measurement1D {
 public:
 
-  K2K_NC1pi0_Evt_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  K2K_NC1pi0_Evt_1Dppi0_nu(nuiskey samplekey);
   virtual ~K2K_NC1pi0_Evt_1Dppi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 };
   
 #endif
diff --git a/src/MCStudies/CMakeLists.txt b/src/MCStudies/CMakeLists.txt
index f8c1f75..3dd413b 100644
--- a/src/MCStudies/CMakeLists.txt
+++ b/src/MCStudies/CMakeLists.txt
@@ -1,62 +1,71 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 ExpMultDist_CCQE_XSec_1DVar_FakeStudy.cxx
 ExpMultDist_CCQE_XSec_2DVar_FakeStudy.cxx
 GenericFlux_Tester.cxx
 #MCStudy_KaonPreSelection.cxx
 MCStudy_MuonValidation.cxx
+ElectronFlux_FlatTree.cxx
+T2K2017_FakeData.cxx
+MCStudy_CCQEHistograms.cxx
 )
 
 set(HEADERFILES
 ExpMultDist_CCQE_XSec_1DVar_FakeStudy.h
 ExpMultDist_CCQE_XSec_2DVar_FakeStudy.h
 GenericFlux_Tester.h
 #MCStudy_KaonPreSelection.h
 MCStudy_MuonValidation.h
+ElectronFlux_FlatTree.h
+T2K2017_FakeData.h
+MCStudy_CCQEHistograms.h
 )
 
 set(LIBNAME MCStudies)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 # Needed for experiment specific signal flags
 include_directories(${CMAKE_SOURCE_DIR}/src/T2K)
 include_directories(${CMAKE_SOURCE_DIR}/src/MINERvA)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/MCStudies/GenericFlux_Tester.cxx b/src/MCStudies/ElectronFlux_FlatTree.cxx
similarity index 95%
copy from src/MCStudies/GenericFlux_Tester.cxx
copy to src/MCStudies/ElectronFlux_FlatTree.cxx
index fc1cffb..5ccd5ea 100644
--- a/src/MCStudies/GenericFlux_Tester.cxx
+++ b/src/MCStudies/ElectronFlux_FlatTree.cxx
@@ -1,559 +1,559 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#include "GenericFlux_Tester.h"
+#include "ElectronFlux_FlatTree.h"
 
 //********************************************************************
 /// @brief Class to perform MC Studies on a custom measurement
-GenericFlux_Tester::GenericFlux_Tester(std::string name, std::string inputfile,
+ElectronFlux_FlatTree::ElectronFlux_FlatTree(std::string name, std::string inputfile,
                                        FitWeight *rw, std::string type,
                                        std::string fakeDataFile) {
   //********************************************************************
 
   // Measurement Details
   fName = name;
   eventVariables = NULL;
 
   // Define our energy range for flux calcs
   EnuMin = 0.;
   EnuMax = 100.;  // Arbritrarily high energy limit
 
   // Set default fitter flags
   fIsDiag = true;
   fIsShape = false;
   fIsRawEvents = false;
 
   nu_4mom = new TLorentzVector(0, 0, 0, 0);
   pmu = new TLorentzVector(0, 0, 0, 0);
   ppip = new TLorentzVector(0, 0, 0, 0);
   ppim = new TLorentzVector(0, 0, 0, 0);
   ppi0 = new TLorentzVector(0, 0, 0, 0);
   pprot = new TLorentzVector(0, 0, 0, 0);
   pneut = new TLorentzVector(0, 0, 0, 0);
 
   // This function will sort out the input files automatically and parse all the
   // inputs,flags,etc.
   // There may be complex cases where you have to do this by hand, but usually
   // this will do.
   Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
   eventVariables = NULL;
   liteMode = FitPar::Config().GetParB("isLiteMode");
 
   // Setup fDataHist as a placeholder
   this->fDataHist = new TH1D(("empty_data"), ("empty-data"), 1, 0, 1);
   this->SetupDefaultHist();
   fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
   covar = StatUtils::GetInvert(fFullCovar);
 
   // 1. The generator is organised in SetupMeasurement so it gives the
   // cross-section in "per nucleon" units.
   //    So some extra scaling for a specific measurement may be required. For
   //    Example to get a "per neutron" measurement on carbon
   //    which we do here, we have to multiple by the number of nucleons 12 and
   //    divide by the number of neutrons 6.
   this->fScaleFactor =
       (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) /
       this->TotalIntegratedFlux();
 
-  LOG(SAM) << " Generic Flux Scaling Factor = " << fScaleFactor << endl;
+  LOG(SAM) << " Generic Flux Scaling Factor = " << fScaleFactor << std::endl;
 
   if (fScaleFactor <= 0.0) {
     ERR(WRN) << "SCALE FACTOR TOO LOW " << std::endl;
     sleep(20);
   }
 
   // Setup our TTrees
   this->AddEventVariablesToTree();
   this->AddSignalFlagsToTree();
 }
 
-void GenericFlux_Tester::AddEventVariablesToTree() {
+void ElectronFlux_FlatTree::AddEventVariablesToTree() {
   // Setup the TTree to save everything
   if (!eventVariables) {
     FitPar::Config().out->cd();
     eventVariables = new TTree((this->fName + "_VARS").c_str(),
                                (this->fName + "_VARS").c_str());
   }
 
-  LOG(SAM) << "Adding Event Variables" << endl;
+  LOG(SAM) << "Adding Event Variables" << std::endl;
   eventVariables->Branch("Mode", &Mode, "Mode/I");
 
   eventVariables->Branch("PDGnu", &PDGnu, "PDGnu/I");
   eventVariables->Branch("Enu_true", &Enu_true, "Enu_true/F");
 
   eventVariables->Branch("Nleptons", &Nleptons, "Nleptons/I");
   eventVariables->Branch("MLep", &MLep, "MLep/F");
   eventVariables->Branch("ELep", &ELep, "ELep/F");
   eventVariables->Branch("TLep", &TLep, "TLep/F");
   eventVariables->Branch("CosLep", &CosLep, "CosLep/F");
   eventVariables->Branch("CosPmuPpip", &CosPmuPpip, "CosPmuPpip/F");
   eventVariables->Branch("CosPmuPpim", &CosPmuPpim, "CosPmuPpim/F");
   eventVariables->Branch("CosPmuPpi0", &CosPmuPpi0, "CosPmuPpi0/F");
   eventVariables->Branch("CosPmuPprot", &CosPmuPprot, "CosPmuPprot/F");
   eventVariables->Branch("CosPmuPneut", &CosPmuPneut, "CosPmuPneut/F");
 
   eventVariables->Branch("Nprotons", &Nprotons, "Nprotons/I");
   eventVariables->Branch("MPr", &MPr, "MPr/F");
   eventVariables->Branch("EPr", &EPr, "EPr/F");
   eventVariables->Branch("TPr", &TPr, "TPr/F");
   eventVariables->Branch("CosPr", &CosPr, "CosPr/F");
   eventVariables->Branch("CosPprotPneut", &CosPprotPneut, "CosPprotPneut/F");
 
   eventVariables->Branch("Nneutrons", &Nneutrons, "Nneutrons/I");
   eventVariables->Branch("MNe", &MNe, "MNe/F");
   eventVariables->Branch("ENe", &ENe, "ENe/F");
   eventVariables->Branch("TNe", &TNe, "TNe/F");
   eventVariables->Branch("CosNe", &CosNe, "CosNe/F");
 
   eventVariables->Branch("Npiplus", &Npiplus, "Npiplus/I");
   eventVariables->Branch("MPiP", &MPiP, "MPiP/F");
   eventVariables->Branch("EPiP", &EPiP, "EPiP/F");
   eventVariables->Branch("TPiP", &TPiP, "TPiP/F");
   eventVariables->Branch("CosPiP", &CosPiP, "CosPiP/F");
   eventVariables->Branch("CosPpipPprot", &CosPpipPprot, "CosPpipProt/F");
   eventVariables->Branch("CosPpipPneut", &CosPpipPneut, "CosPpipPneut/F");
   eventVariables->Branch("CosPpipPpim", &CosPpipPpim, "CosPpipPpim/F");
   eventVariables->Branch("CosPpipPpi0", &CosPpipPpi0, "CosPpipPpi0/F");
 
   eventVariables->Branch("Npineg", &Npineg, "Npineg/I");
   eventVariables->Branch("MPiN", &MPiN, "MPiN/F");
   eventVariables->Branch("EPiN", &EPiN, "EPiN/F");
   eventVariables->Branch("TPiN", &TPiN, "TPiN/F");
   eventVariables->Branch("CosPiN", &CosPiN, "CosPiN/F");
   eventVariables->Branch("CosPpimPprot", &CosPpimPprot, "CosPpimPprot/F");
   eventVariables->Branch("CosPpimPneut", &CosPpimPneut, "CosPpimPneut/F");
   eventVariables->Branch("CosPpimPpi0", &CosPpimPpi0, "CosPpimPpi0/F");
 
   eventVariables->Branch("Npi0", &Npi0, "Npi0/I");
   eventVariables->Branch("MPi0", &MPi0, "MPi0/F");
   eventVariables->Branch("EPi0", &EPi0, "EPi0/F");
   eventVariables->Branch("TPi0", &TPi0, "TPi0/F");
   eventVariables->Branch("CosPi0", &CosPi0, "CosPi0/F");
   eventVariables->Branch("CosPi0Pprot", &CosPi0Pprot, "CosPi0Pprot/F");
   eventVariables->Branch("CosPi0Pneut", &CosPi0Pneut, "CosPi0Pneut/F");
 
   eventVariables->Branch("Nother", &Nother, "Nother/I");
 
   eventVariables->Branch("Q2_true", &Q2_true, "Q2_true/F");
   eventVariables->Branch("q0_true", &q0_true, "q0_true/F");
   eventVariables->Branch("q3_true", &q3_true, "q3_true/F");
 
   eventVariables->Branch("Enu_QE", &Enu_QE, "Enu_QE/F");
   eventVariables->Branch("Q2_QE", &Q2_QE, "Q2_QE/F");
 
   eventVariables->Branch("W_nuc_rest", &W_nuc_rest, "W_nuc_rest/F");
   eventVariables->Branch("bjorken_x", &bjorken_x, "bjorken_x/F");
   eventVariables->Branch("bjorken_y", &bjorken_y, "bjorken_y/F");
 
   eventVariables->Branch("Erecoil_true", &Erecoil_true, "Erecoil_true/F");
   eventVariables->Branch("Erecoil_charged", &Erecoil_charged,
                          "Erecoil_charged/F");
   eventVariables->Branch("Erecoil_minerva", &Erecoil_minerva,
                          "Erecoil_minerva/F");
 
   if (!liteMode) {
     eventVariables->Branch("nu_4mom", &nu_4mom);
     eventVariables->Branch("pmu_4mom", &pmu);
     eventVariables->Branch("hm_ppip_4mom", &ppip);
     eventVariables->Branch("hm_ppim_4mom", &ppim);
     eventVariables->Branch("hm_ppi0_4mom", &ppi0);
     eventVariables->Branch("hm_pprot_4mom", &pprot);
     eventVariables->Branch("hm_pneut_4mom", &pneut);
   }
 
   // Event Scaling Information
   eventVariables->Branch("Weight", &Weight, "Weight/F");
   eventVariables->Branch("InputWeight", &InputWeight, "InputWeight/F");
   eventVariables->Branch("RWWeight", &RWWeight, "RWWeight/F");
   eventVariables->Branch("FluxWeight", &FluxWeight, "FluxWeight/F");
   eventVariables->Branch("fScaleFactor", &fScaleFactor, "fScaleFactor/D");
 
   return;
 }
 
-void GenericFlux_Tester::AddSignalFlagsToTree() {
+void ElectronFlux_FlatTree::AddSignalFlagsToTree() {
   if (!eventVariables) {
     FitPar::Config().out->cd();
     eventVariables = new TTree((this->fName + "_VARS").c_str(),
                                (this->fName + "_VARS").c_str());
   }
 
-  LOG(SAM) << "Adding Samples" << endl;
+  LOG(SAM) << "Adding Samples" << std::endl;
 
   // Signal Definitions from SignalDef.cxx
   eventVariables->Branch("flagCCINC", &flagCCINC, "flagCCINC/O");
   eventVariables->Branch("flagNCINC", &flagNCINC, "flagNCINC/O");
   eventVariables->Branch("flagCCQE", &flagCCQE, "flagCCQE/O");
   eventVariables->Branch("flagCC0pi", &flagCC0pi, "flagCC0pi/O");
   eventVariables->Branch("flagCCQELike", &flagCCQELike, "flagCCQELike/O");
   eventVariables->Branch("flagNCEL", &flagNCEL, "flagNCEL/O");
   eventVariables->Branch("flagNC0pi", &flagNC0pi, "flagNC0pi/O");
   eventVariables->Branch("flagCCcoh", &flagCCcoh, "flagCCcoh/O");
   eventVariables->Branch("flagNCcoh", &flagNCcoh, "flagNCcoh/O");
   eventVariables->Branch("flagCC1pip", &flagCC1pip, "flagCC1pip/O");
   eventVariables->Branch("flagNC1pip", &flagNC1pip, "flagNC1pip/O");
   eventVariables->Branch("flagCC1pim", &flagCC1pim, "flagCC1pim/O");
   eventVariables->Branch("flagNC1pim", &flagNC1pim, "flagNC1pim/O");
   eventVariables->Branch("flagCC1pi0", &flagCC1pi0, "flagCC1pi0/O");
   eventVariables->Branch("flagNC1pi0", &flagNC1pi0, "flagNC1pi0/O");
 };
 
 //********************************************************************
-void GenericFlux_Tester::FillEventVariables(FitEvent *event) {
+void ElectronFlux_FlatTree::FillEventVariables(FitEvent *event) {
   //********************************************************************
 
   // Fill Signal Variables
   FillSignalFlags(event);
   LOG(DEB) << "Filling signal" << std::endl;
   // Function used to extract any variables of interest to the event
   Mode = event->Mode;
   Nleptons = 0;
   Nparticles = 0;
   PDGnu = 0;
   PDGLep = 0;
 
   Enu_true = Enu_QE = Q2_true = Q2_QE = TLep = TPr = TNe = TPiP = TPiN = TPi0 =
       -999.9;
 
   Nprotons = 0;
   PPr = EPr = MPr = CosPr = -999.9;
 
   Nneutrons = 0;
   PNe = ENe = MNe = CosNe = -999.9;
 
   Npiplus = 0;
   PPiP = EPiP = MPiP = CosPiP = -999.9;
 
   Npineg = 0;
   PPiN = EPiN = MPiN = CosPiN = -999.9;
 
   Npi0 = 0;
   PPi0 = EPi0 = MPi0 = CosPi0 = -999.9;
 
   // All of the angles Clarence added
   CosPmuPpip = CosPmuPpim = CosPmuPpi0 = CosPmuPprot = CosPmuPneut =
       CosPpipPprot = CosPpipPneut = CosPpipPpim = CosPpipPpi0 = CosPpimPprot =
           CosPpimPneut = CosPpimPpi0 = CosPi0Pprot = CosPi0Pneut =
               CosPprotPneut = -999.9;
 
   float proton_highmom = -999.9;
   float neutron_highmom = -999.9;
   float piplus_highmom = -999.9;
   float pineg_highmom = -999.9;
   float pi0_highmom = -999.9;
 
   (*nu_4mom) = event->PartInfo(0)->fP;
 
   if (!liteMode) {
     (*pmu) = TLorentzVector(0, 0, 0, 0);
     (*ppip) = TLorentzVector(0, 0, 0, 0);
     (*ppim) = TLorentzVector(0, 0, 0, 0);
     (*ppi0) = TLorentzVector(0, 0, 0, 0);
     (*pprot) = TLorentzVector(0, 0, 0, 0);
     (*pneut) = TLorentzVector(0, 0, 0, 0);
   }
 
   Enu_true = nu_4mom->E();
   PDGnu = event->PartInfo(0)->fPID;
 
   bool cc = (abs(event->Mode) < 30);
   (void)cc;
 
   // Add all pion distributions for the event.
 
   // Add classifier for CC0pi or CC1pi or CCOther
   // Save Modes Properly
   // Save low recoil measurements
 
   // Start Particle Loop
   UInt_t npart = event->Npart();
   for (UInt_t i = 0; i < npart; i++) {
     // Skip particles that weren't in the final state
     bool part_alive = event->PartInfo(i)->fIsAlive and event->PartInfo(i)->Status() == kFinalState;
     if (!part_alive) continue;
 
     // PDG Particle
     int PDGpart = event->PartInfo(i)->fPID;
     TLorentzVector part_4mom = event->PartInfo(i)->fP;
 
     Nparticles++;
 
     // Get Charged Lepton
-    if (abs(PDGpart) == abs(PDGnu) - 1) {
+    if (PDGpart == 11){
       Nleptons++;
 
       PDGLep = PDGpart;
 
       TLep = FitUtils::T(part_4mom) * 1000.0;
       PLep = (part_4mom.Vect().Mag());
       ELep = (part_4mom.E());
       MLep = (part_4mom.Mag());
       CosLep = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
       pmu = &part_4mom;
 
       Q2_true = -1 * (part_4mom - (*nu_4mom)).Mag2();
 
       float ThetaLep = (event->PartInfo(0))
                            ->fP.Vect()
                            .Angle((event->PartInfo(i))->fP.Vect());
 
       q0_true = (part_4mom - (*nu_4mom)).E();
       q3_true = (part_4mom - (*nu_4mom)).Vect().Mag();
 
       // Get W_true with assumption of initial state nucleon at rest
       float m_n = (float)PhysConst::mass_proton * 1000.;
       W_nuc_rest = sqrt(-Q2_true + 2 * m_n * (Enu_true - ELep) + m_n * m_n);
 
       // Get the Bjorken x and y variables
       // Assume that E_had = Enu - Emu as in MINERvA
       bjorken_x = Q2_true / (2 * m_n * (Enu_true - ELep));
       bjorken_y = 1 - ELep / Enu_true;
 
       // Quasi-elastic ----------------------
       // ------------------------------------
 
       // Q2 QE Assuming Carbon Input. Should change this to be dynamic soon.
       Q2_QE =
           FitUtils::Q2QErec(part_4mom, cos(ThetaLep), 34., true) * 1000000.0;
       Enu_QE = FitUtils::EnuQErec(part_4mom, cos(ThetaLep), 34., true) * 1000.0;
 
       // Pion Production ----------------------
       // --------------------------------------
 
     } else if (PDGpart == 2212) {
       Nprotons++;
       if (part_4mom.Vect().Mag() > proton_highmom) {
         proton_highmom = part_4mom.Vect().Mag();
 
         PPr = (part_4mom.Vect().Mag());
         EPr = (part_4mom.E());
         TPr = FitUtils::T(part_4mom) * 1000.;
         MPr = (part_4mom.Mag());
         CosPr = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*pprot) = part_4mom;
       }
     } else if (PDGpart == 2112) {
       Nneutrons++;
       if (part_4mom.Vect().Mag() > neutron_highmom) {
         neutron_highmom = part_4mom.Vect().Mag();
 
         PNe = (part_4mom.Vect().Mag());
         ENe = (part_4mom.E());
         TNe = FitUtils::T(part_4mom) * 1000.;
         MNe = (part_4mom.Mag());
         CosNe = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*pneut) = part_4mom;
       }
     } else if (PDGpart == 211) {
       Npiplus++;
       if (part_4mom.Vect().Mag() > piplus_highmom) {
         piplus_highmom = part_4mom.Vect().Mag();
 
         PPiP = (part_4mom.Vect().Mag());
         EPiP = (part_4mom.E());
         TPiP = FitUtils::T(part_4mom) * 1000.;
         MPiP = (part_4mom.Mag());
         CosPiP = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppip) = part_4mom;
       }
     } else if (PDGpart == -211) {
       Npineg++;
       if (part_4mom.Vect().Mag() > pineg_highmom) {
         pineg_highmom = part_4mom.Vect().Mag();
 
         PPiN = (part_4mom.Vect().Mag());
         EPiN = (part_4mom.E());
         TPiN = FitUtils::T(part_4mom) * 1000.;
         MPiN = (part_4mom.Mag());
         CosPiN = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppim) = part_4mom;
       }
     } else if (PDGpart == 111) {
       Npi0++;
       if (part_4mom.Vect().Mag() > pi0_highmom) {
         pi0_highmom = part_4mom.Vect().Mag();
 
         PPi0 = (part_4mom.Vect().Mag());
         EPi0 = (part_4mom.E());
         TPi0 = FitUtils::T(part_4mom) * 1000.;
         MPi0 = (part_4mom.Mag());
         CosPi0 = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppi0) = part_4mom;
       }
     } else {
       Nother++;
     }
   }
 
   // Get Recoil Definitions ------
   // -----------------------------
   Erecoil_true = FitUtils::GetErecoil_TRUE(event);
   Erecoil_charged = FitUtils::GetErecoil_CHARGED(event);
   Erecoil_minerva = FitUtils::GetErecoil_MINERvA_LowRecoil(event);
 
   // Do the angles between final state particles
   if (Nleptons > 0 && Npiplus > 0)
     CosPmuPpip = cos(pmu->Vect().Angle(ppip->Vect()));
   if (Nleptons > 0 && Npineg > 0)
     CosPmuPpim = cos(pmu->Vect().Angle(ppim->Vect()));
   if (Nleptons > 0 && Npi0 > 0)
     CosPmuPpi0 = cos(pmu->Vect().Angle(ppi0->Vect()));
   if (Nleptons > 0 && Nprotons > 0)
     CosPmuPprot = cos(pmu->Vect().Angle(pprot->Vect()));
   if (Nleptons > 0 && Nneutrons > 0)
     CosPmuPneut = cos(pmu->Vect().Angle(pneut->Vect()));
 
   if (Npiplus > 0 && Nprotons > 0)
     CosPpipPprot = cos(ppip->Vect().Angle(pprot->Vect()));
   if (Npiplus > 0 && Nneutrons > 0)
     CosPpipPneut = cos(ppip->Vect().Angle(pneut->Vect()));
   if (Npiplus > 0 && Npineg > 0)
     CosPpipPpim = cos(ppip->Vect().Angle(ppim->Vect()));
   if (Npiplus > 0 && Npi0 > 0)
     CosPpipPpi0 = cos(ppip->Vect().Angle(ppi0->Vect()));
 
   if (Npineg > 0 && Nprotons > 0)
     CosPpimPprot = cos(ppim->Vect().Angle(pprot->Vect()));
   if (Npineg > 0 && Nneutrons > 0)
     CosPpimPneut = cos(ppim->Vect().Angle(pneut->Vect()));
   if (Npineg > 0 && Npi0 > 0)
     CosPpimPpi0 = cos(ppim->Vect().Angle(ppi0->Vect()));
 
   if (Npi0 > 0 && Nprotons > 0)
     CosPi0Pprot = cos(ppi0->Vect().Angle(pprot->Vect()));
   if (Npi0 > 0 && Nneutrons > 0)
     CosPi0Pneut = cos(ppi0->Vect().Angle(pneut->Vect()));
 
   if (Nprotons > 0 && Nneutrons > 0)
     CosPprotPneut = cos(pprot->Vect().Angle(pneut->Vect()));
 
   // Event Weights ----
   // ------------------
   Weight = event->RWWeight * event->InputWeight;
   RWWeight = event->RWWeight;
   InputWeight = event->InputWeight;
   FluxWeight =
       GetFluxHistogram()->GetBinContent(GetFluxHistogram()->FindBin(Enu)) / GetFluxHistogram()->Integral();
 
   xsecScaling = fScaleFactor;
 
   if (fScaleFactor <= 0.0) {
     ERR(WRN) << "SCALE FACTOR TOO LOW " << std::endl;
     sleep(20);
   }
 
   // Fill the eventVariables Tree
   eventVariables->Fill();
   return;
 };
 
 //********************************************************************
-void GenericFlux_Tester::Write(std::string drawOpt) {
+void ElectronFlux_FlatTree::Write(std::string drawOpt) {
   //********************************************************************
 
   // First save the TTree
   eventVariables->Write();
 
   // Save Flux and Event Histograms too
   GetInput()->GetFluxHistogram()->Write();
   GetInput()->GetEventHistogram()->Write();
 
   return;
 }
 
 //********************************************************************
-void GenericFlux_Tester::FillSignalFlags(FitEvent *event) {
+void ElectronFlux_FlatTree::FillSignalFlags(FitEvent *event) {
   //********************************************************************
 
   // Some example flags are given from SignalDef.
   // See src/Utils/SignalDef.cxx for more.
   int nuPDG = event->PartInfo(0)->fPID;
 
   // Generic signal flags
   flagCCINC = SignalDef::isCCINC(event, nuPDG);
   flagNCINC = SignalDef::isNCINC(event, nuPDG);
   flagCCQE = SignalDef::isCCQE(event, nuPDG);
   flagCCQELike = SignalDef::isCCQELike(event, nuPDG);
   flagCC0pi = SignalDef::isCC0pi(event, nuPDG);
   flagNCEL = SignalDef::isNCEL(event, nuPDG);
   flagNC0pi = SignalDef::isNC0pi(event, nuPDG);
   flagCCcoh = SignalDef::isCCCOH(event, nuPDG, 211);
   flagNCcoh = SignalDef::isNCCOH(event, nuPDG, 111);
   flagCC1pip = SignalDef::isCC1pi(event, nuPDG, 211);
   flagNC1pip = SignalDef::isNC1pi(event, nuPDG, 211);
   flagCC1pim = SignalDef::isCC1pi(event, nuPDG, -211);
   flagNC1pim = SignalDef::isNC1pi(event, nuPDG, -211);
   flagCC1pi0 = SignalDef::isCC1pi(event, nuPDG, 111);
   flagNC1pi0 = SignalDef::isNC1pi(event, nuPDG, 111);
 }
 
 // -------------------------------------------------------------------
 // Purely MC Plot
 // Following functions are just overrides to handle this
 // -------------------------------------------------------------------
 //********************************************************************
 /// Everything is classed as signal...
-bool GenericFlux_Tester::isSignal(FitEvent *event) {
+bool ElectronFlux_FlatTree::isSignal(FitEvent *event) {
   //********************************************************************
   (void)event;
   return true;
 };
 
 //********************************************************************
-void GenericFlux_Tester::ScaleEvents() {
+void ElectronFlux_FlatTree::ScaleEvents() {
   //********************************************************************
   // Saving everything to a TTree so no scaling required
   return;
 }
 
 //********************************************************************
-void GenericFlux_Tester::ApplyNormScale(float norm) {
+void ElectronFlux_FlatTree::ApplyNormScale(float norm) {
   //********************************************************************
 
   // Saving everything to a TTree so no scaling required
   this->fCurrentNorm = norm;
   return;
 }
 
 //********************************************************************
-void GenericFlux_Tester::FillHistograms() {
+void ElectronFlux_FlatTree::FillHistograms() {
   //********************************************************************
   // No Histograms need filling........
   return;
 }
 
 //********************************************************************
-void GenericFlux_Tester::ResetAll() {
+void ElectronFlux_FlatTree::ResetAll() {
   //********************************************************************
   eventVariables->Reset();
   return;
 }
 
 //********************************************************************
-float GenericFlux_Tester::GetChi2() {
+float ElectronFlux_FlatTree::GetChi2() {
   //********************************************************************
   // No Likelihood to test, purely MC
   return 0.0;
 }
diff --git a/src/MCStudies/ElectronFlux_FlatTree.h b/src/MCStudies/ElectronFlux_FlatTree.h
new file mode 100644
index 0000000..568e8d0
--- /dev/null
+++ b/src/MCStudies/ElectronFlux_FlatTree.h
@@ -0,0 +1,188 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#ifndef ElectronFlux_FlatTree_H_SEEN
+#define ElectronFlux_FlatTree_H_SEEN
+#include "Measurement1D.h"
+
+//********************************************************************
+class ElectronFlux_FlatTree : public Measurement1D {
+//********************************************************************
+
+public:
+
+  ElectronFlux_FlatTree(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  virtual ~ElectronFlux_FlatTree() {};
+
+  //! Grab info from event
+  void FillEventVariables(FitEvent *event);
+
+  //! Fill Custom Histograms
+  void FillHistograms();
+
+  //! ResetAll
+  void ResetAll();
+
+  //! Scale
+  void ScaleEvents();
+
+  //! Norm
+  void ApplyNormScale(float norm);
+
+  //! Define this samples signal
+  bool isSignal(FitEvent *nvect);
+
+  //! Write Files
+  void Write(std::string drawOpt);
+
+  //! Get Chi2
+  float GetChi2();
+
+  //! Fill all signal flags we currently have
+  void FillSignalFlags(FitEvent *event);
+
+  void AddEventVariablesToTree();
+  void AddSignalFlagsToTree();
+
+ private:
+
+  // Lighter flat trees that don't include vectors
+  bool liteMode;
+
+  TTree* eventVariables;
+
+  TLorentzVector *nu_4mom;
+  TLorentzVector *pmu;
+  TLorentzVector *ppip;
+  TLorentzVector *ppim;
+  TLorentzVector *ppi0;
+  TLorentzVector *pprot;
+  TLorentzVector *pneut;
+
+  // Saved Variables
+  float Enu_true;
+  float Enu_QE;
+  int PDGnu;
+
+  float Q2_true;
+  float Q2_QE;
+  float W_nuc_rest;
+  float bjorken_x;
+  float bjorken_y;
+
+  int Mode;
+
+  int Nprotons;
+  int Nneutrons;
+  int Npiplus;
+  int Npineg;
+  int Npi0;
+
+  int PDGLep;
+  float TLep;
+  float CosLep;
+  float ELep;
+  float PLep;
+  float MLep;
+
+  float PPr;  //!< Highest Mom Proton
+  float CosPr; //!< Highest Mom Proton
+  float EPr;
+  float TPr;
+  float MPr;
+
+
+  float PNe;
+  float CosNe;
+  float ENe;
+  float TNe;
+  float MNe;
+
+  float PPiP;
+  float CosPiP;
+  float EPiP;
+  float TPiP;
+  float MPiP;
+
+  float PPiN;
+  float CosPiN;
+  float EPiN;
+  float TPiN;
+  float MPiN;
+
+  float PPi0;
+  float CosPi0;
+  float EPi0;
+  float TPi0;
+  float MPi0;
+
+  float CosPmuPpip;
+  float CosPmuPpim;
+  float CosPmuPpi0;
+  float CosPmuPprot;
+  float CosPmuPneut;
+  float CosPpipPprot;
+  float CosPpipPneut;
+  float CosPpipPpim;
+  float CosPpipPpi0;
+  float CosPpimPprot;
+  float CosPpimPneut;
+  float CosPpimPpi0;
+  float CosPi0Pprot;
+  float CosPi0Pneut;
+  float CosPprotPneut;
+
+  float q0_true;
+  float q3_true;
+
+  int Nparticles;
+  int Nleptons;
+  int Nother;
+
+  float Erecoil_true;
+  float Erecoil_charged;
+  float Erecoil_minerva;
+
+  float Weight;
+  float RWWeight;
+  float InputWeight;
+  float FluxWeight;
+
+  // Generic signal flags
+  bool flagCCINC;
+  bool flagNCINC;
+  bool flagCCQE;
+  bool flagCC0pi;
+  bool flagCCQELike;
+  bool flagNCEL;
+  bool flagNC0pi;
+  bool flagCCcoh;
+  bool flagNCcoh;
+  bool flagCC1pip;
+  bool flagNC1pip;
+  bool flagCC1pim;
+  bool flagNC1pim;
+  bool flagCC1pi0;
+  bool flagNC1pi0;
+
+  float xsecScaling;
+
+};
+
+#endif
diff --git a/src/MCStudies/ExpMultDist_CCQE_XSec_1DVar_FakeStudy.cxx b/src/MCStudies/ExpMultDist_CCQE_XSec_1DVar_FakeStudy.cxx
index 4b635f5..971fa22 100644
--- a/src/MCStudies/ExpMultDist_CCQE_XSec_1DVar_FakeStudy.cxx
+++ b/src/MCStudies/ExpMultDist_CCQE_XSec_1DVar_FakeStudy.cxx
@@ -1,153 +1,154 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ExpMultDist_CCQE_XSec_1DVar_FakeStudy.h"
 
 //********************************************************************
 /// @brief Class to perform CCQE Fake Data Studies on a custom measurement
 ExpMultDist_CCQE_XSec_1DVar_FakeStudy::ExpMultDist_CCQE_XSec_1DVar_FakeStudy(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 //********************************************************************
 
   // Measurement Details
   fName = name;
 
   // Define our energy range for flux calcs
   EnuMin = 0.;
   EnuMax = 6.;
 
   // Set default fitter flags
   fIsDiag = true;
   fIsShape = false;
   fIsRawEvents = false;
 
   // This function will sort out the input files automatically and parse all the inputs,flags,etc.
   // There may be complex cases where you have to do this by hand, but usually this will do.
   Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
 
   // Use the name to define what variable to measure
-  int nbins;
-  double binlow, binhigh;
+  int nbins = 0;
+  double binlow = 0.0;
+  double binhigh = 0.0;
 
   if (name.find("1DQ2") != std::string::npos){
     plottype = 1; fPlotTitles = "";
     nbins = 30;  binlow = 0.0;  binhigh = 2.0;
   } else if (name.find("1DTmu") != std::string::npos){
     plottype = 2; fPlotTitles = "";
     nbins = 20;  binlow = 0.0;  binhigh = 3.0;
   } else if (name.find("1DCos") != std::string::npos){
     plottype = 3;  fPlotTitles = "";
     nbins = 10;  binlow = -1.0; binhigh = 1.0;
   }
 
   // Setup the datahist as empty, we will use fake data to fill it.
   this->fDataHist = new TH1D((fName + "_data").c_str(), (fName + "_data" + fPlotTitles).c_str(), nbins, binlow, binhigh);
 
   // Once fDataHist is setup this function will automatically generate matching MC histograms
   this->SetupDefaultHist();
 
 
   // Setup Covariance assuming a diagonal covar.
   // If you want a full covariance to be used examples are given in the MINERvA 1D classes
   fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
   covar     = StatUtils::GetInvert(fFullCovar);
 
 
   // 3. The generator is organised in SetupMeasurement so it gives the cross-section in "per nucleon" units.
   //    So some extra scaling for a specific measurement may be required. For Example to get a "per neutron" measurement on carbon
   //    which we do here, we have to multiple by the number of nucleons 12 and divide by the number of neutrons 6.
   this->fScaleFactor = (GetEventHistogram()->Integral()*1E-38/(fNEvents+0.))  * (12.0 / 6.0)  /this->TotalIntegratedFlux();
 
 };
 
 
 
 //********************************************************************
 /// @details Extract Enu and totcrs from event assuming quasi-elastic scattering
 void ExpMultDist_CCQE_XSec_1DVar_FakeStudy::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   // MUST be defined for each new sample.
   // This function reads in the FitEvent format and lets you grab any information you need
   // from the event. This function is only called during the first and last iteration of each fit so that
   // a vector of fXVar variables can be filled for the signal events.
 
   // Define empty variables
   fXVar = -1.0;
   double q2qe = 0.0;
   double CosThetaMu = -2.0;
   double TMu = 0.0;
 
   // Loop over the particle stack
   for (UInt_t j = 2; j < event->Npart(); ++j){
 
     // Look for the outgoing muon
     if ((event->PartInfo(j))->fPID != 13) continue;
 
     // Define any variables we may need
     ThetaMu     = (event->PartInfo(0))->fP.Vect().Angle((event->PartInfo(j))->fP.Vect());
 
     Enu_rec     = FitUtils::EnuQErec((event->PartInfo(j))->fP, cos(ThetaMu), 0.,true);
     q2qe        = FitUtils::Q2QErec( (event->PartInfo(j))->fP, cos(ThetaMu), 0.,true);
 
     CosThetaMu = cos(ThetaMu);
     TMu = FitUtils::T((event->PartInfo(j))->fP);
 
     // Once lepton is found, don't continue the loop
     break;
   }
 
   if (this->plottype == 1) fXVar = q2qe;
   else if (this->plottype == 2) fXVar = TMu;
   else if (this->plottype == 3) fXVar = CosThetaMu;
 
   return;
 };
 
 //********************************************************************
 /// @details Signal is true CCQE scattering
 ///
 /// @details Cut 1: numu event
 /// @details Cut 2: Mode == 1
 /// @details Cut 3: EnuMin < Enu < EnuMax
 bool ExpMultDist_CCQE_XSec_1DVar_FakeStudy::isSignal(FitEvent *event){
 //********************************************************************
 
   // Place cuts on each of the events here.
   // MUST be defined for all new samples, there is no default signal definition.
   // Check FitUtils and CutUtils for example cuts that can be used quickly.
 
   // During a fit isSignal is only used in the first fit function call to define
   // which of the events actually need to be considered, so don't worry too much if
   // this function is inefficient.
 
   // Mode and Enu are automatically avaialble in this function, they don't need to be set earlier.
 
   // Only look at numu events
   if ((event->PartInfo(0))->fPID != 14) return false;
 
   // Only look at CCQE Events and MEC Events
   if (Mode != 1 and Mode != 2) return false;
 
   // Restrict energy range
   if (Enu < this->EnuMin || Enu > this->EnuMax) return false;
 
   return true;
 };
 
diff --git a/src/MCStudies/ExpMultDist_CCQE_XSec_2DVar_FakeStudy.cxx b/src/MCStudies/ExpMultDist_CCQE_XSec_2DVar_FakeStudy.cxx
index 0fbb341..cc6d26d 100644
--- a/src/MCStudies/ExpMultDist_CCQE_XSec_2DVar_FakeStudy.cxx
+++ b/src/MCStudies/ExpMultDist_CCQE_XSec_2DVar_FakeStudy.cxx
@@ -1,169 +1,172 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "ExpMultDist_CCQE_XSec_2DVar_FakeStudy.h"
 
 //********************************************************************
 /// @brief Class to perform CCQE Fake Data Studies on a custom measurement
 ExpMultDist_CCQE_XSec_2DVar_FakeStudy::ExpMultDist_CCQE_XSec_2DVar_FakeStudy(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 //********************************************************************
 
   // Measurement Details
   fName = name;
 
   // Define our energy range for flux calcs
   EnuMin = 0.;
   EnuMax = 6.;
 
   // Set default fitter flags
   fIsDiag = true;
   fIsShape = false;
   fIsRawEvents = false;
 
   // This function will sort out the input files automatically and parse all the inputs,flags,etc.
   // There may be complex cases where you have to do this by hand, but usually this will do.
   Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
   // Use the name to define what variable to measure
-  int nbinsx, nbinsy;
-  double binlowx, binhighx;
-  double binlowy, binhighy;
+  int nbinsx = 0;
+  int nbinsy = 0;
+  double binlowx = 0.0;
+  double binhighx = 0.0;
+  double binlowy = 0.0;
+  double binhighy = 0.0;
 
   if (name.find("Q2vsTmu") != std::string::npos){
     plottype = 1; fPlotTitles = "";
     nbinsx = 30; binlowx = 0.0; binhighx = 2.0;
     nbinsy = 20; binlowy = 0.0; binhighy = 3.0;
   } else if (name.find("Q2vsCos") != std::string::npos){
     plottype = 2; fPlotTitles = "";
     nbinsx = 30; binlowx = 0.0;binhighx = 2.0;
     nbinsy = 10;  binlowy = -1.0; binhighy = 1.0;
   } else if (name.find("TmuvsCos") != std::string::npos){
     plottype = 3; fPlotTitles = "";
     nbinsx = 20; binlowx = 0.0; binhighx = 3.0;
     nbinsy = 10;  binlowy = -1.0; binhighy = 1.0;
   }
 
   // Setup the datahist as empty, we will use fake data to fill it.
   this->fDataHist = new TH2D((fName + "_data").c_str(), (fName + "_data" + fPlotTitles).c_str(), nbinsx, binlowx, binhighx, nbinsy, binlowy, binhighy);
 
   // Once fDataHist is setup this function will automatically generate matching MC histograms
   this->SetupDefaultHist();
 
   double threshold = 10.0;
   for (int i = 0; i < this->fDataHist->GetNbinsX(); i++){
     for (int j = 0; j < this->fDataHist->GetNbinsY(); j++){
 
       if (fDataHist->GetBinContent(i+1,j+1) <= threshold){
 	fDataHist->SetBinError(i+1,j+1, 0.0);
 	fDataHist->SetBinContent(i+1,j+1, 0.0);
       }
     }
   }
 
 
   // Setup Covariance assuming a diagonal covar.
   // If you want a full covariance to be used examples are given in the MINERvA 2D classes
   //fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
   //  covar     = StatUtils::GetInvert(fFullCovar);
 
 
   // 3. The generator is organised in SetupMeasurement so it gives the cross-section in "per nucleon" units.
   //    So some extra scaling for a specific measurement may be required. For Example to get a "per neutron" measurement on carbon
   //    which we do here, we have to multiple by the number of nucleons 12 and divide by the number of neutrons 6.
   this->fScaleFactor = (GetEventHistogram()->Integral()*1E-38/(fNEvents+0.))  * (12.0 / 6.0)  /this->TotalIntegratedFlux();
 
 };
 
 
 
 //********************************************************************
 /// @details Extract Enu and totcrs from event assuming quasi-elastic scattering
 void ExpMultDist_CCQE_XSec_2DVar_FakeStudy::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   // MUST be defined for each new sample.
   // This function reads in the FitEvent format and lets you grab any information you need
   // from the event. This function is only called during the first and last iteration of each fit so that
   // a vector of fXVar variables can be filled for the signal events.
 
   // Define empty variables
   fXVar = -1.0;
   fYVar = -1.0;
 
   double q2qe = 0.0;
   double CosThetaMu = -2.0;
   double TMu = 0.0;
 
   // Loop over the particle stack
   for (UInt_t j = 2; j < event->Npart(); ++j){
 
     // Look for the outgoing muon
     if ((event->PartInfo(j))->fPID != 13) continue;
 
     // Define any variables we may need
     ThetaMu     = (event->PartInfo(0))->fP.Vect().Angle((event->PartInfo(j))->fP.Vect());
 
     Enu_rec     = FitUtils::EnuQErec((event->PartInfo(j))->fP, cos(ThetaMu), 0.,true);
     q2qe        = FitUtils::Q2QErec( (event->PartInfo(j))->fP, cos(ThetaMu), 0.,true);
 
     CosThetaMu = cos(ThetaMu);
     TMu = FitUtils::T((event->PartInfo(j))->fP);
 
     // Once lepton is found, don't continue the loop
     break;
   }
 
   if (this->plottype == 1) {fXVar = q2qe; fYVar = TMu;}
   else if (this->plottype == 2) {fXVar = q2qe; fXVar = CosThetaMu;}
   else if (this->plottype == 3) {fXVar = TMu; fYVar = CosThetaMu;}
 
   return;
 };
 
 //********************************************************************
 /// @details Signal is true CCQE scattering
 ///
 /// @details Cut 1: numu event
 /// @details Cut 2: Mode == 1
 /// @details Cut 3: EnuMin < Enu < EnuMax
 bool ExpMultDist_CCQE_XSec_2DVar_FakeStudy::isSignal(FitEvent *event){
 //********************************************************************
 
   // Place cuts on each of the events here.
   // MUST be defined for all new samples, there is no default signal definition.
   // Check FitUtils and CutUtils for example cuts that can be used quickly.
 
   // During a fit isSignal is only used in the first fit function call to define
   // which of the events actually need to be considered, so don't worry too much if
   // this function is inefficient.
 
   // Mode and Enu are automatically avaialble in this function, they don't need to be set earlier.
 
   // Only look at numu events
   if ((event->PartInfo(0))->fPID != 14) return false;
 
   // Only look at CCQE Events and MEC Events
   if (Mode != 1 and Mode != 2) return false;
 
   // Restrict energy range
   if (Enu < this->EnuMin || Enu > this->EnuMax) return false;
 
   return true;
 };
 
diff --git a/src/MCStudies/GenericFlux_Tester.cxx b/src/MCStudies/GenericFlux_Tester.cxx
index fc1cffb..556fd43 100644
--- a/src/MCStudies/GenericFlux_Tester.cxx
+++ b/src/MCStudies/GenericFlux_Tester.cxx
@@ -1,559 +1,559 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "GenericFlux_Tester.h"
 
 //********************************************************************
 /// @brief Class to perform MC Studies on a custom measurement
 GenericFlux_Tester::GenericFlux_Tester(std::string name, std::string inputfile,
                                        FitWeight *rw, std::string type,
                                        std::string fakeDataFile) {
   //********************************************************************
 
   // Measurement Details
   fName = name;
   eventVariables = NULL;
 
   // Define our energy range for flux calcs
   EnuMin = 0.;
   EnuMax = 100.;  // Arbritrarily high energy limit
 
   // Set default fitter flags
   fIsDiag = true;
   fIsShape = false;
   fIsRawEvents = false;
 
   nu_4mom = new TLorentzVector(0, 0, 0, 0);
   pmu = new TLorentzVector(0, 0, 0, 0);
   ppip = new TLorentzVector(0, 0, 0, 0);
   ppim = new TLorentzVector(0, 0, 0, 0);
   ppi0 = new TLorentzVector(0, 0, 0, 0);
   pprot = new TLorentzVector(0, 0, 0, 0);
   pneut = new TLorentzVector(0, 0, 0, 0);
 
   // This function will sort out the input files automatically and parse all the
   // inputs,flags,etc.
   // There may be complex cases where you have to do this by hand, but usually
   // this will do.
   Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
   eventVariables = NULL;
   liteMode = FitPar::Config().GetParB("isLiteMode");
 
   // Setup fDataHist as a placeholder
   this->fDataHist = new TH1D(("empty_data"), ("empty-data"), 1, 0, 1);
   this->SetupDefaultHist();
   fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
   covar = StatUtils::GetInvert(fFullCovar);
 
   // 1. The generator is organised in SetupMeasurement so it gives the
   // cross-section in "per nucleon" units.
   //    So some extra scaling for a specific measurement may be required. For
   //    Example to get a "per neutron" measurement on carbon
   //    which we do here, we have to multiple by the number of nucleons 12 and
   //    divide by the number of neutrons 6.
   this->fScaleFactor =
       (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) /
       this->TotalIntegratedFlux();
 
-  LOG(SAM) << " Generic Flux Scaling Factor = " << fScaleFactor << endl;
+  LOG(SAM) << " Generic Flux Scaling Factor = " << fScaleFactor << std::endl;
 
   if (fScaleFactor <= 0.0) {
     ERR(WRN) << "SCALE FACTOR TOO LOW " << std::endl;
     sleep(20);
   }
 
   // Setup our TTrees
   this->AddEventVariablesToTree();
   this->AddSignalFlagsToTree();
 }
 
 void GenericFlux_Tester::AddEventVariablesToTree() {
   // Setup the TTree to save everything
   if (!eventVariables) {
     FitPar::Config().out->cd();
     eventVariables = new TTree((this->fName + "_VARS").c_str(),
                                (this->fName + "_VARS").c_str());
   }
 
-  LOG(SAM) << "Adding Event Variables" << endl;
+  LOG(SAM) << "Adding Event Variables" << std::endl;
   eventVariables->Branch("Mode", &Mode, "Mode/I");
 
   eventVariables->Branch("PDGnu", &PDGnu, "PDGnu/I");
   eventVariables->Branch("Enu_true", &Enu_true, "Enu_true/F");
 
   eventVariables->Branch("Nleptons", &Nleptons, "Nleptons/I");
   eventVariables->Branch("MLep", &MLep, "MLep/F");
   eventVariables->Branch("ELep", &ELep, "ELep/F");
   eventVariables->Branch("TLep", &TLep, "TLep/F");
   eventVariables->Branch("CosLep", &CosLep, "CosLep/F");
   eventVariables->Branch("CosPmuPpip", &CosPmuPpip, "CosPmuPpip/F");
   eventVariables->Branch("CosPmuPpim", &CosPmuPpim, "CosPmuPpim/F");
   eventVariables->Branch("CosPmuPpi0", &CosPmuPpi0, "CosPmuPpi0/F");
   eventVariables->Branch("CosPmuPprot", &CosPmuPprot, "CosPmuPprot/F");
   eventVariables->Branch("CosPmuPneut", &CosPmuPneut, "CosPmuPneut/F");
 
   eventVariables->Branch("Nprotons", &Nprotons, "Nprotons/I");
   eventVariables->Branch("MPr", &MPr, "MPr/F");
   eventVariables->Branch("EPr", &EPr, "EPr/F");
   eventVariables->Branch("TPr", &TPr, "TPr/F");
   eventVariables->Branch("CosPr", &CosPr, "CosPr/F");
   eventVariables->Branch("CosPprotPneut", &CosPprotPneut, "CosPprotPneut/F");
 
   eventVariables->Branch("Nneutrons", &Nneutrons, "Nneutrons/I");
   eventVariables->Branch("MNe", &MNe, "MNe/F");
   eventVariables->Branch("ENe", &ENe, "ENe/F");
   eventVariables->Branch("TNe", &TNe, "TNe/F");
   eventVariables->Branch("CosNe", &CosNe, "CosNe/F");
 
   eventVariables->Branch("Npiplus", &Npiplus, "Npiplus/I");
   eventVariables->Branch("MPiP", &MPiP, "MPiP/F");
   eventVariables->Branch("EPiP", &EPiP, "EPiP/F");
   eventVariables->Branch("TPiP", &TPiP, "TPiP/F");
   eventVariables->Branch("CosPiP", &CosPiP, "CosPiP/F");
   eventVariables->Branch("CosPpipPprot", &CosPpipPprot, "CosPpipProt/F");
   eventVariables->Branch("CosPpipPneut", &CosPpipPneut, "CosPpipPneut/F");
   eventVariables->Branch("CosPpipPpim", &CosPpipPpim, "CosPpipPpim/F");
   eventVariables->Branch("CosPpipPpi0", &CosPpipPpi0, "CosPpipPpi0/F");
 
   eventVariables->Branch("Npineg", &Npineg, "Npineg/I");
   eventVariables->Branch("MPiN", &MPiN, "MPiN/F");
   eventVariables->Branch("EPiN", &EPiN, "EPiN/F");
   eventVariables->Branch("TPiN", &TPiN, "TPiN/F");
   eventVariables->Branch("CosPiN", &CosPiN, "CosPiN/F");
   eventVariables->Branch("CosPpimPprot", &CosPpimPprot, "CosPpimPprot/F");
   eventVariables->Branch("CosPpimPneut", &CosPpimPneut, "CosPpimPneut/F");
   eventVariables->Branch("CosPpimPpi0", &CosPpimPpi0, "CosPpimPpi0/F");
 
   eventVariables->Branch("Npi0", &Npi0, "Npi0/I");
   eventVariables->Branch("MPi0", &MPi0, "MPi0/F");
   eventVariables->Branch("EPi0", &EPi0, "EPi0/F");
   eventVariables->Branch("TPi0", &TPi0, "TPi0/F");
   eventVariables->Branch("CosPi0", &CosPi0, "CosPi0/F");
   eventVariables->Branch("CosPi0Pprot", &CosPi0Pprot, "CosPi0Pprot/F");
   eventVariables->Branch("CosPi0Pneut", &CosPi0Pneut, "CosPi0Pneut/F");
 
   eventVariables->Branch("Nother", &Nother, "Nother/I");
 
   eventVariables->Branch("Q2_true", &Q2_true, "Q2_true/F");
   eventVariables->Branch("q0_true", &q0_true, "q0_true/F");
   eventVariables->Branch("q3_true", &q3_true, "q3_true/F");
 
   eventVariables->Branch("Enu_QE", &Enu_QE, "Enu_QE/F");
   eventVariables->Branch("Q2_QE", &Q2_QE, "Q2_QE/F");
 
   eventVariables->Branch("W_nuc_rest", &W_nuc_rest, "W_nuc_rest/F");
   eventVariables->Branch("bjorken_x", &bjorken_x, "bjorken_x/F");
   eventVariables->Branch("bjorken_y", &bjorken_y, "bjorken_y/F");
 
   eventVariables->Branch("Erecoil_true", &Erecoil_true, "Erecoil_true/F");
   eventVariables->Branch("Erecoil_charged", &Erecoil_charged,
                          "Erecoil_charged/F");
   eventVariables->Branch("Erecoil_minerva", &Erecoil_minerva,
                          "Erecoil_minerva/F");
 
   if (!liteMode) {
     eventVariables->Branch("nu_4mom", &nu_4mom);
     eventVariables->Branch("pmu_4mom", &pmu);
     eventVariables->Branch("hm_ppip_4mom", &ppip);
     eventVariables->Branch("hm_ppim_4mom", &ppim);
     eventVariables->Branch("hm_ppi0_4mom", &ppi0);
     eventVariables->Branch("hm_pprot_4mom", &pprot);
     eventVariables->Branch("hm_pneut_4mom", &pneut);
   }
 
   // Event Scaling Information
   eventVariables->Branch("Weight", &Weight, "Weight/F");
   eventVariables->Branch("InputWeight", &InputWeight, "InputWeight/F");
   eventVariables->Branch("RWWeight", &RWWeight, "RWWeight/F");
   eventVariables->Branch("FluxWeight", &FluxWeight, "FluxWeight/F");
   eventVariables->Branch("fScaleFactor", &fScaleFactor, "fScaleFactor/D");
 
   return;
 }
 
 void GenericFlux_Tester::AddSignalFlagsToTree() {
   if (!eventVariables) {
     FitPar::Config().out->cd();
     eventVariables = new TTree((this->fName + "_VARS").c_str(),
                                (this->fName + "_VARS").c_str());
   }
 
-  LOG(SAM) << "Adding Samples" << endl;
+  LOG(SAM) << "Adding Samples" << std::endl;
 
   // Signal Definitions from SignalDef.cxx
   eventVariables->Branch("flagCCINC", &flagCCINC, "flagCCINC/O");
   eventVariables->Branch("flagNCINC", &flagNCINC, "flagNCINC/O");
   eventVariables->Branch("flagCCQE", &flagCCQE, "flagCCQE/O");
   eventVariables->Branch("flagCC0pi", &flagCC0pi, "flagCC0pi/O");
   eventVariables->Branch("flagCCQELike", &flagCCQELike, "flagCCQELike/O");
   eventVariables->Branch("flagNCEL", &flagNCEL, "flagNCEL/O");
   eventVariables->Branch("flagNC0pi", &flagNC0pi, "flagNC0pi/O");
   eventVariables->Branch("flagCCcoh", &flagCCcoh, "flagCCcoh/O");
   eventVariables->Branch("flagNCcoh", &flagNCcoh, "flagNCcoh/O");
   eventVariables->Branch("flagCC1pip", &flagCC1pip, "flagCC1pip/O");
   eventVariables->Branch("flagNC1pip", &flagNC1pip, "flagNC1pip/O");
   eventVariables->Branch("flagCC1pim", &flagCC1pim, "flagCC1pim/O");
   eventVariables->Branch("flagNC1pim", &flagNC1pim, "flagNC1pim/O");
   eventVariables->Branch("flagCC1pi0", &flagCC1pi0, "flagCC1pi0/O");
   eventVariables->Branch("flagNC1pi0", &flagNC1pi0, "flagNC1pi0/O");
 };
 
 //********************************************************************
 void GenericFlux_Tester::FillEventVariables(FitEvent *event) {
   //********************************************************************
 
   // Fill Signal Variables
   FillSignalFlags(event);
   LOG(DEB) << "Filling signal" << std::endl;
   // Function used to extract any variables of interest to the event
   Mode = event->Mode;
   Nleptons = 0;
   Nparticles = 0;
   PDGnu = 0;
   PDGLep = 0;
 
   Enu_true = Enu_QE = Q2_true = Q2_QE = TLep = TPr = TNe = TPiP = TPiN = TPi0 =
       -999.9;
 
   Nprotons = 0;
   PPr = EPr = MPr = CosPr = -999.9;
 
   Nneutrons = 0;
   PNe = ENe = MNe = CosNe = -999.9;
 
   Npiplus = 0;
   PPiP = EPiP = MPiP = CosPiP = -999.9;
 
   Npineg = 0;
   PPiN = EPiN = MPiN = CosPiN = -999.9;
 
   Npi0 = 0;
   PPi0 = EPi0 = MPi0 = CosPi0 = -999.9;
 
   // All of the angles Clarence added
   CosPmuPpip = CosPmuPpim = CosPmuPpi0 = CosPmuPprot = CosPmuPneut =
       CosPpipPprot = CosPpipPneut = CosPpipPpim = CosPpipPpi0 = CosPpimPprot =
           CosPpimPneut = CosPpimPpi0 = CosPi0Pprot = CosPi0Pneut =
               CosPprotPneut = -999.9;
 
   float proton_highmom = -999.9;
   float neutron_highmom = -999.9;
   float piplus_highmom = -999.9;
   float pineg_highmom = -999.9;
   float pi0_highmom = -999.9;
 
   (*nu_4mom) = event->PartInfo(0)->fP;
 
   if (!liteMode) {
     (*pmu) = TLorentzVector(0, 0, 0, 0);
     (*ppip) = TLorentzVector(0, 0, 0, 0);
     (*ppim) = TLorentzVector(0, 0, 0, 0);
     (*ppi0) = TLorentzVector(0, 0, 0, 0);
     (*pprot) = TLorentzVector(0, 0, 0, 0);
     (*pneut) = TLorentzVector(0, 0, 0, 0);
   }
 
   Enu_true = nu_4mom->E();
   PDGnu = event->PartInfo(0)->fPID;
 
   bool cc = (abs(event->Mode) < 30);
   (void)cc;
 
   // Add all pion distributions for the event.
 
   // Add classifier for CC0pi or CC1pi or CCOther
   // Save Modes Properly
   // Save low recoil measurements
 
   // Start Particle Loop
   UInt_t npart = event->Npart();
   for (UInt_t i = 0; i < npart; i++) {
     // Skip particles that weren't in the final state
     bool part_alive = event->PartInfo(i)->fIsAlive and event->PartInfo(i)->Status() == kFinalState;
     if (!part_alive) continue;
 
     // PDG Particle
     int PDGpart = event->PartInfo(i)->fPID;
     TLorentzVector part_4mom = event->PartInfo(i)->fP;
 
     Nparticles++;
 
     // Get Charged Lepton
     if (abs(PDGpart) == abs(PDGnu) - 1) {
       Nleptons++;
 
       PDGLep = PDGpart;
 
       TLep = FitUtils::T(part_4mom) * 1000.0;
       PLep = (part_4mom.Vect().Mag());
       ELep = (part_4mom.E());
       MLep = (part_4mom.Mag());
       CosLep = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
       pmu = &part_4mom;
 
       Q2_true = -1 * (part_4mom - (*nu_4mom)).Mag2();
 
       float ThetaLep = (event->PartInfo(0))
                            ->fP.Vect()
                            .Angle((event->PartInfo(i))->fP.Vect());
 
       q0_true = (part_4mom - (*nu_4mom)).E();
       q3_true = (part_4mom - (*nu_4mom)).Vect().Mag();
 
       // Get W_true with assumption of initial state nucleon at rest
       float m_n = (float)PhysConst::mass_proton * 1000.;
       W_nuc_rest = sqrt(-Q2_true + 2 * m_n * (Enu_true - ELep) + m_n * m_n);
 
       // Get the Bjorken x and y variables
       // Assume that E_had = Enu - Emu as in MINERvA
       bjorken_x = Q2_true / (2 * m_n * (Enu_true - ELep));
       bjorken_y = 1 - ELep / Enu_true;
 
       // Quasi-elastic ----------------------
       // ------------------------------------
 
       // Q2 QE Assuming Carbon Input. Should change this to be dynamic soon.
       Q2_QE =
           FitUtils::Q2QErec(part_4mom, cos(ThetaLep), 34., true) * 1000000.0;
       Enu_QE = FitUtils::EnuQErec(part_4mom, cos(ThetaLep), 34., true) * 1000.0;
 
       // Pion Production ----------------------
       // --------------------------------------
 
     } else if (PDGpart == 2212) {
       Nprotons++;
       if (part_4mom.Vect().Mag() > proton_highmom) {
         proton_highmom = part_4mom.Vect().Mag();
 
         PPr = (part_4mom.Vect().Mag());
         EPr = (part_4mom.E());
         TPr = FitUtils::T(part_4mom) * 1000.;
         MPr = (part_4mom.Mag());
         CosPr = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*pprot) = part_4mom;
       }
     } else if (PDGpart == 2112) {
       Nneutrons++;
       if (part_4mom.Vect().Mag() > neutron_highmom) {
         neutron_highmom = part_4mom.Vect().Mag();
 
         PNe = (part_4mom.Vect().Mag());
         ENe = (part_4mom.E());
         TNe = FitUtils::T(part_4mom) * 1000.;
         MNe = (part_4mom.Mag());
         CosNe = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*pneut) = part_4mom;
       }
     } else if (PDGpart == 211) {
       Npiplus++;
       if (part_4mom.Vect().Mag() > piplus_highmom) {
         piplus_highmom = part_4mom.Vect().Mag();
 
         PPiP = (part_4mom.Vect().Mag());
         EPiP = (part_4mom.E());
         TPiP = FitUtils::T(part_4mom) * 1000.;
         MPiP = (part_4mom.Mag());
         CosPiP = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppip) = part_4mom;
       }
     } else if (PDGpart == -211) {
       Npineg++;
       if (part_4mom.Vect().Mag() > pineg_highmom) {
         pineg_highmom = part_4mom.Vect().Mag();
 
         PPiN = (part_4mom.Vect().Mag());
         EPiN = (part_4mom.E());
         TPiN = FitUtils::T(part_4mom) * 1000.;
         MPiN = (part_4mom.Mag());
         CosPiN = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppim) = part_4mom;
       }
     } else if (PDGpart == 111) {
       Npi0++;
       if (part_4mom.Vect().Mag() > pi0_highmom) {
         pi0_highmom = part_4mom.Vect().Mag();
 
         PPi0 = (part_4mom.Vect().Mag());
         EPi0 = (part_4mom.E());
         TPi0 = FitUtils::T(part_4mom) * 1000.;
         MPi0 = (part_4mom.Mag());
         CosPi0 = cos(part_4mom.Vect().Angle(nu_4mom->Vect()));
 
         (*ppi0) = part_4mom;
       }
     } else {
       Nother++;
     }
   }
 
   // Get Recoil Definitions ------
   // -----------------------------
   Erecoil_true = FitUtils::GetErecoil_TRUE(event);
   Erecoil_charged = FitUtils::GetErecoil_CHARGED(event);
   Erecoil_minerva = FitUtils::GetErecoil_MINERvA_LowRecoil(event);
 
   // Do the angles between final state particles
   if (Nleptons > 0 && Npiplus > 0)
     CosPmuPpip = cos(pmu->Vect().Angle(ppip->Vect()));
   if (Nleptons > 0 && Npineg > 0)
     CosPmuPpim = cos(pmu->Vect().Angle(ppim->Vect()));
   if (Nleptons > 0 && Npi0 > 0)
     CosPmuPpi0 = cos(pmu->Vect().Angle(ppi0->Vect()));
   if (Nleptons > 0 && Nprotons > 0)
     CosPmuPprot = cos(pmu->Vect().Angle(pprot->Vect()));
   if (Nleptons > 0 && Nneutrons > 0)
     CosPmuPneut = cos(pmu->Vect().Angle(pneut->Vect()));
 
   if (Npiplus > 0 && Nprotons > 0)
     CosPpipPprot = cos(ppip->Vect().Angle(pprot->Vect()));
   if (Npiplus > 0 && Nneutrons > 0)
     CosPpipPneut = cos(ppip->Vect().Angle(pneut->Vect()));
   if (Npiplus > 0 && Npineg > 0)
     CosPpipPpim = cos(ppip->Vect().Angle(ppim->Vect()));
   if (Npiplus > 0 && Npi0 > 0)
     CosPpipPpi0 = cos(ppip->Vect().Angle(ppi0->Vect()));
 
   if (Npineg > 0 && Nprotons > 0)
     CosPpimPprot = cos(ppim->Vect().Angle(pprot->Vect()));
   if (Npineg > 0 && Nneutrons > 0)
     CosPpimPneut = cos(ppim->Vect().Angle(pneut->Vect()));
   if (Npineg > 0 && Npi0 > 0)
     CosPpimPpi0 = cos(ppim->Vect().Angle(ppi0->Vect()));
 
   if (Npi0 > 0 && Nprotons > 0)
     CosPi0Pprot = cos(ppi0->Vect().Angle(pprot->Vect()));
   if (Npi0 > 0 && Nneutrons > 0)
     CosPi0Pneut = cos(ppi0->Vect().Angle(pneut->Vect()));
 
   if (Nprotons > 0 && Nneutrons > 0)
     CosPprotPneut = cos(pprot->Vect().Angle(pneut->Vect()));
 
   // Event Weights ----
   // ------------------
   Weight = event->RWWeight * event->InputWeight;
   RWWeight = event->RWWeight;
   InputWeight = event->InputWeight;
   FluxWeight =
       GetFluxHistogram()->GetBinContent(GetFluxHistogram()->FindBin(Enu)) / GetFluxHistogram()->Integral();
 
   xsecScaling = fScaleFactor;
 
   if (fScaleFactor <= 0.0) {
     ERR(WRN) << "SCALE FACTOR TOO LOW " << std::endl;
     sleep(20);
   }
 
   // Fill the eventVariables Tree
   eventVariables->Fill();
   return;
 };
 
 //********************************************************************
 void GenericFlux_Tester::Write(std::string drawOpt) {
   //********************************************************************
 
   // First save the TTree
   eventVariables->Write();
 
   // Save Flux and Event Histograms too
   GetInput()->GetFluxHistogram()->Write();
   GetInput()->GetEventHistogram()->Write();
 
   return;
 }
 
 //********************************************************************
 void GenericFlux_Tester::FillSignalFlags(FitEvent *event) {
   //********************************************************************
 
   // Some example flags are given from SignalDef.
   // See src/Utils/SignalDef.cxx for more.
   int nuPDG = event->PartInfo(0)->fPID;
 
   // Generic signal flags
   flagCCINC = SignalDef::isCCINC(event, nuPDG);
   flagNCINC = SignalDef::isNCINC(event, nuPDG);
   flagCCQE = SignalDef::isCCQE(event, nuPDG);
   flagCCQELike = SignalDef::isCCQELike(event, nuPDG);
   flagCC0pi = SignalDef::isCC0pi(event, nuPDG);
   flagNCEL = SignalDef::isNCEL(event, nuPDG);
   flagNC0pi = SignalDef::isNC0pi(event, nuPDG);
   flagCCcoh = SignalDef::isCCCOH(event, nuPDG, 211);
   flagNCcoh = SignalDef::isNCCOH(event, nuPDG, 111);
   flagCC1pip = SignalDef::isCC1pi(event, nuPDG, 211);
   flagNC1pip = SignalDef::isNC1pi(event, nuPDG, 211);
   flagCC1pim = SignalDef::isCC1pi(event, nuPDG, -211);
   flagNC1pim = SignalDef::isNC1pi(event, nuPDG, -211);
   flagCC1pi0 = SignalDef::isCC1pi(event, nuPDG, 111);
   flagNC1pi0 = SignalDef::isNC1pi(event, nuPDG, 111);
 }
 
 // -------------------------------------------------------------------
 // Purely MC Plot
 // Following functions are just overrides to handle this
 // -------------------------------------------------------------------
 //********************************************************************
 /// Everything is classed as signal...
 bool GenericFlux_Tester::isSignal(FitEvent *event) {
   //********************************************************************
   (void)event;
   return true;
 };
 
 //********************************************************************
 void GenericFlux_Tester::ScaleEvents() {
   //********************************************************************
   // Saving everything to a TTree so no scaling required
   return;
 }
 
 //********************************************************************
 void GenericFlux_Tester::ApplyNormScale(float norm) {
   //********************************************************************
 
   // Saving everything to a TTree so no scaling required
   this->fCurrentNorm = norm;
   return;
 }
 
 //********************************************************************
 void GenericFlux_Tester::FillHistograms() {
   //********************************************************************
   // No Histograms need filling........
   return;
 }
 
 //********************************************************************
 void GenericFlux_Tester::ResetAll() {
   //********************************************************************
   eventVariables->Reset();
   return;
 }
 
 //********************************************************************
 float GenericFlux_Tester::GetChi2() {
   //********************************************************************
   // No Likelihood to test, purely MC
   return 0.0;
 }
diff --git a/src/MCStudies/MCStudy_CCQEHistograms.cxx b/src/MCStudies/MCStudy_CCQEHistograms.cxx
new file mode 100644
index 0000000..bde660b
--- /dev/null
+++ b/src/MCStudies/MCStudy_CCQEHistograms.cxx
@@ -0,0 +1,225 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "MCStudy_CCQEHistograms.h"
+
+#include "T2K_SignalDef.h"
+#include "MINERvA_SignalDef.h"
+
+//********************************************************************
+/// @brief Class to perform MC Studies on a custom measurement
+MCStudy_CCQEHistograms::MCStudy_CCQEHistograms(std::string name, std::string inputfile,
+                                       FitWeight *rw, std::string type,
+                                       std::string fakeDataFile) {
+  //********************************************************************
+
+  // Measurement Details
+  fName = name;
+  fEventTree = NULL;
+
+  // Define our energy range for flux calcs
+  EnuMin = 0.;
+  EnuMax = 100.;  // Arbritrarily high energy limit
+
+  // Set default fitter flags
+  fIsDiag = true;
+  fIsShape = false;
+  fIsRawEvents = false;
+
+  // This function will sort out the input files automatically and parse all the
+  // inputs,flags,etc.
+  // There may be complex cases where you have to do this by hand, but usually
+  // this will do.
+  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  fEventTree = NULL;
+
+  // Setup fDataHist as a placeholder
+  this->fDataHist = new TH1D(("approximate_data"), ("kaon_data"), 5, 1.0, 6.0);
+  
+  this->SetupDefaultHist();
+  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
+  covar = StatUtils::GetInvert(fFullCovar);
+
+  // 1. The generator is organised in SetupMeasurement so it gives the
+  // cross-section in "per nucleon" units.
+  //    So some extra scaling for a specific measurement may be required. For
+  //    Example to get a "per neutron" measurement on carbon
+  //    which we do here, we have to multiple by the number of nucleons 12 and
+  //    divide by the number of neutrons 6.
+  this->fScaleFactor = (this->fEventHist->Integral("width") * 1E-38 / (fNEvents + 0.)) /
+    this->TotalIntegratedFlux();
+  
+  
+  hist_Enu = new TH1D("MCStudy_CCQE_Enu","MCStudy_CCQE_Enu",30,0.0,2.0);
+  hist_TLep = new TH1D("MCStudy_CCQE_TLep","MCStudy_CCQE_TLep",30,0.0,4.0);
+  hist_CosLep = new TH1D("MCStudy_CCQE_CosLep","MCStudy_CCQE_CosLep",30,-1.0,1.0);
+  hist_Q2 = new TH1D("MCStudy_CCQE_Q2","MCStudy_CCQE_Q2",30,0.0,2.0);
+  hist_Q2QE = new TH1D("MCStudy_CCQE_Q2QE","MCStudy_CCQE_Q2QE",30,0.0,2.0);
+  hist_EQE = new TH1D("MCStudy_CCQE_EQE","MCStudy_CCQE_EQE",30,0.0,5.0);
+  hist_q0 = new TH1D("MCStudy_CCQE_q0","MCStudy_CCQE_q0",30,0.0,2.0);
+  hist_q3 = new TH1D("MCStudy_CCQE_q3","MCStudy_CCQE_q3",30,0.0,2.0);
+  hist_TLepCosLep = new TH2D("MCStudy_CCQE_TLepCosLep","MCStudy_CCQE_TLepCosLep",15,0.0,5.0,15,-1.0,1.0);
+  hist_Total = new TH1D("MCStudy_CCQE_TotalXSec","MXStudy_CCQE_TotalXSec",1,0.0,1.0);
+
+  return;
+}
+
+//********************************************************************
+void MCStudy_CCQEHistograms::FillEventVariables(FitEvent *event) {
+//********************************************************************
+
+//  std::cout << "Event fBound = " << event->fBound << " " << event->Mode << std::endl;
+  if (event->fBound > 0) return;
+  if (abs(event->Mode) != 1) return;
+  std::cout << "Event fBound = " << event->fBound << " " << event->Mode << "-> Signal " << std::endl;
+
+
+  FitParticle* muon = NULL;
+  FitParticle* nu   = event->GetNeutrinoIn();
+  bool IsNuMu = event->PDGnu() > 0;
+  
+  if (IsNuMu)  muon = event->GetHMFSParticle(13);
+  else muon = event->GetHMFSParticle(-13);
+
+  // Reset Variables
+  Enu    = -999.9;
+  TLep   = -999.9;
+  CosLep = -999.9;
+  Q2     = -999.9;
+  Q2QE   = -999.9;
+  EQE    = -999.9;
+  q0     = -999.9;
+  q3     = -999.9;
+
+  // Fill Variables
+  if (muon){
+
+    Enu = event->Enu() / 1.E3;
+
+    TLep   = (muon->fP.E() - muon->fP.Mag()) / 1.E3;
+    CosLep = cos(muon->fP.Vect().Angle( nu->fP.Vect() )); 
+
+    Q2   = fabs((muon->fP - nu->fP).Mag2() / 1.E6);
+
+    Q2QE = FitUtils::Q2QErec(muon->fP, CosLep, 34., IsNuMu);
+    EQE  = FitUtils::EnuQErec(muon->fP, CosLep, 34., IsNuMu);
+    
+    q0 = fabs((muon->fP - nu->fP).E()) / 1.E3;
+    q3 = fabs((muon->fP - nu->fP).Vect().Mag()) / 1.E3;
+
+    LocalRWWeight = event->RWWeight;
+    LocalInputWeight = event->InputWeight;
+    
+  }
+
+  // Fill Tree
+  if (abs(Mode) == 1 and Signal){
+    hist_Enu->Fill(Enu,event->Weight);
+    hist_TLep->Fill(TLep,event->Weight);
+    hist_CosLep->Fill(CosLep,event->Weight);
+    hist_Q2->Fill(Q2,event->Weight);
+    hist_Q2QE->Fill(Q2QE,event->Weight);
+    hist_EQE->Fill(EQE,event->Weight);
+    hist_q0->Fill(q0,event->Weight);
+    hist_q3->Fill(q3,event->Weight);
+    hist_TLepCosLep->Fill(TLep,CosLep,event->Weight);
+
+    hist_Total->Fill(0.5,event->Weight);
+    
+    fXVar = Q2;
+  }
+
+  return;
+};
+
+//********************************************************************
+void MCStudy_CCQEHistograms::Write(std::string drawOpt) {
+//********************************************************************
+//  Measurement1D::Write(drawOpt);
+
+  LOG(FIT) << "Writing MCStudy_CCQEHistograms " << std::endl;
+  //  FitPar::Config().out->cd();
+  hist_Enu->Write();
+  hist_TLep->Write();
+  hist_CosLep->Write();
+  hist_Q2->Write();
+  hist_Q2QE->Write();
+  hist_EQE->Write();
+  hist_q0->Write();
+  hist_q3->Write();
+  hist_TLepCosLep->Write();
+  hist_Total->Write();
+
+  return;
+}
+
+//********************************************************************                                                                                                                                 
+void MCStudy_CCQEHistograms::ResetAll(){
+  //********************************************************************                                                                                                                                 
+  hist_Enu->Reset();
+  hist_TLep->Reset();
+  hist_CosLep->Reset();
+  hist_Q2->Reset();
+  hist_Q2QE->Reset();
+  hist_EQE->Reset();
+  hist_q0->Reset();
+  hist_q3->Reset();
+  hist_TLepCosLep->Reset();
+  hist_Total->Reset();
+
+  return;
+}
+
+
+//********************************************************************                                                                                                                     
+void MCStudy_CCQEHistograms::ScaleEvents(){
+//********************************************************************                                                                                                                                
+
+  hist_Enu->Scale(fScaleFactor,"width");
+  hist_TLep->Scale(fScaleFactor,"width");
+  hist_CosLep->Scale(fScaleFactor,"width");
+  hist_Q2->Scale(fScaleFactor,"width");
+  hist_Q2QE->Scale(fScaleFactor,"width");
+  hist_EQE->Scale(fScaleFactor,"width");
+  hist_q0->Scale(fScaleFactor,"width");
+  hist_q3->Scale(fScaleFactor,"width");
+  hist_TLepCosLep->Scale(fScaleFactor,"width");
+  hist_Total->Scale(fScaleFactor,"width");
+
+  return;
+}
+
+
+
+//********************************************************************
+/// Select only events with final state Muons
+bool MCStudy_CCQEHistograms::isSignal(FitEvent *event) {
+//********************************************************************
+
+
+  if (abs(event->Mode) != 1) return false;
+  if (event->fBound > 0) return false;
+  //  if (!event->HasFSMuon()) return false;
+  
+  // Do we want any other signal?
+  return true;
+};
+
+
+
diff --git a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h b/src/MCStudies/MCStudy_CCQEHistograms.h
old mode 100755
new mode 100644
similarity index 61%
copy from src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
copy to src/MCStudies/MCStudy_CCQEHistograms.h
index c732a2c..455a9f2
--- a/src/BEBC/BEBC_CCQE_XSec_1DQ2_nu.h
+++ b/src/MCStudies/MCStudy_CCQEHistograms.h
@@ -1,52 +1,75 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef BEBC_CCQE_XSEC_1DQ2_NU_H_SEEN
-#define BEBC_CCQE_XSEC_1DQ2_NU_H_SEEN
-
+#ifndef MCStudy_CCQEHistograms_H_SEEN
+#define MCStudy_CCQEHistograms_H_SEEN
 #include "Measurement1D.h"
 
 //********************************************************************
-class BEBC_CCQE_XSec_1DQ2_nu : public Measurement1D {
+class MCStudy_CCQEHistograms : public Measurement1D {
 //********************************************************************
 
 public:
 
-  BEBC_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~BEBC_CCQE_XSec_1DQ2_nu() {}; 
-  
-  void FillEventVariables(FitEvent *event);       
-  void ApplyNormScale(double norm);
-  bool isSignal(FitEvent *event);                 
-  void FillHistograms();
-  void Write(std::string drawOpt);
-  void ResetAll();
+  MCStudy_CCQEHistograms(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  virtual ~MCStudy_CCQEHistograms() {};
+
+  //! Grab info from event
+  void FillEventVariables(FitEvent *event);
+
   void ScaleEvents();
+  void ResetAll();
+
+  //! Define this samples signal
+  bool isSignal(FitEvent *nvect);
+
+  //! Write Files
+  void Write(std::string drawOpt);
 
  private:
-  bool applyQ2correction; ///< Flag of whether deut correction applied
-  TH1D* CorrectionHist; ///< Correction factor
-  TH1D* fMCHist_NoCorr; ///< Uncorrected fMCHist
-  double q2qe;       ///< fXVar
-  double scaleF; ///< Nominal Scale Factor
+  
+  double fEventScaleFactor;
+  TTree* fEventTree;
+  TH1D* hist_Enu;
+  float Enu;
+  TH1D* hist_TLep;
+  float TLep  ;
+  TH1D* hist_CosLep;
+  float CosLep;
+  TH1D* hist_Q2;
+  float Q2    ;
+  TH1D* hist_Q2QE;
+  float Q2QE  ;
+  TH1D* hist_EQE;
+  float EQE   ;
+  TH1D* hist_q0;
+  float q0    ;
+  TH1D* hist_q3;
+  float q3    ;
 
+  TH1D* hist_Total;
+  
+  TH2D* hist_TLepCosLep;
+
+  double LocalRWWeight;
+  double LocalInputWeight;
 
 };
-  
+
 #endif
diff --git a/src/MCStudies/MCStudy_KaonPreSelection.cxx b/src/MCStudies/MCStudy_KaonPreSelection.cxx
index aceb469..adee159 100644
--- a/src/MCStudies/MCStudy_KaonPreSelection.cxx
+++ b/src/MCStudies/MCStudy_KaonPreSelection.cxx
@@ -1,235 +1,234 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MCStudy_KaonPreSelection.h"
 
 #include "T2K_SignalDef.h"
 #include "MINERvA_SignalDef.h"
 
 //********************************************************************
 /// @brief Class to perform MC Studies on a custom measurement
 MCStudy_KaonPreSelection::MCStudy_KaonPreSelection(std::string name, std::string inputfile,
                                        FitWeight *rw, std::string type,
                                        std::string fakeDataFile) {
   //********************************************************************
 
   // Measurement Details
   fName = name;
   fEventTree = NULL;
 
   // Define our energy range for flux calcs
   EnuMin = 0.;
   EnuMax = 100.;  // Arbritrarily high energy limit
 
   // Set default fitter flags
   fIsDiag = true;
   fIsShape = false;
   fIsRawEvents = false;
 
   // This function will sort out the input files automatically and parse all the
   // inputs,flags,etc.
   // There may be complex cases where you have to do this by hand, but usually
   // this will do.
   Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
   fEventTree = NULL;
 
   // Setup fDataHist as a placeholder
   this->fDataHist = new TH1D(("approximate_data"), ("kaon_data"), 5, 1.0, 6.0);
 
   // Approximate data points for now
   fDataHist->SetBinContent(1,0.225E-39);
   fDataHist->SetBinContent(2,0.215E-39);
   fDataHist->SetBinContent(3,0.175E-39);
   fDataHist->SetBinContent(4,0.230E-39);
   fDataHist->SetBinContent(5,0.210E-39);
 
   this->SetupDefaultHist();
   fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
   covar = StatUtils::GetInvert(fFullCovar);
 
   // 1. The generator is organised in SetupMeasurement so it gives the
   // cross-section in "per nucleon" units.
   //    So some extra scaling for a specific measurement may be required. For
   //    Example to get a "per neutron" measurement on carbon
   //    which we do here, we have to multiple by the number of nucleons 12 and
   //    divide by the number of neutrons 6.
   this->fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) /
     this->TotalIntegratedFlux();
 
   // Create a new TTree and add Nuisance Events Branches
   FitPar::Config().out->cd();
   fEventTree = new TTree("nuisance_events","nuisance_events");
-  GetInput()->GetEventPointer()->AddBranchesToTree(fEventTree);
+  GetInput()->GetNuisanceEvent(0)->AddBranchesToTree(fEventTree);
 
   fEventTree->Branch("nlep",&nlep, "nlep/I");
   fEventTree->Branch("nkplus",&nkplus, "nkplus/I");
   //fEventTree->Branch("nkaon",&nkaon, "nkaon/I");
   fEventTree->Branch("kplus_mom", &kplusmom, "kplus_mom/D");
   //  fEventTree->Branch("kaon_mom", &kaonmom, "kaon_mom/D");
 
   // Add Event Scaling Information
   // This scale factor is used to get the predicted event rate for this sample given
   // the input flux. Use this when merging different output event ttrees
   fEventTree->Branch("EventScaleFactor", &fEventScaleFactor, "EventScaleFactor/D");
   fEventScaleFactor = GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.);
 
   // NOTES:
   // To get normalised predictions weight event event by 'EventScaleFactor' to get the
   // predicted event rate for that sample given the flux used. Then to get cross-sections
   // divide by the integrated flux from all samples.
   // e.g. To get the numu+numubar prediction, add the event rate predictions from both
   // samples together, then divide by the integral of the 'nuisance_flux' histograms in each
   // sample.
 
   // Every particle in the nuisance event is saved into the TTree. The list of particle
   // status codes are given in src/FitBase/FitParticle.h. The neutrino is usually the first
   // particle in the list.
   // If selecting final state kaons, select only kaons with state=2.
 
   /*
     enum particle_state{
     kUndefinedState = 5,
     kInitialState   = 0,
     kFSIState       = 1,
     kFinalState     = 2,
     kNuclearInitial = 3,
     kNuclearRemnant = 4
     };
   */
 
   // The structure of the particle lists are a dimensional array for each particle mom, then a 1D array
   // for the PDG and state. Mode gives the true NEUT interaction channel code.
   /*
     tn->Branch("Mode", &fMode, "Mode/I");
     tn->Branch("EventNo", &fEventNo, "EventNo/i");
     tn->Branch("TotCrs", &fTotCrs, "TotCrs/D");
     tn->Branch("TargetA", &fTargetA, "TargetA/I");
     tn->Branch("TargetH", &fTargetH, "TargetH/I");
     tn->Branch("Bound", &fBound, "Bound/O");
 
     tn->Branch("InputWeight", &InputWeight, "InputWeight/D");
 
     tn->Branch("NParticles", &fNParticles, "NParticles/I");
     tn->Branch("ParticleState", fParticleState, "ParticleState[NParticles]/i");
     tn->Branch("ParticlePDG", fParticlePDG, "ParticlePDG[NParticles]/I");
     tn->Branch("ParticleMom", fParticleMom, "ParticleMom[NParticles][4]/D");
   */
 
   // Logging Flag
   fKaonLogging = FitPar::Config().GetParB("KaonLogging");
 
   return;
 }
 
 //********************************************************************
 void MCStudy_KaonPreSelection::FillEventVariables(FitEvent *event) {
 //********************************************************************
   
   // Reset
   kplusmom = -999.9;
 
   // Save Some Extra Information
   nkplus = event->NumFSParticle(PhysConst::pdg_kplus);
 
   // Nmuons
   nlep = event->NumFSParticle(13) + event->NumFSParticle(-13);
 
   // Leading K+ Mom
   if (event->GetHMFSParticle(PhysConst::pdg_kplus)){
     kplusmom = FitUtils::T(event->GetHMFSParticle(PhysConst::pdg_kplus)->fP)*1000.0;
   }
 
   // Fill XVar
   fXVar = kplusmom / 1.E3;
 
   // Fill If Signal
   if (isSignal(event)){
-
     fEventTree->Fill();
+
     if (fKaonLogging){
       int nstrangemesons = event->NumParticle(321);
       int nstrangefsmesons = event->NumFSParticle(321);
       
       if (nstrangemesons > 0){
 	std::cout << "New Event ----------------------------" << std::endl;
 	std::cout << "N S Mesons vs NFS S Mesons : " << nstrangemesons << " : " << nstrangefsmesons << std::endl;
 	event->PrintChris();
 	event->fNeutVect->Dump();
       }
     }
   }
 
   return;
 };
 
-
 //********************************************************************
 void MCStudy_KaonPreSelection::Write(std::string drawOpt) {
 //********************************************************************
 
   // Save the event ttree
   fEventTree->Write();
 
   // Save Flux and Event Histograms too
   GetInput()->GetFluxHistogram()->Write("nuisance_fluxhist");
   GetInput()->GetEventHistogram()->Write("nuisance_eventhist");
 
   return;
 }
 
 
 //********************************************************************
 /// Select only events with final state Kaons
 bool MCStudy_KaonPreSelection::isSignal(FitEvent *event) {
 //********************************************************************
 
   // Update to include all events
   return true;
 
   // Apply a Kaon Pre-selection
   // Search for Strange Mesons (included full list from MC PDG)
 
   /*
   PhystConst::pdg_strangemesons = {130,310,311,321,
 				   9000311,9000321,
 				   10311,10321,100311,100321,
 				   9010311,9010321,9020311,9020321,
 				   313,323,
 				   10313,10323,
 				   20313,20323,
 				   100313,100323,
 				   9000313,9000323,
 				   30313,30323,
 				   315,325,
 				   9000315,9000325,
 				   10315,10325,
 				   20315,20325,
 				   9010315,9010325,9020315,9020325,
 				   317,327,
 				   9010317,9010327};
   PhysConst::pdg_antistrangemesons = {above * -1.0};
   */
   int nstrangemesons = event->NumParticle(PhysConst::pdg_strangemesons);
   nstrangemesons += event->NumParticle(PhysConst::pdg_antistrangemesons);
   if (nstrangemesons < 1) return false;
 
   // Do we want any other signal?
   return true;
 };
 
diff --git a/src/MCStudies/T2K2017_FakeData.cxx b/src/MCStudies/T2K2017_FakeData.cxx
new file mode 100644
index 0000000..6ef7186
--- /dev/null
+++ b/src/MCStudies/T2K2017_FakeData.cxx
@@ -0,0 +1,243 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "T2K2017_FakeData.h"
+
+//********************************************************************
+/// @brief Class to perform MC Studies on a custom measurement
+T2K2017_FakeData::T2K2017_FakeData(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K2017 Event Kinematics MC Study \n" \
+                        "Target: CH/H2O \n" \
+                        "Flux: T2K numu flux \n" \
+                        "Signal: numuCC \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+
+  fSettings.SetTitle("T2K MC #nu_{#mu} CC");
+  fSettings.SetDescription(descrip);
+  fSettings.SetEnuRange(0.0, 6.0);
+  fSettings.DefineAllowedTargets("H,C,O");
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  fScaleFactor = GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.) / TotalIntegratedFlux();
+
+  // Setup some MC Histograms
+  const int nbin_x = 14;
+  const double binedge_x[15] = {0., 300., 400., 500., 600., 700., 800., 900., 1000., 1250., 1500., 2000., 3000., 5000., 30000.};
+  const int nbin_y = 10;
+  const double binedge_y[11] = { -1, 0.6, 0.7, 0.8, 0.85, 0.9, 0.92, 0.94, 0.96, 0.98, 1.};
+
+  fMCHist_FGD1NuMuCC0Pi = new TH2D((fName + "_FGD1NuMuCC0Pi_MC").c_str(),
+                                   (fName + "_FGD1NuMuCC0Pi_MC").c_str(),
+                                   nbin_x, binedge_x, nbin_y, binedge_y);
+
+  fMCHistPDG_FGD1NuMuCC0Pi = new TrueModeStack((fName + "_FGD1NuMuCC0Pi_MC_PDG").c_str(),
+      (fName + "_FGD1NuMuCC0Pi_MC_PDG").c_str(),
+      fMCHist_FGD1NuMuCC0Pi);
+
+  fMCFine_FGD1NuMuCC0Pi = new TH2D((fName + "_FGD1NuMuCC0Pi_MC_FINE").c_str(),
+                                   (fName + "_FGD1NuMuCC0Pi_MC_FINE").c_str(),
+                                   40, 0., 1000., 40, -1., 1.);
+
+  fMCFinePDG_FGD1NuMuCC0Pi = new TrueModeStack((fName + "_FGD1NuMuCC0Pi_MC_FINE_PDG").c_str(),
+      (fName + "_FGD1NuMuCC0Pi_MC_FINE_PDG").c_str(),
+      fMCFine_FGD1NuMuCC0Pi);
+
+  SetAutoProcessTH1(fMCHist_FGD1NuMuCC0Pi);
+  SetAutoProcessTH1(fMCHistPDG_FGD1NuMuCC0Pi);
+  SetAutoProcessTH1(fMCFine_FGD1NuMuCC0Pi);
+  SetAutoProcessTH1(fMCFinePDG_FGD1NuMuCC0Pi);
+
+  // Setup TTree to Save -------------------------------------------
+  SetEmptyData();
+
+  if (samplekey.Has("saveflattree")) {
+    fSaveEventTree = samplekey.GetI("saveflattree") > 0;
+  } else {
+    fSaveEventTree = false;
+  }
+
+
+  if (fSaveEventTree) {
+    fEventTree = new TTree("EventTree", "EventTree");
+    fEventTree->Branch("Enu", &fEnu, "Enu/D");
+
+    fEventTree->Branch("Tmu", &fTMu, "Tmu/D");
+    fEventTree->Branch("Cosmu", &fCosMu, "Cosmu/D");
+
+    fEventTree->Branch("Ppip", &fPPip, "Ppip/D");
+    fEventTree->Branch("Cospip", &fCosPip, "Cospip/D");
+    fEventTree->Branch("Ppim", &fPPim, "Ppim/D");
+    fEventTree->Branch("Cospim", &fCosPim, "Cospim/D");
+    fEventTree->Branch("Ppi0", &fPPi0, "Ppi0/D");
+    fEventTree->Branch("Cospi0", &fCosPi0, "Cospi0/D");
+
+    fEventTree->Branch("Mode", &fMode, "Mode/I");
+    fEventTree->Branch("NuPDG", &fNuPDG, "NuPDG/I");
+    fEventTree->Branch("ScaleFactor", &fScaleFactor, "ScaleFactor/D");
+  }
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
+
+//********************************************************************
+void T2K2017_FakeData::FillEventVariables(FitEvent *event) {
+//********************************************************************
+
+  // Reset Variables
+  fEnu    = -999.9;
+
+  fTMu    = -999.9;
+  fCosMu  = -999.9;
+
+  fPPip   = -999.9;
+  fCosPip = -999.9;
+  fPPim   = -999.9;
+  fCosPim = -999.9;
+  fPPi0   = -999.9;
+  fCosPi0 = -999.9;
+
+  fMode  = 0;
+  fNuPDG = 0;
+
+  // Get neutrino information
+  if (abs(event->PDGnu()) != 14) return;
+  FitParticle* nu = event->GetNeutrinoIn();
+  fEnu = nu->fP.E();
+
+
+  // Get Muon Information
+  if ((event->NumFSParticle(13) +
+       event->NumFSParticle(-13)) < 1) { return; }
+
+  FitParticle* muon = NULL;
+  if (nu->fPID == 14) {
+    muon = event->GetHMFSParticle(13);
+  } else if (nu->fPID == -14) {
+    muon = event->GetHMFSParticle(-13);
+  }
+  fTMu = FitUtils::T(muon->fP) * 1.E3;
+  fCosMu = cos(muon->fP.Vect().Angle(nu->fP.Vect()));
+
+
+
+  // Get Pion+ Information
+  if (event->NumFSParticle(211) >= 1) {
+
+    FitParticle* pionp = event->GetHMFSParticle(211);
+    fPPip   = pionp->fP.Vect().Mag();
+    fCosPip = cos(pionp->fP.Vect().Angle(nu->fP.Vect()));
+
+  }
+
+  // Get Pion- Information
+  if (event->NumFSParticle(-211) >= 1) {
+
+    FitParticle* pionm = event->GetHMFSParticle(-211);
+    fPPim   = pionm->fP.Vect().Mag();
+    fCosPim = cos(pionm->fP.Vect().Angle(nu->fP.Vect()));
+
+  }
+
+  // Get Pion0 Information
+  if (event->NumFSParticle(111) >= 1) {
+
+    FitParticle* pion0 = event->GetHMFSParticle(111);
+    fPPi0   = pion0->fP.Vect().Mag();
+    fCosPi0 = cos(pion0->fP.Vect().Angle(nu->fP.Vect()));
+
+  }
+
+
+  return;
+};
+
+//********************************************************************
+void T2K2017_FakeData::Write(std::string drawOpt) {
+//********************************************************************
+  if (fSaveEventTree) {
+    fEventTree->Write();
+  }
+
+  fMCHist_FGD1NuMuCC0Pi->Write();
+  fMCHistPDG_FGD1NuMuCC0Pi->Write();
+
+  fMCFine_FGD1NuMuCC0Pi->Write();
+  fMCFinePDG_FGD1NuMuCC0Pi->Write();
+
+
+  return;
+}
+
+// -------------------------------------------------------------------
+// Purely MC Plot
+// Following functions are just overrides to handle this
+// -------------------------------------------------------------------
+//********************************************************************
+/// Everything is classed as signal...
+bool T2K2017_FakeData::isSignal(FitEvent *event) {
+//********************************************************************
+
+  if (abs(event->PDGnu()) != 14) return false;
+  if ((event->NumFSParticle(13) +
+       event->NumFSParticle(-13)) < 1) { return false; }
+
+  return true;
+};
+
+
+//********************************************************************
+void T2K2017_FakeData::FillHistograms() {
+//********************************************************************
+
+  fMCHist_FGD1NuMuCC0Pi->Fill(fTMu, fCosMu, Weight);
+  fMCHistPDG_FGD1NuMuCC0Pi->Fill(Mode, fTMu, fCosMu, Weight);
+
+  fMCFine_FGD1NuMuCC0Pi->Fill(fTMu, fCosMu, Weight);
+  fMCFinePDG_FGD1NuMuCC0Pi->Fill(Mode, fTMu, fCosMu, Weight);
+
+  return;
+}
+
+//********************************************************************
+void T2K2017_FakeData::ResetAll() {
+  //********************************************************************
+  Measurement1D::ResetAll();
+
+  if (fSaveEventTree) {
+    fEventTree->Reset();
+  }
+  return;
+}
+
+//********************************************************************
+float T2K2017_FakeData::GetChi2() {
+  //********************************************************************
+  // No Likelihood to test, purely MC
+  return 0.0;
+}
diff --git a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h b/src/MCStudies/T2K2017_FakeData.h
old mode 100755
new mode 100644
similarity index 55%
copy from src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
copy to src/MCStudies/T2K2017_FakeData.h
index 212fec0..e2a2bb9
--- a/src/BNL/BNL_CCQE_Evt_1DQ2_nu.h
+++ b/src/MCStudies/T2K2017_FakeData.h
@@ -1,52 +1,92 @@
+
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef BNL_CCQE_Evt_1DQ2_NU_H_SEEN
-#define BNL_CCQE_Evt_1DQ2_NU_H_SEEN
-
+#ifndef T2K2017_FakeData_H_SEEN
+#define T2K2017_FakeData_H_SEEN
 #include "Measurement1D.h"
+#include "StandardStacks.h"
 
 //********************************************************************
-class BNL_CCQE_Evt_1DQ2_nu : public Measurement1D {
+class T2K2017_FakeData : public Measurement1D {
 //********************************************************************
 
 public:
 
-  BNL_CCQE_Evt_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~BNL_CCQE_Evt_1DQ2_nu() {};
-  
+  T2K2017_FakeData(nuiskey samplekey);
+  virtual ~T2K2017_FakeData() {};
+
+  //! Grab info from event
   void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
+
+  //! Fill Custom Histograms
   void FillHistograms();
-  void Write(std::string drawOpt);
+
+  //! ResetAll
   void ResetAll();
-  void ScaleEvents();
+
+  //! Scale
+  // void ScaleEvents();
+
+  //! Norm
+  void ApplyNormScale(float norm);
+
+  //! Define this samples signal
+  bool isSignal(FitEvent *nvect);
+
+  //! Write Files
+  void Write(std::string drawOpt);
+
+  //! Get Chi2
+  float GetChi2();
+
+  //! Fill all signal flags we currently have
+  void FillSignalFlags(FitEvent *event);
+
+  void AddEventVariablesToTree();
+  void AddSignalFlagsToTree();
 
  private:
 
-  double q2qe; ///< fXVar
-  bool applyQ2correction; ///< Deuterium-Nucleon Correction Flag
-  TH1D* CorrectionHist; ///< Deuterium-Nucleon Correction plot
-  TH1D* fMCHist_NoCorr; ///< Q2 fMCHist without Deut correction
-  double scaleF; ///< data/mc scaling value
-  TH2D* EnuVsQ2;
+ 	TTree* fEventTree;
+
+ 	double fTMu;
+ 	double fCosMu;
+ 	double fPPip;
+ 	double fCosPip;
+ 	double fPPim;
+ 	double fCosPim;
+ 	double fPPi0;
+ 	double fCosPi0;
+ 	double fEnu;
+ 	int fMode;
+ 	int fNuPDG;
+
+ 	bool fSaveEventTree;
+
+	TH2D* fMCHist_FGD1NuMuCC0Pi;
+	TH2D* fMCFine_FGD1NuMuCC0Pi;
+	TrueModeStack* fMCFinePDG_FGD1NuMuCC0Pi;
+	TrueModeStack* fMCHistPDG_FGD1NuMuCC0Pi;
+
+
 
 };
-  
+
 #endif
diff --git a/src/MINERvA/CMakeLists.txt b/src/MINERvA/CMakeLists.txt
index 8fc7396..c8b8028 100644
--- a/src/MINERvA/CMakeLists.txt
+++ b/src/MINERvA/CMakeLists.txt
@@ -1,122 +1,131 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 MINERvA_CCQE_XSec_1DQ2_antinu.cxx
 MINERvA_CCQE_XSec_1DQ2_joint.cxx
 MINERvA_CCQE_XSec_1DQ2_nu.cxx
 
 MINERvA_CC0pi_XSec_1DEe_nue.cxx
 MINERvA_CC0pi_XSec_1DQ2_nue.cxx
 MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx
 MINERvA_CC0pi_XSec_1DThetae_nue.cxx
 
 MINERvA_CC1pi0_XSec_1DEnu_antinu.cxx
 MINERvA_CC1pi0_XSec_1DQ2_antinu.cxx
 MINERvA_CC1pi0_XSec_1Dpmu_antinu.cxx
 MINERvA_CC1pi0_XSec_1Dppi0_antinu.cxx
 MINERvA_CC1pi0_XSec_1DTpi0_antinu.cxx
 MINERvA_CC1pi0_XSec_1Dth_antinu.cxx
 MINERvA_CC1pi0_XSec_1Dthmu_antinu.cxx
 
 MINERvA_CC1pip_XSec_1DTpi_20deg_nu.cxx
 MINERvA_CC1pip_XSec_1DTpi_nu.cxx
 MINERvA_CC1pip_XSec_1Dth_20deg_nu.cxx
 MINERvA_CC1pip_XSec_1Dth_nu.cxx
 
 MINERvA_CCNpip_XSec_1DEnu_nu.cxx
 MINERvA_CCNpip_XSec_1DQ2_nu.cxx
 MINERvA_CCNpip_XSec_1DTpi_nu.cxx
 MINERvA_CCNpip_XSec_1Dpmu_nu.cxx
 MINERvA_CCNpip_XSec_1Dth_nu.cxx
 MINERvA_CCNpip_XSec_1Dthmu_nu.cxx
 
 MINERvA_CCinc_XSec_2DEavq3_nu.cxx
 MINERvA_CCinc_XSec_1Dx_ratio.cxx
 MINERvA_CCinc_XSec_1DEnu_ratio.cxx
 MINERvA_CCinc_XSec_1Dx_nu.cxx
 MINERvA_CCinc_XSec_1DEnu_nu.cxx
 
+MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.cxx
+MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.cxx
+
 MINERvA_SignalDef.cxx
 )
 
 set(HEADERFILES
 MINERvA_CCQE_XSec_1DQ2_antinu.h
 MINERvA_CCQE_XSec_1DQ2_joint.h
 MINERvA_CCQE_XSec_1DQ2_nu.h
 
 MINERvA_CC0pi_XSec_1DEe_nue.h
 MINERvA_CC0pi_XSec_1DQ2_nue.h
 MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
 MINERvA_CC0pi_XSec_1DThetae_nue.h
 
 MINERvA_CC1pi0_XSec_1DEnu_antinu.h
 MINERvA_CC1pi0_XSec_1DQ2_antinu.h
 MINERvA_CC1pi0_XSec_1Dpmu_antinu.h
 MINERvA_CC1pi0_XSec_1Dppi0_antinu.h
 MINERvA_CC1pi0_XSec_1DTpi0_antinu.h
 MINERvA_CC1pi0_XSec_1Dth_antinu.h
 MINERvA_CC1pi0_XSec_1Dthmu_antinu.h
 
 MINERvA_CC1pip_XSec_1DTpi_20deg_nu.h
 MINERvA_CC1pip_XSec_1DTpi_nu.h
 MINERvA_CC1pip_XSec_1Dth_20deg_nu.h
 MINERvA_CC1pip_XSec_1Dth_nu.h
 
 MINERvA_CCNpip_XSec_1DEnu_nu.h
 MINERvA_CCNpip_XSec_1DQ2_nu.h
 MINERvA_CCNpip_XSec_1DTpi_nu.h
 MINERvA_CCNpip_XSec_1Dpmu_nu.h
 MINERvA_CCNpip_XSec_1Dth_nu.h
 MINERvA_CCNpip_XSec_1Dthmu_nu.h
 
 MINERvA_CCinc_XSec_2DEavq3_nu.h
 MINERvA_CCinc_XSec_1Dx_ratio.h
 MINERvA_CCinc_XSec_1DEnu_ratio.h
 MINERvA_CCinc_XSec_1Dx_nu.h
 MINERvA_CCinc_XSec_1DEnu_nu.h
 
+MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h
+MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h
+
 MINERvA_SignalDef.h
 )
 
 set(LIBNAME expMINERvA)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.cxx
index 4230889..b807165 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.cxx
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.cxx
@@ -1,94 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CC0pi_XSec_1DEe_nue.h"
 
 //********************************************************************
-MINERvA_CC0pi_XSec_1DEe_nue::MINERvA_CC0pi_XSec_1DEe_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CC0pi_XSec_1DEe_nue::MINERvA_CC0pi_XSec_1DEe_nue(nuiskey samplekey) {
 //********************************************************************
 
-  // Define Measurement
-  fName = "MINERvA_CC0pi_XSec_1DEe_nue";
-  fPlotTitles = "; E_{e} (GeV); d#sigma/dE_{e} (cm^{2}/GeV)";
-  EnuMin = 0.0;
-  EnuMax = 20.0;
-  fNormError = 0.101;
-  fDefaultTypes = "FIX/FULL";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Data File
-  std::string datafile = FitPar::GetDataBase()+"/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root";
-  std::string dist_name = "";
-
-  dist_name = "1DEe";
-  fPlotTitles = "; Q_{QE}^{2} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-
-  SetDataFromFile(datafile, "Data_" + dist_name);
-  SetCovarFromDataFile(datafile, "Covar_" + dist_name);
-
-  // Setup Default MC Hists
-  SetupDefaultHist();
-
-  // Convert covar from 1E-40 to 1E-38
-  *fDecomp *= (1.0 / 10.0);
-  *fFullCovar *= (1.0 / 100.0);
-  *covar *= (100.0);
-
-  // Different generators require slightly different rescaling factors.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/TotalIntegratedFlux();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA CC0pi nue Ee sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{e} (GeV)");
+  fSettings.SetYTitle("d#sigma/dE_{e} (cm^{2}/GeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 20.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA #nu_e CC0#pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Data_1DEe" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Covar_1DEe" );
+  fSettings.DefineAllowedSpecies("nue,nueb");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) / TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromRootFile(fSettings.GetCovarInput() );
+  ScaleCovar(1.0 / 100.0);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void MINERvA_CC0pi_XSec_1DEe_nue::FillEventVariables(FitEvent *event){
+void MINERvA_CC0pi_XSec_1DEe_nue::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(11) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pe   = event->GetHMFSParticle(11)->fP;
 
   Thetae   = Pnu.Vect().Angle(Pe.Vect());
-  Enu_rec  = FitUtils::EnuQErec(Pe, cos(Thetae), 34.,true);
-  Q2QEe    = FitUtils::Q2QErec(Pe, cos(Thetae), 34.,true);
-  Ee       = Pe.E()/1000.0;
+  Enu_rec  = FitUtils::EnuQErec(Pe, cos(Thetae), 34., true);
+  Q2QEe    = FitUtils::Q2QErec(Pe, cos(Thetae), 34., true);
+  Ee       = Pe.E() / 1000.0;
 
   fXVar = Ee;
   return;
 }
 
 
 
 //********************************************************************
-bool MINERvA_CC0pi_XSec_1DEe_nue::isSignal(FitEvent *event){
+bool MINERvA_CC0pi_XSec_1DEe_nue::isSignal(FitEvent *event) {
 //*******************************************************************
 
   // Check that this is a nue CC0pi event
   if (!SignalDef::isCC0pi(event, 12, EnuMin, EnuMax)) return false;
 
   // Electron Enrgy
   if (Ee < 0.5) return false;
 
   return true;
 };
 
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.h
index ee2db70..31ffc1f 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DEe_nue.h
@@ -1,48 +1,48 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERvA_CC0pi_XSec_1DEe_nue_H_SEEN
 #define MINERvA_CC0pi_XSec_1DEe_nue_H_SEEN
 
 #include "Measurement1D.h"
 
 //********************************************************************
 class MINERvA_CC0pi_XSec_1DEe_nue : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MINERvA_CC0pi_XSec_1DEe_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC0pi_XSec_1DEe_nue(nuiskey samplekey);
   virtual ~MINERvA_CC0pi_XSec_1DEe_nue() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 
   double Enu_rec;
   double Ee, Q2QEe, Thetae;
   bool anty_flag;
   bool nue_flag;
   bool bad_particle;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.cxx
new file mode 100644
index 0000000..3494bc7
--- /dev/null
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.cxx
@@ -0,0 +1,138 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "MINERvA_SignalDef.h"
+#include "MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h"
+
+
+//********************************************************************
+MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu::MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu sample. \n" \
+                        "Target: Target;CH (2 INPUTS)\n" \
+                        "Flux: MINERvA Forward Horn Current Numu \n" \
+    "Signal: Any event with 1 muon, 1 proton p>450, no pions";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle(" d#sigma/dQ^{2}_{QE} (cm^{2}/GeV^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX/DIAG,FULL/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 100.0);
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu");
+  
+  fIsRatio = true;
+  nBins = 5;
+
+  target  = "";
+  if (fSettings.Found("name", "TgtRatioFe")) target =   "Fe";
+  else if (fSettings.Found("name", "TgtRatioPb")) target =   "Pb";
+  else if      (fSettings.Found("name", "TgtRatioC")) target =   "C";
+  else {
+    ERR(FTL) << "target " << target << " was not found!" << std::endl;
+    exit(-1);
+  }
+
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CC0pi/";
+  fSettings.SetDataInput(  basedir + "Q2_TgtRatio_" + target + "_data.txt");
+  fSettings.SetCovarInput( basedir + "Q2_TgtRatio_" + target + "_covar.txt");
+  FinaliseSampleSettings();
+
+  // Get parsed input files
+  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA CC0pi ratio requires input files in format: NUMERATOR;DENOMINATOR" << std::endl;
+  std::string inFileNUM = fSubInFiles.at(0);
+  std::string inFileDEN = fSubInFiles.at(1);
+
+  // Scaling Setup ---------------------------------------------------
+  // Ratio of sub classes so non needed
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCorrelationFromTextFile(fSettings.GetCovarInput());
+
+
+  // Setup Experiments  -------------------------------------------------------
+  std::string type = samplekey.GetS("type");
+
+  nuiskey samplekey_num = Config::CreateKey("sample");
+  samplekey_num.AddS("name", "MINERvA_CC0pi_XSec_1DQ2_Tgt" + target + "_nu");
+  samplekey_num.AddS("input", inFileNUM);
+  samplekey_num.AddS("type", type);
+
+  nuiskey samplekey_den = Config::CreateKey("sample");
+  samplekey_den.AddS("name", "MINERvA_CC0pi_XSec_1DQ2_TgtCH_nu");
+  samplekey_den.AddS("input", inFileDEN);
+  samplekey_den.AddS("type", type);
+
+  NUM  = new MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(samplekey_num);
+  DEN  = new MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(samplekey_den);
+  NUM  ->SetNoData();
+  DEN  ->SetNoData();
+
+  // Add to chain for processing
+  this->fSubChain.clear();
+  this->fSubChain.push_back(NUM);
+  this->fSubChain.push_back(DEN);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
+
+//********************************************************************
+void MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu::MakePlots() {
+//********************************************************************
+
+  UInt_t sample = 0;
+  for (std::vector<MeasurementBase*>::const_iterator expIter = this->fSubChain.begin(); expIter != this->fSubChain.end(); expIter++) {
+    MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
+
+    if      (sample == 0) this->NUM = static_cast<MINERvA_CC0pi_XSec_1DQ2_Tgt_nu*>(exp);
+    else if (sample == 1) this->DEN = static_cast<MINERvA_CC0pi_XSec_1DQ2_Tgt_nu*>(exp);
+    else break;
+    sample++;
+  }
+
+  // Now make the ratio histogram
+  TH1D* NUM_MC = (TH1D*)this->NUM->GetMCList().at(0)->Clone();
+  TH1D* DEN_MC = (TH1D*)this->DEN->GetMCList().at(0)->Clone();
+
+  for (int i = 0; i < nBins; ++i) {
+    double binVal = 0;
+    double binErr = 0;
+
+    if (DEN_MC->GetBinContent(i + 1) && NUM_MC->GetBinContent(i + 1)) {
+      binVal = NUM_MC->GetBinContent(i + 1) / DEN_MC->GetBinContent(i + 1);
+      double fractErrNUM = NUM_MC->GetBinError(i + 1) / NUM_MC->GetBinContent(i + 1);
+      double fractErrDEN = DEN_MC->GetBinError(i + 1) / DEN_MC->GetBinContent(i + 1);
+      binErr = binVal * sqrt(fractErrNUM * fractErrNUM + fractErrDEN * fractErrDEN);
+    }
+
+    this->fMCHist->SetBinContent(i + 1, binVal);
+    this->fMCHist->SetBinError(i + 1, binErr);
+  }
+
+  return;
+}
+
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h
similarity index 67%
copy from src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h
copy to src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h
index c8e3aaa..c38c5c0 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu.h
@@ -1,57 +1,58 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef MINERVA_CCinc_XSec_1DEnu_ratio_H_SEEN
-#define MINERVA_CCinc_XSec_1DEnu_ratio_H_SEEN
+#ifndef MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu_H_SEEN
+#define MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu_H_SEEN
 
 // Fit Includes
 #include "MeasurementBase.h"
 #include "JointMeas1D.h"
-#include "MINERvA_CCinc_XSec_1DEnu_nu.h"
-
-class MINERvA_CCinc_XSec_1DEnu_ratio : public JointMeas1D {
+#include "MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h"
+
+///\brief MINERvA CC0pi1p Target Ratio Analysis : Q2 Distribution                
+///
+///\n [arXiv:1705.03791]                          
+///\n Input: Target events generated with all interaction modes with flux given in Ref.
+///   handles multiple targets : C, CH, Fe, Pb  
+class MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu : public JointMeas1D {
 public:
 
-  MINERvA_CCinc_XSec_1DEnu_ratio(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  virtual ~MINERvA_CCinc_XSec_1DEnu_ratio() {};
+  MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu(nuiskey samplekey);
+  virtual ~MINERvA_CC0pi_XSec_1DQ2_TgtRatio_nu() {};
 
   void MakePlots();
 
   // This is a dummy function as it is not required for the ratio (and does bad bad things)
   void ScaleEvents(){return;};;
 
-  void SetCovarMatrixFromText(std::string covarFile, int dim);
-
-  // Custom write function because the ratio has much more limited information available than normal.
-  void Write(std::string drawOpt);
-
  private:
 
   // This is a dummy, the signal is defined separately for each sample!
   bool isSignal(){return false;};  
 
   // Need to have the distributions for the numerator and denominator stored separately
-  MINERvA_CCinc_XSec_1DEnu_nu * NUM;
-  MINERvA_CCinc_XSec_1DEnu_nu * DEN;
+  MINERvA_CC0pi_XSec_1DQ2_Tgt_nu * NUM;
+  MINERvA_CC0pi_XSec_1DQ2_Tgt_nu * DEN;
+
   Int_t nBins;
   std::string target;
 
 };
   
 #endif
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.cxx
new file mode 100644
index 0000000..61ef849
--- /dev/null
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.cxx
@@ -0,0 +1,138 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include <string>
+#include <sstream>
+
+#include "MINERvA_SignalDef.h"
+#include "MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h"
+
+//********************************************************************
+MINERvA_CC0pi_XSec_1DQ2_Tgt_nu::MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC0pi_XSec_1DQ2_Tgt_nu sample. \n" \
+    "Target: Either C, CH, Fe, Pb \n"						    \
+    "Flux: MINERvA Forward Horn numu \n"
+    "Signal: Any event with 1 muon, 1 proton p>450, no pions";
+
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC0pi_XSec_1DQ2_Tgt_nu");
+  fSettings.DefineAllowedSpecies("numu");
+
+
+  // Set Target From name
+  if (fSettings.Found("name","_CH")){
+    fTarget = 1; // kTargetCH;
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_CH_data.txt");
+  } else if (fSettings.Found("name","TgtC")){
+    fTarget = 2; //kTargetC;
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_C_data.txt");
+    fSettings.SetCovarInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_C_covar.txt");
+  }  else if (fSettings.Found("name","TgtFe")){
+    fTarget = 3; //kTargetFe;
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_Fe_data.txt");
+    fSettings.SetCovarInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_Fe_covar.txt");
+  } else if (fSettings.Found("name","TgtPb")){
+    fTarget = 4; //kTargetPb;
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_Pb_data.txt");
+    fSettings.SetCovarInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/Q2_Tgt_Pb_covar.txt");
+  } else {
+    ERR(FTL) << "Target not found in name! " << std::endl;
+    throw;
+  }
+
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  if (fTarget == 1){
+    SetCovarFromDiagonal(fDataHist);
+  } else {
+    SetCorrelationFromTextFile(fSettings.GetCovarInput() );
+  }
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
+
+void MINERvA_CC0pi_XSec_1DQ2_Tgt_nu::FillEventVariables(FitEvent *event){
+
+  // Has NuMuCC1p
+  if (event->HasISNuMuon() &&
+      event->HasFSMuon() &&
+      event->HasFSProton()){
+
+    TLorentzVector pnu    = event->GetHMISNuMuon()->fP;
+    TLorentzVector pprot  = event->GetHMFSProton()->fP;
+    TLorentzVector pmu    = event->GetHMFSMuon()->fP;
+
+    // Q2QE rec from leading proton assuming 34 MeV Eb
+    double protmax = pprot.E();
+    double q2qe    = FitUtils::ProtonQ2QErec(protmax, 34.);
+
+    // Coplanar is angle between muon and proton plane
+    TVector3 plnprotnu = pprot.Vect().Cross(pnu.Vect());
+    TVector3 plnmunu   = pmu.Vect().Cross(pnu.Vect());
+    double copl        = plnprotnu.Angle(plnmunu);
+
+    // Fill X Variables
+    fXVar = q2qe;
+
+    // Save Coplanar into spare y variable
+    fYVar = copl;
+  }
+
+  return;
+};
+
+
+bool MINERvA_CC0pi_XSec_1DQ2_Tgt_nu::isSignal(FitEvent *event){
+
+  // IS NuMu + FS Muon
+  if (!event->HasISNuMuon()) return false;
+  if (!event->HasFSMuon()) return false;
+
+  // No Pions
+  if (!SignalDef::isCC0pi(event, 14, EnuMin, EnuMax)) return false;
+
+  // Proton Threshold
+  if (!SignalDef::HasProtonMomAboveThreshold(event, 450.0)){
+    return false;
+  }
+
+  return true;
+};
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h
similarity index 68%
copy from src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
copy to src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h
index 8c35a6c..4931574 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_Tgt_nu.h
@@ -1,64 +1,62 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#ifndef MINERVA_1DQ2_nu_proton_H_SEEN
-#define MINERVA_1DQ2_nu_proton_H_SEEN
+#ifndef MINERVA_CC0pi_XSec_1DQ2_Tgt_nu_H_SEEN
+#define MINERVA_CC0pi_XSec_1DQ2_Tgt_nu_H_SEEN
 #include "Measurement1D.h"
 
-///\brief MINERvA CC0pi1p Analysis : Q2 Distribution
+///\brief MINERvA CC0pi1p Target Ratio Analysis : Q2 Distribution
 ///
-///\n Ref: Phys. Rev. D 91, 071301 (2015) [arXiv:1409.4497]
-///\n Input: CH events generated with all interaction modes with flux given in Ref.
-class MINERvA_CC0pi_XSec_1DQ2_nu_proton : public Measurement1D {
+///\n [arXiv:1705.03791]
+///\n Input: Target events generated with all interaction modes with flux given in Ref.
+///   handles multiple targets : C, CH, Fe, Pb
+class MINERvA_CC0pi_XSec_1DQ2_Tgt_nu : public Measurement1D {
 public:
 
   ///\brief Setup data histograms, full covariance matrix and coplanar histogram.
   ///\n Available fit options: FIX/FULL,DIAG
   ///\n Sample is given as /nucleon.
   ///
   ///\n Valid Sample Names:
-  ///\n 1. MINERvA_CC0pi_XSec_1DQ2_nu_proton - Main analysis
-  MINERvA_CC0pi_XSec_1DQ2_nu_proton(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
-  virtual ~MINERvA_CC0pi_XSec_1DQ2_nu_proton() {};
+  ///\n 1. MINERvA_CC0pi_XSec_1DQ2_Tgt_nu - Main analysis
+  MINERvA_CC0pi_XSec_1DQ2_Tgt_nu(nuiskey samplekey);
+  virtual ~MINERvA_CC0pi_XSec_1DQ2_Tgt_nu() {};
 
   ///\brief Signal is CC0pi1p
   ///
   ///\n 1. CC0pi Selection
-  ///\n 2. Proton above 110 MeV
-  ///\n 3. Muon Angle < 20deg
-  ///\n 4. 1.5 < Enu < 100.0
+  ///\n 2. Proton above 450 MeV
   bool isSignal(FitEvent* event);
 
   ///\brief Determine Q2 from the leading proton
   void FillEventVariables(FitEvent *event);
 
   ///\brief Calculate Extra Weight (Not necessary)
   inline double CalcSampleWeight(FitEvent* event){ return 1.0; }
 
-  ///\brief Handling setup for extra histograms
-  bool SortExtraPlots(int state);
-
  private:
 
   TH1D* fCoplanarMCHist;   /// MC Coplanar Distribution
   TH1D* fCoplanarDataHist; /// Data Coplanar Distribution
+  int fTarget;
+  
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx
index ac3abf6..312fc99 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx
@@ -1,125 +1,99 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include <string>
 #include <sstream>
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CC0pi_XSec_1DQ2_nu_proton.h"
 
-MINERvA_CC0pi_XSec_1DQ2_nu_proton::MINERvA_CC0pi_XSec_1DQ2_nu_proton(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
-
-  // Setup Measurement
-  fName         = "MINERvA_CC0pi_XSec_1DQ2_nu_proton";
-  fPlotTitles   = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2})";
-  fDefaultTypes = "FIX/FULL";
-  fAllowedTypes = "FIX/FULL,DIAG";
-  fNormError    = 0.100;
-  EnuMin        = 0.;
-  EnuMax        = 100.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Data
-  SetDataValues( FitPar::GetDataBase()+"/MINERvA/CCQE/proton_Q2QE_nu_data.txt" );
-  SetCovarMatrixFromText(FitPar::GetDataBase()+"/MINERvA/CCQE/proton_Q2QE_nu_covar.txt", 7);
-  SetupDefaultHist();
-
-  // Quick Fix for Correl/Covar Issues
-  fCorrel = (TMatrixDSym*)fFullCovar->Clone();
-  delete fFullCovar;
-  delete covar;
-  delete fDecomp;
-  fFullCovar = StatUtils::GetCovarFromCorrel(fCorrel,fDataHist);
-  (*fFullCovar) *= 1E76;
-  covar = StatUtils::GetInvert(fFullCovar);
-  fDecomp = StatUtils::GetDecomp(fFullCovar);
-
-  // Setup Coplanar Hist
-  fCoplanarMCHist   = NULL;
-  fCoplanarDataHist = NULL;
-
-  // Setup a scaling factor for evt->xsec
+//********************************************************************
+MINERvA_CC0pi_XSec_1DQ2_nu_proton::MINERvA_CC0pi_XSec_1DQ2_nu_proton(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC0pi_XSec_1DQ2_nu_proton sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC0pi_XSec_1DQ2_nu_proton");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCQE/proton_Q2QE_nu_data.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCQE/proton_Q2QE_nu_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
   fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/TotalIntegratedFlux();
-};
 
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCorrelationFromTextFile(fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 void MINERvA_CC0pi_XSec_1DQ2_nu_proton::FillEventVariables(FitEvent *event){
 
   // Has NuMuCC1p
   if (event->HasISNuMuon() &&
       event->HasFSMuon() &&
       event->HasFSProton()){
 
     TLorentzVector pnu    = event->GetHMISNuMuon()->fP;
     TLorentzVector pprot  = event->GetHMFSProton()->fP;
     TLorentzVector pmu    = event->GetHMFSMuon()->fP;
 
     // Q2QE rec from leading proton assuming 34 MeV Eb
     double protmax = pprot.E();
     double q2qe    = FitUtils::ProtonQ2QErec(protmax, 34.);
 
     // Coplanar is angle between muon and proton plane
     TVector3 plnprotnu = pprot.Vect().Cross(pnu.Vect());
     TVector3 plnmunu   = pmu.Vect().Cross(pnu.Vect());
     double copl        = plnprotnu.Angle(plnmunu);
 
     // Fill X Variables
     fXVar = q2qe;
 
     // Save Coplanar into spare y variable
     fYVar = copl;
   }
 
   return;
 };
 
 
 bool MINERvA_CC0pi_XSec_1DQ2_nu_proton::isSignal(FitEvent *event){
   return SignalDef::isCC0pi1p_MINERvA(event, EnuMin*1.E3, EnuMax*1.E3);
 };
-
-
-bool MINERvA_CC0pi_XSec_1DQ2_nu_proton::SortExtraPlots(int state){
-
-  switch(state){
-
-  // Reset Histograms at start of event loop
-  case kExtraPlotReset:
-    fCoplanarMCHist->Reset();
-    break;
-
-  // Fill calls for extra histograms on each event
-  case kExtraPlotFill:
-    fCoplanarMCHist->Fill(fYVar, Weight);
-    break;
-
-  // Extra handling for histograms after event loop
-  case kExtraPlotConvert:
-    fCoplanarMCHist->Scale( fCoplanarDataHist->Integral() / fCoplanarMCHist->Integral() );
-    break;
-
-  // Save the extra histograms
-  case kExtraPlotWrite:
-    fCoplanarMCHist->Write();
-    break;
-  }
-
-  return true;
-}
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
index 8c35a6c..b8e4ed7 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nu_proton.h
@@ -1,64 +1,61 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_1DQ2_nu_proton_H_SEEN
 #define MINERVA_1DQ2_nu_proton_H_SEEN
 #include "Measurement1D.h"
 
 ///\brief MINERvA CC0pi1p Analysis : Q2 Distribution
 ///
 ///\n Ref: Phys. Rev. D 91, 071301 (2015) [arXiv:1409.4497]
 ///\n Input: CH events generated with all interaction modes with flux given in Ref.
 class MINERvA_CC0pi_XSec_1DQ2_nu_proton : public Measurement1D {
 public:
 
   ///\brief Setup data histograms, full covariance matrix and coplanar histogram.
   ///\n Available fit options: FIX/FULL,DIAG
   ///\n Sample is given as /nucleon.
   ///
   ///\n Valid Sample Names:
   ///\n 1. MINERvA_CC0pi_XSec_1DQ2_nu_proton - Main analysis
-  MINERvA_CC0pi_XSec_1DQ2_nu_proton(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC0pi_XSec_1DQ2_nu_proton(nuiskey samplekey);
   virtual ~MINERvA_CC0pi_XSec_1DQ2_nu_proton() {};
 
   ///\brief Signal is CC0pi1p
   ///
   ///\n 1. CC0pi Selection
   ///\n 2. Proton above 110 MeV
   ///\n 3. Muon Angle < 20deg
   ///\n 4. 1.5 < Enu < 100.0
   bool isSignal(FitEvent* event);
 
   ///\brief Determine Q2 from the leading proton
   void FillEventVariables(FitEvent *event);
 
   ///\brief Calculate Extra Weight (Not necessary)
   inline double CalcSampleWeight(FitEvent* event){ return 1.0; }
 
-  ///\brief Handling setup for extra histograms
-  bool SortExtraPlots(int state);
-
  private:
 
   TH1D* fCoplanarMCHist;   /// MC Coplanar Distribution
   TH1D* fCoplanarDataHist; /// Data Coplanar Distribution
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.cxx
index d9c3af9..3768710 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.cxx
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.cxx
@@ -1,95 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CC0pi_XSec_1DQ2_nue.h"
 
 //********************************************************************
-MINERvA_CC0pi_XSec_1DQ2_nue::MINERvA_CC0pi_XSec_1DQ2_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CC0pi_XSec_1DQ2_nue::MINERvA_CC0pi_XSec_1DQ2_nue(nuiskey samplekey) {
 //********************************************************************
 
-  // Define Measurement
-  fName = "MINERvA_CC0pi_XSec_1DQ2_nue";
-  fPlotTitles = "; E_{e} (GeV); d#sigma/dE_{e} (cm^{2}/GeV)";
-  EnuMin = 0.0;
-  EnuMax = 15.0;
-  fNormError = 0.101;
-  fDefaultTypes = "FIX/FULL";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Data File
-  std::string datafile = FitPar::GetDataBase()+"/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root";
-  std::string dist_name = "";
-
-  dist_name = "1DQ2";
-  fPlotTitles = "; Q_{QE}^{2} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-
-  SetDataFromFile(datafile, "Data_" + dist_name);
-  SetCovarFromDataFile(datafile, "Covar_" + dist_name);
-
-  // Covariance is given in 1E-40, convert to 1E-38
-  *fDecomp *= (1.0 / 10.0);
-  *fFullCovar *= (1.0 / 100.0);
-  *covar *= (100.0);
-
-  // Setup Default MC Hists
-  SetupDefaultHist();
-
-  // Different generators require slightly different rescaling factors.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC0pi_XSec_1DQ2_nue sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{e} (GeV)");
+  fSettings.SetYTitle("d#sigma/dQ^{2}_{e} (cm^{2}/GeV)^{2}");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 20.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC0pi_XSec_1DQ2_nue");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Data_1DQ2" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Covar_1DQ2" );
+  fSettings.DefineAllowedSpecies("nue,nueb");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) / TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromRootFile(fSettings.GetCovarInput() );
+  ScaleCovar(1.0 / 100.0);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
 void MINERvA_CC0pi_XSec_1DQ2_nue::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   if (event->NumFSParticle(11) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pe   = event->GetHMFSParticle(11)->fP;
 
   Thetae   = Pnu.Vect().Angle(Pe.Vect());
   Enu_rec  = FitUtils::EnuQErec(Pe, cos(Thetae), 34.,true);
   Q2QEe    = FitUtils::Q2QErec(Pe, cos(Thetae), 34.,true);
   Ee       = Pe.E()/1000.0;
 
   fXVar = Q2QEe;
-  LOG(EVT) << "fXVar = "<<fXVar<<std::endl;
   return;
 }
 
 
 
 //********************************************************************
 bool MINERvA_CC0pi_XSec_1DQ2_nue::isSignal(FitEvent *event){
 //*******************************************************************
 
   // Check that this is a nue CC0pi event
   if (!SignalDef::isCC0pi(event, 12, EnuMin, EnuMax)) return false;
 
   // Restrct Ee
   if (Ee < 0.5) return false;
 
   return true;
 };
 
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.h
index 5628606..8e61336 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DQ2_nue.h
@@ -1,48 +1,48 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERvA_CC0pi_XSec_1DQ2_nue_H_SEEN
 #define MINERvA_CC0pi_XSec_1DQ2_nue_H_SEEN
 
 #include "Measurement1D.h"
 
 //********************************************************************
 class MINERvA_CC0pi_XSec_1DQ2_nue : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MINERvA_CC0pi_XSec_1DQ2_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC0pi_XSec_1DQ2_nue(nuiskey samplekey);
   virtual ~MINERvA_CC0pi_XSec_1DQ2_nue() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 
   double Enu_rec;
   double Ee, Q2QEe, Thetae;
   bool anty_flag;
   bool nue_flag;
   bool bad_particle;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.cxx b/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.cxx
index 2ea0a24..e1bb244 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.cxx
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.cxx
@@ -1,93 +1,98 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC0pi_XSec_1DThetae_nue.h"
 
+
 //********************************************************************
-MINERvA_CC0pi_XSec_1DThetae_nue::MINERvA_CC0pi_XSec_1DThetae_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CC0pi_XSec_1DThetae_nue::MINERvA_CC0pi_XSec_1DThetae_nue(nuiskey samplekey) {
 //********************************************************************
 
-  // Define Measurement
-  fName = "MINERvA_CC0pi_XSec_1DThetae_nue";
-  fPlotTitles = "; E_{e} (GeV); d#sigma/dE_{e} (cm^{2}/GeV)";
-  EnuMin = 0.0;
-  EnuMax = 10.0;
-  fNormError = 0.101;
-  fDefaultTypes = "FIX/FULL";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Data File
-  std::string datafile = FitPar::GetDataBase()+"/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root";
-  std::string dist_name = "";
-
-  dist_name = "1DThetae";
-  fPlotTitles = "; Q_{QE}^{2} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-
-  SetDataFromFile(datafile, "Data_" + dist_name);
-  SetCovarFromDataFile(datafile, "Covar_" + dist_name);
-
-  // Convert covar from 1E-40 to 1E-38
-  *fDecomp *= (1.0 / 10.0);
-  *fFullCovar *= (1.0 / 100.0);
-  *covar *= (100.0);
-
-  // Setup Default MC Hists
-  SetupDefaultHist();
-
-  // Different generators require slightly different rescaling factors.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC0pi_XSec_1DThetae_nue sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#theta_{e}");
+  fSettings.SetYTitle("d#sigma/d#theta_{e} (cm^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 20.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA #nu_e CC0#pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Data_1DThetae" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CC0pi/MINERvA_CC0pi_nue_Data_ARX1509_05729.root;Covar_1DThetae" );
+  fSettings.DefineAllowedSpecies("nue,nueb");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) / TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromRootFile(fSettings.GetCovarInput() );
+  ScaleCovar(1.0 / 100.0);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
 void MINERvA_CC0pi_XSec_1DThetae_nue::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   if (event->NumFSParticle(11) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pe   = event->GetHMFSParticle(11)->fP;
 
   Thetae   = Pnu.Vect().Angle(Pe.Vect()) * 180. / TMath::Pi();
   Ee       = Pe.E()/1000.0;
 
   fXVar = Thetae;
   LOG(EVT) << "fXVar = "<<fXVar<<std::endl;
   return;
 }
 
 
 
 //********************************************************************
 bool MINERvA_CC0pi_XSec_1DThetae_nue::isSignal(FitEvent *event){
 //*******************************************************************
 
   // Check this is a nue CC0pi event
   if (!SignalDef::isCC0pi(event, 12, EnuMin, EnuMax)) return false;
 
   // Restrict EE
   if (Ee < 0.5) return false;
 
   return true;
 };
 
diff --git a/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.h b/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.h
index 0497eb9..ce7cb33 100644
--- a/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.h
+++ b/src/MINERvA/MINERvA_CC0pi_XSec_1DThetae_nue.h
@@ -1,48 +1,48 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERvA_CC0pi_XSec_1DThetae_nue_H_SEEN
 #define MINERvA_CC0pi_XSec_1DThetae_nue_H_SEEN
 
 #include "Measurement1D.h"
 
 //********************************************************************
 class MINERvA_CC0pi_XSec_1DThetae_nue : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MINERvA_CC0pi_XSec_1DThetae_nue(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC0pi_XSec_1DThetae_nue(nuiskey samplekey);
   virtual ~MINERvA_CC0pi_XSec_1DThetae_nue() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 
   double Enu_rec;
   double Ee, Q2QEe, Thetae;
   bool anty_flag;
   bool nue_flag;
   bool bad_particle;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.cxx
index 8f18426..06fd78c 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.cxx
@@ -1,90 +1,108 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1DEnu_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1DEnu_antinu::MINERvA_CC1pi0_XSec_1DEnu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
 
-  fName = "MINERvA_CC1pi0_XSec_1DEnu_antinu";
-  fPlotTitles = "; E_{#nu} (GeV); d#sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-enu.csv");
+//********************************************************************
+MINERvA_CC1pi0_XSec_1DEnu_antinu::MINERvA_CC1pi0_XSec_1DEnu_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  // Error is given as percentage of cross-section
-  // Need to scale the bin error properly before we do correlation -> covariance conversion
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1DEnu_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#mu} (GeV)");
+  fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1DEnu_antinu");
+  fSettings.DefineAllowedSpecies("numu");
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-enu.csv");
   for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
     fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
   }
 
-  // This is a correlation matrix, changed to covariance in SetCovarMatrixFromText
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-enu.csv", fDataHist->GetNbinsX());
-  this->SetupDefaultHist();
+  SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-enu.csv");
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents);
 };
 
+
+
 void MINERvA_CC1pi0_XSec_1DEnu_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(-13) == 0) return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double Enu     = -999;
 
   if (hadMass < 1800)
     Enu = Pnu.E()/1000.;
 
   fXVar = Enu;
 
   return;
 };
 
 // **************************************
 // MINERvA CC1pi0 in anti-neutrino mode
 // Unfortunately there's no information on the neutrino component which is
 // subtracted off
 //
 // 2014 analysis:
 //                Exactly one positive muon
 //                Exactly one observed pi0
 //                No pi+/pi allowed
 //                No information on what is done with mesons, oops?
 //                No information on what is done with nucleons, oops?
 //
 // 2016 analysis:
 //                Exactly one positive muon
 //                Exactly one observed pi0
 //                No other mesons
 //                No restriction on number of nucleons
 //
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1DEnu_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.h
index 3325367..9bcbb58 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DEnu_antinu.h
@@ -1,36 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DENU_NU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1DEnu_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1DEnu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1DEnu_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1DEnu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.cxx
index 3f04a17..ad136b8 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.cxx
@@ -1,74 +1,91 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1DQ2_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1DQ2_antinu::MINERvA_CC1pi0_XSec_1DQ2_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "MINERvA_CC1pi0_XSec_1DQ2_antinu";
-  fPlotTitles = "; Q^{2} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/(GeV^{2})/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-q2.csv");
+//********************************************************************
+MINERvA_CC1pi0_XSec_1DQ2_antinu::MINERvA_CC1pi0_XSec_1DQ2_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  // Error is given as percentage of cross-section
-  // Need to scale the bin error properly before we do correlation -> covariance conversion
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1DQ2_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \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})/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1DQ2_antinu");
+  fSettings.DefineAllowedSpecies("numu");
+  // fFluxCorrected = fSettings.Found("name", "fluxcorr");
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-q2.csv");
   for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
     fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
   }
 
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-q2.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-q2.csv");
 
-
-  this->SetupDefaultHist();
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
+
 void MINERvA_CC1pi0_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(-13) == 0) return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double Q2      = -999;
 
   if (hadMass < 1800) {
     Q2 = -1*(Pnu-Pmu).Mag2()/1.E6;
   }
 
   fXVar = Q2;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1DQ2_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.h
index cd9543f..d0cf6fd 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DQ2_antinu.h
@@ -1,17 +1,17 @@
 #ifndef MINERVA_CC1PI0_XSEC_1DQ2_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DQ2_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1DQ2_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1DQ2_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1DQ2_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1DQ2_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.cxx
index 35a686f..43e4749 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.cxx
@@ -1,76 +1,97 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1DTpi0_antinu.h"
 
 // The 2016 MINERvA measurement is in Tpi
 // The 2016 MINERvA measurement is in ppi
 
-// The constructor
-MINERvA_CC1pi0_XSec_1DTpi0_antinu::MINERvA_CC1pi0_XSec_1DTpi0_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
-
-  fName = "MINERvA_CC1pi0_XSec_1DTpi0_antinu";
-  fPlotTitles = "; T_{#pi} (GeV); d#sigma/dT_{#pi} (cm^{2}/GeV/nucleon)";
-  fIsDiag = false;
-  EnuMin = 1.5;
-  EnuMax = 10;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-pion-kinetic-energy.csv");
-
-  // Error is given as percentage of cross-section
-  // Need to scale the bin error properly before we do correlation -> covariance conversion
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-    fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
+
+//********************************************************************
+MINERvA_CC1pi0_XSec_1DTpi0_antinu::MINERvA_CC1pi0_XSec_1DTpi0_antinu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1DTpi0_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#pi} (GeV)");
+  fSettings.SetYTitle("d#sigma/dT_{#pi} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1DTpi0_antinu");
+  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(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-pion-kinetic-energy.csv");
+
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1)*fDataHist->GetBinError(i + 1) / 100.);
   }
 
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-pion-kinetic-energy.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-pion-kinetic-energy.csv");
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
+
 void MINERvA_CC1pi0_XSec_1DTpi0_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(-13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double Tpi0 = -999;
 
   if (hadMass < 1800)
     Tpi0 = FitUtils::T(Ppi0);
 
   fXVar = Tpi0;
 
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1DTpi0_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.h
index 63927fa..97b1d52 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1DTpi0_antinu.h
@@ -1,36 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DTpi0_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DTpi0_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1DTpi0_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1DTpi0_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1DTpi0_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1DTpi0_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.cxx
index 500a9cb..af4c77d 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.cxx
@@ -1,71 +1,89 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1Dpmu_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1Dpmu_antinu::MINERvA_CC1pi0_XSec_1Dpmu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "MINERvA_CC1pi0_XSec_1Dpmu_antinu";
-  fPlotTitles = "; p_{#mu} (GeV); d#sigma/dp_{#mu} (cm^{2}/GeV/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-muon-momentum.csv");
+//********************************************************************
+MINERvA_CC1pi0_XSec_1Dpmu_antinu::MINERvA_CC1pi0_XSec_1Dpmu_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  // Error is given as percentage of cross-section
-  // Need to scale the bin error properly before we do correlation -> covariance conversion
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1Dpmu_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#mu} (GeV)");
+  fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1Dpmu_antinu");
+  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(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-muon-momentum.csv");
   for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
     fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
   }
 
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-muon-momentum.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-muon-momentum.csv");
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
 void MINERvA_CC1pi0_XSec_1Dpmu_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(-13) == 0) return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double pmu     = -999;
 
   if (hadMass < 1800)
     pmu = FitUtils::p(Pmu);
 
   fXVar = pmu;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1Dpmu_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.h
index 9507685..64c1fd4 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dpmu_antinu.h
@@ -1,36 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DPMU_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DPMU_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1Dpmu_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1Dpmu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1Dpmu_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1Dpmu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.cxx
index 39a722e..c22c6fd 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.cxx
@@ -1,75 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1Dppi0_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1Dppi0_antinu::MINERvA_CC1pi0_XSec_1Dppi0_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "MINERvA_CC1pi0_XSec_1Dppi0_antinu";
-  fPlotTitles = "; p_{#pi^{0}} (GeV/c); d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = true;
-  fNormError = 0.15;
-  fAllowedTypes += "NEW";
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2015/ccpi0_ppi0.csv");
+//********************************************************************
+MINERvA_CC1pi0_XSec_1Dppi0_antinu::MINERvA_CC1pi0_XSec_1Dppi0_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
-  // Please change when MINERvA releases new data!
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1)*1.11);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1Dppi0_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi^{0}} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1Dppi0_antinu");
+  fSettings.DefineAllowedSpecies("numu");
+  fFluxCorrected = fSettings.Found("name", "fluxcorr");
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2015/ccpi0_ppi0.csv");
+  SetCovarFromDiagonal();
+
+  if (fFluxCorrected) {
+    // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
+    // Please change when MINERvA releases new data!
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
+    }
   }
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 void MINERvA_CC1pi0_XSec_1Dppi0_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(-13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   // 2015 does pion momentum in GeV
   double ppi0 = FitUtils::p(Ppi0);
 
   fXVar = ppi0;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1Dppi0_antinu::isSignal(FitEvent *event) {
   //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.h
index 65b1b3e..7091e47 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dppi0_antinu.h
@@ -1,37 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DPPI0_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DPPI0_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1Dppi0_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1Dppi0_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1Dppi0_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1Dppi0_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   bool fUpdatedData;
+  bool fFluxCorrected;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.cxx
index a8e4d9b..c27feb3 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.cxx
@@ -1,103 +1,127 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1Dth_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1Dth_antinu::MINERvA_CC1pi0_XSec_1Dth_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
 
-  fName = name;
-  fPlotTitles = "; #theta_{#pi} (degrees); d#sigma/d#theta_{#pi} (cm^{2}/degrees/nucleon)";
-  fUpdatedData = fName.find("2015") == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10;
-
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+MINERvA_CC1pi0_XSec_1Dth_antinu::MINERvA_CC1pi0_XSec_1Dth_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  if (fUpdatedData){
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1Dth_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("d#sigma(E_{#nu}) (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fUpdatedData = !fSettings.Found("name", "2015");
+  fFluxCorrection = fSettings.Found("name","fluxcorr");
+  
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1Dth_antinu");
+  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 -------------------------------------------------------
+  if (fUpdatedData) {
 
     hadMassCut = 1800;
     fIsDiag = false;
 
-    this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-pion-angle.csv");
+    SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-pion-angle.csv");
 
     // Error is given as percentage of cross-section
     // Need to scale the bin error properly before we do correlation -> covariance conversion
-    for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-      fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1)*fDataHist->GetBinError(i + 1) / 100.);
     }
 
-    this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-pion-angle.csv", fDataHist->GetNbinsX());
+    SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-pion-angle.csv");
 
   } else {
 
     // Although the covariance is given for MINERvA CC1pi0 nubar from 2015, it doesn't Cholesky decompose, hinting at something bad
     // I've tried adding small numbers to the diagonal but it still didn't work and the chi2s are crazy
     fIsDiag = true;
     fNormError = 0.15;
     // No hadronic mass cut on old publication
     hadMassCut = 99999;
 
-    this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2015/ccpi0_th.csv");
-    this->SetupDefaultHist();
+    SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2015/ccpi0_th.csv");
+    SetCovarFromDiagonal();
 
-    // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
-    // Please change when MINERvA releases new data!
-    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-      fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1)*1.11);
-    }
 
-    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-    covar     = StatUtils::GetInvert(fFullCovar);
   } // end special treatment depending on release year
 
-  this->SetupDefaultHist();
 
+  if (fFluxCorrection) {
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
+    }
+
+  }
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
+
 void MINERvA_CC1pi0_XSec_1Dth_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(-13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double th      = -999;
 
   if (hadMass < hadMassCut)
-    th = (180./M_PI)*FitUtils::th(Pnu, Ppi0);
+    th = (180. / M_PI) * FitUtils::th(Pnu, Ppi0);
 
   fXVar = th;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1Dth_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.h
index a768827..10b781b 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dth_antinu.h
@@ -1,39 +1,40 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DTH_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DTH_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1Dth_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1Dth_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1Dth_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1Dth_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   double hadMassCut;
   bool fUpdatedData;
+  bool fFluxCorrection;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.cxx b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.cxx
index a06fb72..04533bb 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.cxx
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.cxx
@@ -1,72 +1,90 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pi0_XSec_1Dthmu_antinu.h"
 
-// The constructor
-MINERvA_CC1pi0_XSec_1Dthmu_antinu::MINERvA_CC1pi0_XSec_1Dthmu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "MINERvA_CC1pi0_XSec_1Dthmu_antinu";
-  fPlotTitles = "; #theta_{#mu}; d#sigma/d#theta_{#mu} (cm^{2}/degrees/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-muon-angle.csv");
+//********************************************************************
+MINERvA_CC1pi0_XSec_1Dthmu_antinu::MINERvA_CC1pi0_XSec_1Dthmu_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  // Error is given as percentage of cross-section
-  // Need to scale the bin error properly before we do correlation -> covariance conversion
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pi0_XSec_1Dthmu_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#theta_{#mu}");
+  fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2}/degrees/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CC1pi0_XSec_1Dthmu_antinu");
+  fSettings.DefineAllowedSpecies("numu");
+  fFluxCorrected = fSettings.Found("name", "fluxcorr");
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pi0/2016/anu-cc1pi0-xsec-muon-angle.csv");
   for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
     fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*fDataHist->GetBinError(i+1)/100.);
   }
 
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-muon-angle.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pi0/2016/anu-cc1pi0-correlation-muon-angle.csv");
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 void MINERvA_CC1pi0_XSec_1Dthmu_antinu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(-13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double thmu    = -999;
 
   if (hadMass < 1800)
     thmu = (180./M_PI)*FitUtils::th(Pnu, Pmu);
 
   fXVar = thmu;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pi0_XSec_1Dthmu_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, -14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.h b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.h
index 957acbe..e1bc2f4 100644
--- a/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.h
+++ b/src/MINERvA/MINERvA_CC1pi0_XSec_1Dthmu_antinu.h
@@ -1,36 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PI0_XSEC_1DTHMU_ANTINU_H_SEEN
 #define MINERVA_CC1PI0_XSEC_1DTHMU_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pi0_XSec_1Dthmu_antinu : public Measurement1D {
 public:
-  MINERvA_CC1pi0_XSec_1Dthmu_antinu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pi0_XSec_1Dthmu_antinu(nuiskey samplekey);
   virtual ~MINERvA_CC1pi0_XSec_1Dthmu_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
-
+  bool fFluxCorrected;
   private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.cxx b/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.cxx
index 676ae6c..a33be6c 100644
--- a/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.cxx
+++ b/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.cxx
@@ -1,90 +1,117 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pip_XSec_1DTpi_nu.h"
 
-// The constructor
-MINERvA_CC1pip_XSec_1DTpi_nu::MINERvA_CC1pip_XSec_1DTpi_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
-
-  fName = name;
-  fPlotTitles = "; T_{#pi} (MeV); d#sigma/dT_{#pi} (cm^{2}/MeV/nucleon)";
-  fFullPhaseSpace = fName.find("_20deg") == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  if (fFullPhaseSpace){
+
+//********************************************************************
+MINERvA_CC1pip_XSec_1DTpi_nu::MINERvA_CC1pip_XSec_1DTpi_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pip_XSec_1DTpi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#pi} (MeV)");
+  fSettings.SetYTitle("d#sigma/dT_{#pi} (cm^{2}/MeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fFullPhaseSpace = !fSettings.Found("name", "_20deg");
+  fFluxCorrection = fSettings.Found("name","fluxcorr");
+  fSettings.SetTitle("MINERvA_CC1pip_XSec_1DTpi_nu");
+  fIsShape = fSettings.Found("type","shape");
+
+  if (fFullPhaseSpace) {
     if (fIsShape) {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_shape.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_cov_shape.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_shape.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_cov_shape.csv");
     } else {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_cov.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_cov.csv");
     }
   } else {
-     if (this->fIsShape) {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_20_shape.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_20_cov_shape.csv", fDataHist->GetNbinsX());
+    if (fIsShape) {
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_20_shape.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_20_cov_shape.csv");
     } else {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_20.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_Tpi_20_cov.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_20.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CC1pip/ccpip_Tpi_20_cov.csv");
     }
   }
 
-  this->SetupDefaultHist();
+  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() );
+  SetCorrelationFromTextFile( fSettings.GetCovarInput() );
 
   // Scale the MINERvA data to account for the flux difference
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1)*1.11);
+  if (fFluxCorrection) {
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
+    }
   }
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
-  std::cout << "SF: " << fScaleFactor << std::endl;
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
+
 void MINERvA_CC1pip_XSec_1DTpi_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(PhysConst::pdg_charged_pions) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(PhysConst::pdg_charged_pions)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double Tpi = -999;
 
   if (hadMass > 100 && hadMass < 1400)
-    Tpi = FitUtils::T(Ppip)*1000.;
+    Tpi = FitUtils::T(Ppip) * 1000.;
 
   fXVar = Tpi;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pip_XSec_1DTpi_nu::isSignal(FitEvent *event) {
 //********************************************************************
   // Last true refers to that this is the restricted MINERvA phase space, in which only forward-going muons are accepted
   return SignalDef::isCC1pip_MINERvA(event, EnuMin, EnuMax, !fFullPhaseSpace);
 }
diff --git a/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.h b/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.h
index 3a5e0a7..1583ab1 100644
--- a/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.h
+++ b/src/MINERvA/MINERvA_CC1pip_XSec_1DTpi_nu.h
@@ -1,37 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PIP_XSEC_1DTPI_NU_H_SEEN
 #define MINERVA_CC1PIP_XSEC_1DTPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pip_XSec_1DTpi_nu : public Measurement1D {
 public:
-  MINERvA_CC1pip_XSec_1DTpi_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pip_XSec_1DTpi_nu(nuiskey samplekey);
   virtual ~MINERvA_CC1pip_XSec_1DTpi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
   bool fFullPhaseSpace;
+  bool fFluxCorrection;
 
   private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.cxx b/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.cxx
index 3a7b7c1..b631ea4 100644
--- a/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.cxx
+++ b/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.cxx
@@ -1,92 +1,118 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CC1pip_XSec_1Dth_nu.h"
 
-// The constructor
-MINERvA_CC1pip_XSec_1Dth_nu::MINERvA_CC1pip_XSec_1Dth_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
-
-  fName = name;
-  fPlotTitles = "; #theta_{#pi} (degrees); d#sigma/d#theta_{#pi} (cm^{2}/degrees/nucleon)";
-  fFullPhaseSpace = name.find("_20deg") == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Full Phase Space
+
+
+//********************************************************************
+MINERvA_CC1pip_XSec_1Dth_nu::MINERvA_CC1pip_XSec_1Dth_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CC1pip_XSec_1Dth_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#theta_{#pi} (degrees)");
+  fSettings.SetYTitle("d#sigma/d#theta_{#pi} (cm^{2}/degrees/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fFullPhaseSpace = !fSettings.Found("name", "_20deg");
+  fFluxCorrection = fSettings.Found("name","fluxcorr");
+  fSettings.SetTitle("MINERvA_CC1pip_XSec_1Dth_nu");
+  fIsShape = fSettings.Found("type","shape");
+
   if (fFullPhaseSpace){
     if (fIsShape) {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_shape.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_cov_shape.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_shape.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_cov_shape.csv");
     } else {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_cov.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_cov.csv");
     }
   // Restricted Phase Space
   } else {
       if (fIsShape) {
-        this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_shape.csv");
-        this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_cov_shape.csv", fDataHist->GetNbinsX());
+        fSettings.SetDataInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_shape.csv");
+        fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_cov_shape.csv");
     } else {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20.csv");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_cov.csv", fDataHist->GetNbinsX());
+      fSettings.SetDataInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20.csv");
+      fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CC1pip/ccpip_theta_20_cov.csv");
     }
   }
 
-  this->SetupDefaultHist();
+  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() );
+  SetCorrelationFromTextFile( fSettings.GetCovarInput() );
 
-  // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
-  // Please change when MINERvA releases new data!
-  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-    fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1)*1.11);
+  // Scale the MINERvA data to account for the flux difference
+  if (fFluxCorrection) {
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
+    }
   }
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 void MINERvA_CC1pip_XSec_1Dth_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(PhysConst::pdg_charged_pions) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(PhysConst::pdg_charged_pions)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   double th      = -999;
 
   if (hadMass > 100 && hadMass < 1400)
     th = (180./M_PI)*FitUtils::th(Pnu, Ppip);
 
   fXVar = th;
 
   return;
 };
 
 //********************************************************************
 bool MINERvA_CC1pip_XSec_1Dth_nu::isSignal(FitEvent *event) {
 //********************************************************************
   // Last false refers to that this is NOT the restricted MINERvA phase space, in which only forward-going muons are accepted
   return SignalDef::isCC1pip_MINERvA(event, EnuMin, EnuMax, !fFullPhaseSpace);
 }
diff --git a/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.h b/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.h
index 45aac69..c669c77 100644
--- a/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.h
+++ b/src/MINERvA/MINERvA_CC1pip_XSec_1Dth_nu.h
@@ -1,37 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CC1PIP_XSEC_1DTH_NU_H_SEEN
 #define MINERVA_CC1PIP_XSEC_1DTH_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CC1pip_XSec_1Dth_nu : public Measurement1D {
 public:
-  MINERvA_CC1pip_XSec_1Dth_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CC1pip_XSec_1Dth_nu(nuiskey samplekey);
   virtual ~MINERvA_CC1pip_XSec_1Dth_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
   bool fFullPhaseSpace;
+  bool fFluxCorrection;
   
   private:
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.cxx
index 8e13838..0f2cba4 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.cxx
@@ -1,74 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCNpip_XSec_1DEnu_nu.h"
 
+
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1DEnu_nu::MINERvA_CCNpip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
+MINERvA_CCNpip_XSec_1DEnu_nu::MINERvA_CCNpip_XSec_1DEnu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MINERvA_CCNpip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); d#sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-enu.csv");
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1DEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("d#sigma(E_{#nu}) (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1DEnu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-enu.csv" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-enu.csv");
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents);
 
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
   // MINERvA has the error quoted as a percentage of the cross-section
   // Need to make this into an absolute error before we go from correlation matrix -> covariance matrix since it depends on the error in the ith bin
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-    fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*(fDataHist->GetBinError(i+1)/100.));
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
   }
 
-  // We're given a correlation matrix, so need to convert it to a covariance matrix
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-enu.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(fSettings.GetCovarInput() );
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents);
 };
 
+
 //********************************************************************
 void MINERvA_CCNpip_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0) return;
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
 
   double Enu = -999;
   if (hadMass < 1800) Enu = Pnu.E()/1000.;
 
   fXVar = Enu;
 
 };
 
 //********************************************************************
 // The false refers to that this cross-section uses the full phase space
 bool MINERvA_CCNpip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, false);
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.h
index 16a6a9f..d6d1f31 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DEnu_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DENU_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1DEnu_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   bool isNew;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.cxx
index 39995f5..c880508 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.cxx
@@ -1,74 +1,93 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 #include "MINERvA_CCNpip_XSec_1DQ2_nu.h"
 
+
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1DQ2_nu::MINERvA_CCNpip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MINERvA_CCNpip_XSec_1DQ2_nu::MINERvA_CCNpip_XSec_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MINERvA_CCNpip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2} (GeV^{2}); d#sigma/dQ^{2} (cm^{2}/GeV^{2}/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-q2.csv");
-
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1DQ2_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \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}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1DQ2_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-q2.csv" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-q2.csv");
+  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() );
   // MINERvA has the error quoted as a percentage of the cross-section
   // Need to make this into an absolute error before we go from correlation matrix -> covariance matrix since it depends on the error in the ith bin
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-    fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*(fDataHist->GetBinError(i+1)/100.));
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
   }
 
-  // This is a correlation matrix
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-q2.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(fSettings.GetCovarInput() );
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
 //********************************************************************
 void MINERvA_CCNpip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0) return;
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
   // This Q2 defaults to calculating true Q2 (using true Enu instead of recon. Enu)
   // This agrees with what MINERvA used
   double q2 = -999;
-  if (hadMass < 1800) q2 = -1*(Pnu-Pmu).Mag2()/1.E6;
+  if (hadMass < 1800) q2 = -1 * (Pnu - Pmu).Mag2() / 1.E6;
 
   fXVar = q2;
 
 };
 
 //********************************************************************
 bool MINERvA_CCNpip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, false);
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.h
index 34bdaea..b7faf50 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DQ2_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DQ2_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1DQ2_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1DQ2_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   bool isNew;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.cxx
index 073845c..2ad381b 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.cxx
@@ -1,286 +1,273 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCNpip_XSec_1DTpi_nu.h"
 
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1DTpi_nu::MINERvA_CCNpip_XSec_1DTpi_nu(
-    std::string name, std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile) {
+MINERvA_CCNpip_XSec_1DTpi_nu::MINERvA_CCNpip_XSec_1DTpi_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = name;
-  fPlotTitles =
-      "; T_{#pi} (MeV); (1/T#Phi) dN_{#pi}/dT_{#pi} (cm^{2}/MeV/nucleon)";
-  fFullPhaseSpace = fName.find("_20deg") == std::string::npos;
-  fUpdatedData = fName.find("2015") == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-
-  // Reserve length 3 for the number of pions
-  TpiVect.reserve(3);
-
-  // Lots of good data from MINERvA, thanks!
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1DTpi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#pi} (MeV)");
+  fSettings.SetYTitle("(1/T#Phi) dN_{#pi}/dT_{#pi} (cm^{2}/MeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fFullPhaseSpace = !fSettings.Found("name", "_20deg");
+  fFluxCorrection = fSettings.Found("name", "fluxcorr");
+  fUpdatedData    = !fSettings.Found("name", "2015");
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1DTpi_nu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
   // Full Phase Space
   if (fFullPhaseSpace) {
     // 2016 release
     if (fUpdatedData) {
-      this->SetDataValues(
-          GeneralUtils::GetTopLevelDir() +
-          "/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-pion-kinetic-energy.csv");
+      SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-pion-kinetic-energy.csv");
 
       // MINERvA has the error quoted as a percentage of the cross-section
       // Need to make this into an absolute error before we go from correlation
       // matrix -> covariance matrix since it depends on the error in the ith
       // bin
       for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-        fDataHist->SetBinError(i + 1,
-                               fDataHist->GetBinContent(i + 1) *
-                                   (fDataHist->GetBinError(i + 1) / 100.));
+        fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
       }
 
       // This is a correlation matrix, not covariance matrix, so needs to be
       // converted
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir() +
-                                           "/data/MINERvA/CCNpip/2016/"
-                                           "nu-ccNpi+-correlation-pion-kinetic-"
-                                           "energy.csv",
-                                       fDataHist->GetNbinsX());
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-pion-kinetic-energy.csv");
+
 
       // 2015 release
     } else {
       // If we're doing shape only
       if (fIsShape) {
-        fName += "_shape";
-        this->SetDataValues(
-            GeneralUtils::GetTopLevelDir() +
-            "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_shape.txt");
-        this->SetCovarMatrixFromCorrText(
-            GeneralUtils::GetTopLevelDir() +
-                "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_shape_cov.txt",
-            fDataHist->GetNbinsX());
+        SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_shape.txt");
+        SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_shape_cov.txt");
+
         // If we're doing full cross-section
       } else {
-        this->SetDataValues(GeneralUtils::GetTopLevelDir() +
-                            "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi.txt");
-        this->SetCovarMatrixFromCorrText(
-            GeneralUtils::GetTopLevelDir() +
-                "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_cov.txt",
-            fDataHist->GetNbinsX());
+        SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi.txt");
+        SetCorrelationFromTextFile( GeneralUtils::GetTopLevelDir() +  "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_cov.txt");
       }
 
-      // Adjust MINERvA data to flux correction; roughly a 11% normalisation
-      // increase in data
-      for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-        fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
-      }
     }
 
     // Restricted Phase Space
   } else {
     // Only 2015 data released restricted muon phase space cross-section
     // unfortunately
     if (fUpdatedData) {
-      LOG(SAM) << fName << " has no updated 2016 data for restricted phase "
-                           "space! Using 2015 data."
-               << std::endl;
-      fUpdatedData = false;
+      ERR(FTL) << fName << " has no updated 2016 data for restricted phase space! Using 2015 data." << std::endl;
+      throw;
     }
 
     // If we're using the shape only data
     if (fIsShape) {
-      this->SetDataValues(
-          GeneralUtils::GetTopLevelDir() +
-          "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_shape.txt");
-      this->SetCovarMatrixFromCorrText(
-          GeneralUtils::GetTopLevelDir() +
-              "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_shape_cov.txt",
-          fDataHist->GetNbinsX());
+      SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_shape.txt");
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_shape_cov.txt");
+
       // Or total cross-section
     } else {
-      this->SetDataValues(
-          GeneralUtils::GetTopLevelDir() +
-          "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg.txt");
-      this->SetCovarMatrixFromCorrText(
-          GeneralUtils::GetTopLevelDir() +
-              "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_cov.txt",
-          fDataHist->GetNbinsX());
+      SetDataFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg.txt");
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_Tpi_20deg_cov.txt");
     }
+  }
 
-    // Adjust 2015 MINERvA data to account for flux correction; roughly a 11%
-    // normalisation increase in data
+  // Scale the MINERvA data to account for the flux difference
+  // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
+  // Please change when MINERvA releases new data!
+  if (fFluxCorrection) {
     for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
       fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
     }
   }
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-  Measurement1D::SetupDefaultHist();
-
-  onePions = (TH1D *)(fDataHist->Clone());
-  twoPions = (TH1D *)(fDataHist->Clone());
-  threePions = (TH1D *)(fDataHist->Clone());
-  morePions = (TH1D *)(fDataHist->Clone());
-
-  onePions->SetNameTitle((fName + "_1pions").c_str(),
-                         (fName + "_1pions" + fPlotTitles).c_str());
-  twoPions->SetNameTitle((fName + "_2pions").c_str(),
-                         (fName + "_2pions;" + fPlotTitles).c_str());
-  threePions->SetNameTitle((fName + "_3pions").c_str(),
-                           (fName + "_3pions" + fPlotTitles).c_str());
-  morePions->SetNameTitle((fName + "_4pions").c_str(),
-                          (fName + "_4pions" + fPlotTitles).c_str());
-
-  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) /
-                 double(fNEvents) / TotalIntegratedFlux("width");
+  // Make some auxillary helper plots
+  onePions  = (TH1D*)(fDataHist->Clone());
+  onePions->SetNameTitle((fName + "_1pions").c_str(), (fName + "_1pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(onePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
+  twoPions  = (TH1D*)(fDataHist->Clone());
+  twoPions->SetNameTitle((fName + "_2pions").c_str(), (fName + "_2pions;" + fPlotTitles).c_str());
+  SetAutoProcessTH1(twoPions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
+  threePions = (TH1D*)(fDataHist->Clone());
+  threePions->SetNameTitle((fName + "_3pions").c_str(), (fName + "_3pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(threePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
+  morePions = (TH1D*)(fDataHist->Clone());
+  morePions->SetNameTitle((fName + "_4pions").c_str(), (fName + "_4pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(morePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
+  // Reserve length 3 for the number of pions
+  // We fill once per pion found in the event, so can fill multiple times for one event
+  TpiVect.reserve(3);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 //********************************************************************
 // Here we have to fill for every pion we find in the event
 void MINERvA_CCNpip_XSec_1DTpi_nu::FillEventVariables(FitEvent *event) {
   //********************************************************************
 
   if (event->NumFSParticle(211) == 0 && event->NumFSParticle(-211) == 0) return;
   if (event->NumFSParticle(13) == 0) return;
 
   // Clear out the vectors
   TpiVect.clear();
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
 
   if (hadMass < 1800) {
 
     // Loop over the particle stack
     for (unsigned int j = 2; j < event->Npart(); ++j) {
       // Only include alive particles
       if (!(event->PartInfo(j))->fIsAlive &&
           (event->PartInfo(j))->fNEUTStatusCode != 0)
         continue;
 
       int PID = (event->PartInfo(j))->fPID;
       // Pick up the charged pions in the event
       if (abs(PID) == 211) {
         double ppi = FitUtils::T(event->PartInfo(j)->fP) * 1000.;
         TpiVect.push_back(ppi);
       }
     }
   }
 
   fXVar = 0;
 
   return;
 };
 
 //********************************************************************
 // The last bool refers to if we're using restricted phase space or not
 bool MINERvA_CCNpip_XSec_1DTpi_nu::isSignal(FitEvent *event) {
   //********************************************************************
   // Last false refers to that this is NOT the restricted MINERvA phase space,
   // in which only forward-going muons are accepted
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, !fFullPhaseSpace);
 }
 
 //********************************************************************
 // Need to override FillHistograms() here because we fill the histogram N_pion
 // times
 void MINERvA_CCNpip_XSec_1DTpi_nu::FillHistograms() {
   //********************************************************************
 
   if (Signal) {
     unsigned int nPions = TpiVect.size();
 
     // Need to loop over all the pions in the sample
     for (size_t k = 0; k < nPions; ++k) {
       double tpi = TpiVect[k];
       this->fMCHist->Fill(tpi, Weight);
       this->fMCFine->Fill(tpi, Weight);
       this->fMCStat->Fill(tpi, 1.0);
 
       if (nPions == 1) {
         onePions->Fill(tpi, Weight);
       } else if (nPions == 2) {
         twoPions->Fill(tpi, Weight);
       } else if (nPions == 3) {
         threePions->Fill(tpi, Weight);
       } else if (nPions > 3) {
         morePions->Fill(tpi, Weight);
       }
 
-      PlotUtils::FillNeutModeArray(fMCHist_PDG, Mode, tpi, Weight);
+      if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, tpi, Weight);
     }
   }
 }
 
 //********************************************************************
 void MINERvA_CCNpip_XSec_1DTpi_nu::ScaleEvents() {
   //********************************************************************
   Measurement1D::ScaleEvents();
 
   onePions->Scale(this->fScaleFactor, "width");
   twoPions->Scale(this->fScaleFactor, "width");
   threePions->Scale(this->fScaleFactor, "width");
   morePions->Scale(this->fScaleFactor, "width");
 
   return;
 }
 
 //********************************************************************
 void MINERvA_CCNpip_XSec_1DTpi_nu::Write(std::string drawOpts) {
   //********************************************************************
   Measurement1D::Write(drawOpts);
 
   // Draw the npions stack
   onePions->SetTitle("1#pi");
   onePions->SetLineColor(kBlack);
   // onePions->SetFillStyle(0);
   onePions->SetFillColor(onePions->GetLineColor());
 
   twoPions->SetTitle("2#pi");
   twoPions->SetLineColor(kRed);
   // twoPions->SetFillStyle(0);
   twoPions->SetFillColor(twoPions->GetLineColor());
 
   threePions->SetTitle("3#pi");
   threePions->SetLineColor(kGreen);
   // threePions->SetFillStyle(0);
   threePions->SetFillColor(threePions->GetLineColor());
 
   morePions->SetTitle(">3#pi");
   morePions->SetLineColor(kBlue);
   // morePions->SetFillStyle(0);
   morePions->SetFillColor(morePions->GetLineColor());
 
   THStack pionStack =
     THStack((fName + "_pionStack").c_str(), (fName + "_pionStack").c_str());
 
   pionStack.Add(onePions);
   pionStack.Add(twoPions);
   pionStack.Add(threePions);
   pionStack.Add(morePions);
 
   pionStack.Write();
 
   return;
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.h
index 47f13b7..8691b63 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1DTpi_nu.h
@@ -1,48 +1,49 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DTPI_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DTPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1DTpi_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1DTpi_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1DTpi_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1DTpi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   void FillHistograms();
   bool isSignal(FitEvent *event);
   void ScaleEvents();
   void Write(std::string drawOpts);
   bool fFullPhaseSpace;
   bool fUpdatedData;
+  bool fFluxCorrection;
   
 private:
   std::vector<double> TpiVect;
 
   TH1D *onePions;
   TH1D *twoPions;
   TH1D *threePions;
   TH1D *morePions;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.cxx
index d6b5d8c..715e7db 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.cxx
@@ -1,78 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCNpip_XSec_1Dpmu_nu.h"
 
+
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1Dpmu_nu::MINERvA_CCNpip_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile) {
+MINERvA_CCNpip_XSec_1Dpmu_nu::MINERvA_CCNpip_XSec_1Dpmu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MINERvA_CCNpip_XSec_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV); d#sigma/dp_{#mu} (cm^{2}/GeV/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-
-  //this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016_upd/ccnpip_pmu.txt");
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-muon-momentum.csv");
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1Dpmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#mu} (GeV)");
+  fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1Dpmu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-muon-momentum.csv" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-muon-momentum.csv");
+  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() );
   // MINERvA has the error quoted as a percentage of the cross-section
   // Need to make this into an absolute error before we go from correlation matrix -> covariance matrix since it depends on the error in the ith bin
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-    fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*(fDataHist->GetBinError(i+1)/100.));
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
   }
 
-  // Correlation matrix is given
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-muon-momentum.csv", fDataHist->GetNbinsX());
+  SetCorrelationFromTextFile(fSettings.GetCovarInput() );
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 //********************************************************************
 // Very simple event variable fill
 void MINERvA_CCNpip_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0) return;
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
 
   double pmu = -999;
   if (hadMass < 1800) pmu = Pmu.Vect().Mag()/1000.;
 
   fXVar = pmu;
 
 };
 
 //********************************************************************
 // The false refers to that this cross-section uses the full phase space
 bool MINERvA_CCNpip_XSec_1Dpmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, false);
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.h
index b20f7cc..9f70ca0 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dpmu_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DPMU_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DPMU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1Dpmu_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1Dpmu_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1Dpmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   bool isNew;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.cxx
index 608a7c1..71a712e 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.cxx
@@ -1,255 +1,262 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 #include "MINERvA_CCNpip_XSec_1Dth_nu.h"
 
+
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1Dth_nu::MINERvA_CCNpip_XSec_1Dth_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCNpip_XSec_1Dth_nu::MINERvA_CCNpip_XSec_1Dth_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = name;
-  fPlotTitles = "; #theta_{#pi} (degrees); (1/T#Phi) dN_{#pi}/d#theta_{#pi} (cm^{2}/degrees/nucleon)";
-
-  // If we have full phase space we won't find 20deg in name
-  fFullPhaseSpace = (fName.find("_20deg") == std::string::npos);
-  // If we have updated data we won't have 2015 in name
-  fUpdatedData = fName.find("2015") == std::string::npos;
-
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-
-  // Reserve length 3 for the number of pions
-  // We fill once per pion found in the event, so can fill multiple times for one event
-  thVect.reserve(3);
-
-  // So here is all the data we want to read in, pfoaw!
-  // Same W cut for all releases
-
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1Dth_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#theta_{#pi} (degrees)");
+  fSettings.SetYTitle("(1/T#Phi) dN_{#pi}/d#theta_{#pi} (cm^{2}/degrees/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fFullPhaseSpace = !fSettings.Found("name", "_20deg");
+  fFluxCorrection = fSettings.Found("name", "fluxcorr");
+  fUpdatedData    = !fSettings.Found("name", "2015");
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1Dth_nu");
+  
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
   // Full Phase Space
   if (fFullPhaseSpace) {
 
     // 2016 release data
     if (fUpdatedData) {
 
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-pion-angle.csv");
+      SetDataFromTextFile( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-pion-angle.csv");
 
       // MINERvA has the error quoted as a percentage of the cross-section
       // Need to make this into an absolute error before we go from correlation matrix -> covariance matrix since it depends on the error in the ith bin
-      for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-        fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*(fDataHist->GetBinError(i+1)/100.));
+      for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+        fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
       }
 
       // This is a correlation matrix! but it's all fixed in SetCovarMatrixFromText
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-pion-angle.csv", fDataHist->GetNbinsX());
-    // 2015 release data
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-pion-angle.csv");
+
+      // 2015 release data
     } else {
       // 2015 release allows for shape comparisons
 
       if (fIsShape) {
-        fName += "_shape";
-        this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_shape.txt");
-        this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_shape_cov.txt", fDataHist->GetNbinsX());
+        SetDataFromTextFile( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_shape.txt");
+        SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_shape_cov.txt");
       } else {
-        this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th.txt");
-        this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_cov.txt", fDataHist->GetNbinsX());
+        SetDataFromTextFile( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th.txt");
+        SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_cov.txt");
       }
 
-      // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
-      // Please change when MINERvA releases new data!
-      for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
-        fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1)*1.11);
-      }
     }
 
-  // Restricted Phase Space Data
+    // Restricted Phase Space Data
   } else {
 
     // 2016 release data unfortunately not released in 20degree forward-going, revert to 2015 data
-    if (fUpdatedData){
-      LOG(SAM) << fName << " has no updated 2016 data for restricted phase space! Using 2015 data." << std::endl;
-      fUpdatedData = false;
+    if (fUpdatedData) {
+      ERR(FTL) << fName << " has no updated 2016 data for restricted phase space! Using 2015 data." << std::endl;
+      throw;
     }
 
     // Only 2015 20deg data
     if (fIsShape) {
-      this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_shape.txt");
-      this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+
-        "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_shape_cov.txt", fDataHist->GetNbinsX());
+      SetDataFromTextFile( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_shape.txt");
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_shape_cov.txt");
     } else {
-        this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg.txt");
-        this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+
-            "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_cov.txt", fDataHist->GetNbinsX());
+      SetDataFromTextFile( GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg.txt");
+      SetCorrelationFromTextFile(GeneralUtils::GetTopLevelDir() + "/data/MINERvA/CCNpip/2015/MINERvA_CCNpi_th_20deg_cov.txt");
     }
   }
 
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-  Measurement1D::SetupDefaultHist();
+  // Scale the MINERvA data to account for the flux difference
+  // Adjust MINERvA data to flux correction; roughly a 11% normalisation increase in data
+  // Please change when MINERvA releases new data!
+  if (fFluxCorrection) {
+    for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+      fDataHist->SetBinContent(i + 1, fDataHist->GetBinContent(i + 1) * 1.11);
+    }
+  }
 
   // Make some auxillary helper plots
   onePions  = (TH1D*)(fDataHist->Clone());
+  onePions->SetNameTitle((fName + "_1pions").c_str(), (fName + "_1pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(onePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
   twoPions  = (TH1D*)(fDataHist->Clone());
+  twoPions->SetNameTitle((fName + "_2pions").c_str(), (fName + "_2pions;" + fPlotTitles).c_str());
+  SetAutoProcessTH1(twoPions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
   threePions = (TH1D*)(fDataHist->Clone());
+  threePions->SetNameTitle((fName + "_3pions").c_str(), (fName + "_3pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(threePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
+
   morePions = (TH1D*)(fDataHist->Clone());
+  morePions->SetNameTitle((fName + "_4pions").c_str(), (fName + "_4pions" + fPlotTitles).c_str());
+  SetAutoProcessTH1(morePions, kCMD_Reset, kCMD_Scale, kCMD_Norm);
 
-  onePions->SetNameTitle((fName+"_1pions").c_str(), (fName+"_1pions"+fPlotTitles).c_str());
-  twoPions->SetNameTitle((fName+"_2pions").c_str(), (fName+"_2pions;"+fPlotTitles).c_str());
-  threePions->SetNameTitle((fName+"_3pions").c_str(), (fName+"_3pions"+fPlotTitles).c_str());
-  morePions->SetNameTitle((fName+"_4pions").c_str(), (fName+"_4pions"+fPlotTitles).c_str());
+  // Reserve length 3 for the number of pions
+  // We fill once per pion found in the event, so can fill multiple times for one event
+  thVect.reserve(3);
 
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 
 // ********************************************
 // Fill the event variables
 // Here we want to fill the angle for every pion we can find in the event
 void MINERvA_CCNpip_XSec_1Dth_nu::FillEventVariables(FitEvent *event) {
 // ********************************************
 
   thVect.clear();
 
   if (event->NumFSParticle(211) == 0 && event->NumFSParticle(-211) == 0) return;
   if (event->NumFSParticle(13) == 0) return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
 
   if (hadMass < 1800) {
 
     TLorentzVector Ppip;
     // Loop over the particle stack
     for (unsigned int j = 2; j < event->Npart(); ++j) {
 
       // Only include alive particles
       if (!(event->PartInfo(j))->fIsAlive && (event->PartInfo(j))->fNEUTStatusCode != 0) continue;
 
       int PID = (event->PartInfo(j))->fPID;
       // Select highest momentum (energy) charged pion
       if (abs(PID) == 211) {
         Ppip = (event->PartInfo(j))->fP;
-        double th = (180./M_PI)*FitUtils::th(Pnu, Ppip);
+        double th = (180. / M_PI) * FitUtils::th(Pnu, Ppip);
         thVect.push_back(th);
       }
     }
   }
 
   fXVar = 0;
 
   return;
 };
 
 //********************************************************************
 // The signal definition for MINERvA CCNpi+
 // Last bool refers to if we're selecting on the full phase space or not
 bool MINERvA_CCNpip_XSec_1Dth_nu::isSignal(FitEvent *event) {
   //********************************************************************
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, !fFullPhaseSpace);
 }
 
 
 //********************************************************************
 // Need to override FillHistograms() here because we fill the histogram N_pion times
 void MINERvA_CCNpip_XSec_1Dth_nu::FillHistograms() {
   //********************************************************************
 
-  if (Signal){
+  if (Signal) {
 
     unsigned int nPions = thVect.size();
 
     // Need to loop over all the pions in the event
     for (size_t k = 0; k < nPions; ++k) {
 
       double th = thVect[k];
       this->fMCHist->Fill(th, Weight);
       this->fMCFine->Fill(th, Weight);
       this->fMCStat->Fill(th, 1.0);
 
       if (nPions == 1) {
         onePions->Fill(th, Weight);
       } else if (nPions == 2) {
         twoPions->Fill(th, Weight);
       } else if (nPions == 3) {
         threePions->Fill(th, Weight);
       } else if (nPions > 3) {
         morePions->Fill(th, Weight);
       }
 
-      PlotUtils::FillNeutModeArray(fMCHist_PDG, Mode, th, Weight);
+      if (fMCHist_Modes) fMCHist_Modes->Fill(Mode, th, Weight);
+      // PlotUtils::FillNeutModeArray(fMCHist_PDG, Mode, th, Weight);
     }
   }
 
   return;
 }
 
 //********************************************************************
-void MINERvA_CCNpip_XSec_1Dth_nu::ScaleEvents() {
-  //********************************************************************
-  Measurement1D::ScaleEvents();
-
-  onePions->Scale(this->fScaleFactor, "width");
-  twoPions->Scale(this->fScaleFactor, "width");
-  threePions->Scale(this->fScaleFactor, "width");
-  morePions->Scale(this->fScaleFactor, "width");
-
-  return;
-}
-
-//********************************************************************
 void MINERvA_CCNpip_XSec_1Dth_nu::Write(std::string drawOpts) {
   //********************************************************************
   Measurement1D::Write(drawOpts);
 
   // Draw the npions stack
   onePions->SetTitle("1#pi");
   onePions->SetLineColor(kBlack);
   //onePions->SetFillStyle(0);
   onePions->SetFillColor(onePions->GetLineColor());
 
   twoPions->SetTitle("2#pi");
   twoPions->SetLineColor(kRed);
   //twoPions->SetFillStyle(0);
   twoPions->SetFillColor(twoPions->GetLineColor());
 
   threePions->SetTitle("3#pi");
   threePions->SetLineColor(kGreen);
   //threePions->SetFillStyle(0);
   threePions->SetFillColor(threePions->GetLineColor());
 
   morePions->SetTitle(">3#pi");
   morePions->SetLineColor(kBlue);
   //morePions->SetFillStyle(0);
   morePions->SetFillColor(morePions->GetLineColor());
 
-  THStack pionStack = THStack((fName+"_pionStack").c_str(), (fName+"_pionStack").c_str());
+  THStack pionStack = THStack((fName + "_pionStack").c_str(), (fName + "_pionStack").c_str());
 
   pionStack.Add(onePions);
   pionStack.Add(twoPions);
   pionStack.Add(threePions);
   pionStack.Add(morePions);
 
   pionStack.Write();
 
   return;
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.h
index 882811b..84e1e6c 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dth_nu.h
@@ -1,49 +1,49 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DTH_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DTH_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1Dth_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1Dth_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1Dth_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1Dth_nu() {};
 
   void FillEventVariables(FitEvent *event);
   void FillHistograms();
   bool isSignal(FitEvent *event);
-  void ScaleEvents();
   void Write(std::string drawOpt);
   bool fFullPhaseSpace;
   bool fUpdatedData;
+  bool fFluxCorrection;
 
 private:
   bool isNew;
 
   TH1D *onePions;
   TH1D *twoPions;
   TH1D *threePions;
   TH1D *morePions;
 
   std::vector<double> thVect;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.cxx b/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.cxx
index 1e9f461..12d98df 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.cxx
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.cxx
@@ -1,73 +1,93 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCNpip_XSec_1Dthmu_nu.h"
 
+
 //********************************************************************
-// The constructor
-MINERvA_CCNpip_XSec_1Dthmu_nu::MINERvA_CCNpip_XSec_1Dthmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MINERvA_CCNpip_XSec_1Dthmu_nu::MINERvA_CCNpip_XSec_1Dthmu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MINERvA_CCNpip_XSec_1Dthmu_nu";
-  fPlotTitles = "; #theta_{#mu} (degrees); d#sigma/d#theta_{#mu} (cm^{2}/degrees/nucleon)";
-  EnuMin = 1.5;
-  EnuMax = 10;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-muon-theta.csv");
-
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCNpip_XSec_1Dthmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#theta_{#mu} (degrees)");
+  fSettings.SetYTitle("d#sigma/d#theta_{#mu} (cm^{2}/degrees/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCNpip_XSec_1Dthmu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-xsec-muon-theta.csv" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-muon-angle.csv");
+  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() );
   // MINERvA has the error quoted as a percentage of the cross-section
   // Need to make this into an absolute error before we go from correlation matrix -> covariance matrix since it depends on the error in the ith bin
-  for (int i = 0; i < fDataHist->GetNbinsX()+1; i++) {
-    fDataHist->SetBinError(i+1, fDataHist->GetBinContent(i+1)*(fDataHist->GetBinError(i+1)/100.));
+  for (int i = 0; i < fDataHist->GetNbinsX() + 1; i++) {
+    fDataHist->SetBinError(i + 1, fDataHist->GetBinContent(i + 1) * (fDataHist->GetBinError(i + 1) / 100.));
   }
 
-  // This is a correlation matrix
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MINERvA/CCNpip/2016/nu-ccNpi+-correlation-muon-angle.csv", fDataHist->GetNbinsX());
-  this->SetupDefaultHist();
+  SetCorrelationFromTextFile(fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 //********************************************************************
 void MINERvA_CCNpip_XSec_1Dthmu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0) return;
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double hadMass = FitUtils::Wrec(Pnu, Pmu);
 
   double thmu = -999;
-  if (hadMass < 1800) thmu = (180./M_PI)*FitUtils::th(Pnu, Pmu);
+  if (hadMass < 1800) thmu = (180. / M_PI) * FitUtils::th(Pnu, Pmu);
 
   fXVar = thmu;
 
 };
 
 //********************************************************************
 // Last false refers to that this is NOT the restricted MINERvA phase space, in which only forward-going muons are accepted
 bool MINERvA_CCNpip_XSec_1Dthmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCNpip_MINERvA(event, EnuMin, EnuMax, false);
 }
diff --git a/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.h b/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.h
index 652ce17..8eb152d 100644
--- a/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.h
+++ b/src/MINERvA/MINERvA_CCNpip_XSec_1Dthmu_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCNPIP_XSEC_1DTHMU_NU_H_SEEN
 #define MINERVA_CCNPIP_XSEC_1DTHMU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MINERvA_CCNpip_XSec_1Dthmu_nu : public Measurement1D {
 public:
-  MINERvA_CCNpip_XSec_1Dthmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCNpip_XSec_1Dthmu_nu(nuiskey samplekey);
   virtual ~MINERvA_CCNpip_XSec_1Dthmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
   bool isNew;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.cxx b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.cxx
index ee32c05..7adf843 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.cxx
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.cxx
@@ -1,123 +1,146 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCQE_XSec_1DQ2_antinu.h"
 
+
 //********************************************************************
-MINERvA_CCQE_XSec_1DQ2_antinu::MINERvA_CCQE_XSec_1DQ2_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCQE_XSec_1DQ2_antinu::MINERvA_CCQE_XSec_1DQ2_antinu(nuiskey samplekey) {
 //********************************************************************
 
-  // Setup Measurement Defaults
-  fName = name;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  isFluxFix      = name.find("_oldflux") == std::string::npos;
-  fullphasespace = name.find("_20deg")   == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10.;
-  fNormError = 0.110;
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG,FULL/NORM";
-  fDefaultTypes = "FIX/FULL";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup the Data Plots
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCQE/";
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCQE_XSec_1DQ2_antinu sample. \n" \
+    "Target: CH \n"						   \
+    "Flux: MINERvA Forward Horn Current Numubar \n"		   \
+    "Signal: True CCQE/2p2h defined at the vertex level \n";
+  
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  isFluxFix      = !fSettings.Found("name", "_oldflux");
+  fullphasespace = !fSettings.Found("name", "_20deg");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCQE_XSec_1DQ2_antinu");
+
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CCQE/";
   std::string datafilename  = "";
   std::string covarfilename = "";
 
   // Full Phase Space
-  if (fullphasespace){
+  if (fullphasespace) {
 
-    if (isFluxFix){
-      if (fIsShape){
+    if (isFluxFix) {
+      if (fIsShape) {
         ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
                  << "datasets with fixed flux information. NUISANCE will scale MC to match "
                  << "data normalization but full covariance will be used. " << std::endl;
       }
       datafilename  = "Q2QE_numubar_data_fluxfix.txt";
       covarfilename = "Q2QE_numubar_covar_fluxfix.txt";
 
     } else {
-      if (fIsShape){
-	datafilename  = "Q2QE_numubar_data_SHAPE-extracted.txt";
-	covarfilename = "Q2QE_numubar_covar_SHAPE-extracted.txt";
+      if (fIsShape) {
+        datafilename  = "Q2QE_numubar_data_SHAPE-extracted.txt";
+        covarfilename = "Q2QE_numubar_covar_SHAPE-extracted.txt";
       } else {
-	datafilename  = "Q2QE_numubar_data.txt";
-	covarfilename = "Q2QE_numubar_covar.txt";
+        datafilename  = "Q2QE_numubar_data.txt";
+        covarfilename = "Q2QE_numubar_covar.txt";
       }
     }
 
-  // Restricted Phase Space
+    // Restricted Phase Space
   } else {
-    if (isFluxFix){
-      if (fIsShape){
+    if (isFluxFix) {
+      if (fIsShape) {
         ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
                  << "datasets with fixed flux information. NUISANCE will scale MC to match "
                  << "data normalization but full covariance will be used. " << std::endl;
       }
       datafilename  = "20deg_Q2QE_numubar_data_fluxfix.txt";
       covarfilename = "20deg_Q2QE_numubar_covar_fluxfix.txt";
 
     } else {
-      if (fIsShape){
-	datafilename  = "20deg_Q2QE_numubar_data_SHAPE-extracted.txt";
-	covarfilename = "20deg_Q2QE_numubar_covar_SHAPE-extracted.txt";
+      if (fIsShape) {
+        datafilename  = "20deg_Q2QE_numubar_data_SHAPE-extracted.txt";
+        covarfilename = "20deg_Q2QE_numubar_covar_SHAPE-extracted.txt";
       } else {
-	datafilename  = "20deg_Q2QE_numubar_data.txt";
-	covarfilename = "20deg_Q2QE_numubar_covar.txt";
+        datafilename  = "20deg_Q2QE_numubar_data.txt";
+        covarfilename = "20deg_Q2QE_numubar_covar.txt";
       }
     }
   }
 
-  this->SetDataValues( basedir + datafilename );
-  this->SetCovarMatrixFromText( basedir + covarfilename, 8 );
+  fSettings.SetDataInput(  basedir + datafilename );
+  fSettings.SetCovarInput( basedir + covarfilename );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) * 13. / 7. / TotalIntegratedFlux();
 
-  // Setup Default MC Histograms
-  this->SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+
+  if (!isFluxFix or !fullphasespace) {
+    SetCorrelationFromTextFile( fSettings.GetCovarInput() );
+    ScaleCovar(1E76);
+  } else {
+    SetCovarFromTextFile( fSettings.GetCovarInput() );
+  }
 
-  // Set Scale Factor (EventHist/nucleons) * NNucl / NNeutons
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))*13./7./this->TotalIntegratedFlux();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void MINERvA_CCQE_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event){
+void MINERvA_CCQE_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(-13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(-13)->fP;
 
   double ThetaMu  = Pnu.Vect().Angle(Pmu.Vect());
-  double q2qe     = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 30.,true);
+  double q2qe     = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 30., true);
 
   fXVar = q2qe;
   return;
 }
 
 
 
 //********************************************************************
-bool MINERvA_CCQE_XSec_1DQ2_antinu::isSignal(FitEvent *event){
+bool MINERvA_CCQE_XSec_1DQ2_antinu::isSignal(FitEvent *event) {
 //*******************************************************************
   return SignalDef::isCCQEnumubar_MINERvA(event, EnuMin, EnuMax, fullphasespace);
 }
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.h b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.h
index 32e9e4b..6a4990f 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.h
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_antinu.h
@@ -1,42 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCQE_XSec_1DQ2_antinu_H_SEEN
 #define MINERVA_CCQE_XSec_1DQ2_antinu_H_SEEN
 
 #include "Measurement1D.h"
 //********************************************************************
 class MINERvA_CCQE_XSec_1DQ2_antinu : public Measurement1D {
 //********************************************************************
 public:
 
-  MINERvA_CCQE_XSec_1DQ2_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCQE_XSec_1DQ2_antinu(nuiskey samplekey);
   virtual ~MINERvA_CCQE_XSec_1DQ2_antinu() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 
   bool isFluxFix, fullphasespace;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.cxx b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.cxx
index 5505e1c..93b2c0a 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.cxx
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.cxx
@@ -1,164 +1,192 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCQE_XSec_1DQ2_joint.h"
 
 //********************************************************************
-MINERvA_CCQE_XSec_1DQ2_joint::MINERvA_CCQE_XSec_1DQ2_joint(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCQE_XSec_1DQ2_joint::MINERvA_CCQE_XSec_1DQ2_joint(nuiskey samplekey) {
 //********************************************************************
 
-  // Setup The Measurement
-  fName = name;
-  nBins = 16;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  isFluxFix      = name.find("_oldflux") == std::string::npos;
-  fullphasespace = name.find("_20deg")   == std::string::npos;
-  fIsRatio = false;
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCQE_XSec_1DQ2_joint sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  isFluxFix      = !fSettings.Found("name", "_oldflux");
+  fullphasespace = !fSettings.Found("name", "_20deg");
+    nBins = 16;
+    fIsRatio = false;
   fIsSummed = false;
   fSaveSubMeas = true;
-  SetupMeasurement(inputfiles, type, rw, fakeDataFile);
 
-  // Get parsed input files
-  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA Joint requires input files in format: antinu;nu"<<std::endl;
-  std::string inFileAntineutrino = fSubInFiles.at(0);
-  std::string inFileNeutrino     = fSubInFiles.at(1);
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCQE_XSec_1DQ2_joint");
 
-  // Push classes back into list for processing loop
-  fSubChain.push_back(MIN_anu);
-  fSubChain.push_back(MIN_nu);
-
-  // Setup the Data input
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCQE/";
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CCQE/";
   std::string datafilename  = "";
   std::string covarfilename = "";
   std::string neutrinoclass = "";
   std::string antineutrinoclass = "";
 
   // Full Phase Space
-  if (fullphasespace){
+  if (fullphasespace) {
 
-    if (isFluxFix){
+    if (isFluxFix) {
       if (fIsShape) {
-          ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
-                   << "datasets with fixed flux information. NUISANCE will scale MC to match "
-                   << "data normalization but full covariance will be used. " << std::endl;
-                 }
+        ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
+                 << "datasets with fixed flux information. NUISANCE will scale MC to match "
+                 << "data normalization but full covariance will be used. " << std::endl;
+      }
 
       datafilename  = "Q2QE_joint_data_fluxfix.txt";
       covarfilename = "Q2QE_joint_covar_fluxfix.txt";
       neutrinoclass = "MINERvA_CCQE_XSec_1DQ2_nu_newflux";
       antineutrinoclass = "MINERvA_CCQE_XSec_1DQ2_antinu_newflux";
 
     } else {
-      if (fIsShape){
+      if (fIsShape) {
         datafilename  = "Q2QE_joint_dataa_SHAPE-extracted.txt";
         covarfilename = "Q2QE_joint_covara_SHAPE-extracted.txt";
       } else {
         datafilename  = "Q2QE_joint_data.txt";
         covarfilename = "Q2QE_joint_covar.txt";
       }
       neutrinoclass = "MINERvA_CCQE_XSec_1DQ2_nu";
       antineutrinoclass = "MINERvA_CCQE_XSec_1DQ2_antinu";
     }
 
-  // Restricted Phase Space
+    // Restricted Phase Space
   } else {
 
-    if (isFluxFix){
+    if (isFluxFix) {
       if (fIsShape) {
-          ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
-                   << "datasets with fixed flux information. NUISANCE will scale MC to match "
-                   << "data normalization but full covariance will be used. " << std::endl;
-                 }
+        ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
+                 << "datasets with fixed flux information. NUISANCE will scale MC to match "
+                 << "data normalization but full covariance will be used. " << std::endl;
+      }
 
       datafilename  = "20deg_Q2QE_joint_data_fluxfix.txt";
       covarfilename = "20deg_Q2QE_joint_covar_fluxfix.txt";
       neutrinoclass = "MINERvA_CCQE_XSec_1DQ2_nu_20deg_newflux";
       antineutrinoclass = "MINERvA_CCQE_XSec_1DQ2_antinu_20deg_newflux";
 
     } else {
-      if (fIsShape){
+      if (fIsShape) {
         datafilename  = "20deg_Q2QE_joint_dataa_SHAPE-extracted.txt";
         covarfilename = "20deg_Q2QE_joint_covara_SHAPE-extracted.txt";
       } else {
         datafilename  = "20deg_Q2QE_joint_data.txt";
         covarfilename = "20deg_Q2QE_joint_covar.txt";
       }
       neutrinoclass = "MINERvA_CCQE_XSec_1DQ2_nu_20deg";
       antineutrinoclass = "MINERvA_CCQE_XSec_1DQ2_antinu_20deg";
     }
   }
 
-  // Setup Data
-  this->SetDataValues( basedir + datafilename );
-  this->SetCovarMatrixFromText( basedir + covarfilename, nBins);
+  fSettings.SetDataInput(  basedir + datafilename );
+  fSettings.SetCovarInput( basedir + covarfilename );
+  fSettings.DefineAllowedSpecies("numu,numub");
+
+  std::cout << "Finalising sample settings for joint fit = " << fIsJoint << std::endl;
+  FinaliseSampleSettings();
 
-  // Setup Experiments
-  MIN_anu = new MINERvA_CCQE_XSec_1DQ2_antinu(antineutrinoclass, inFileAntineutrino, rw, type, fakeDataFile);
-  MIN_nu  = new MINERvA_CCQE_XSec_1DQ2_nu    (neutrinoclass,     inFileNeutrino,     rw, type, fakeDataFile);
+
+  // Get parsed input files
+  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA Joint requires input files in format: antinu;nu" << std::endl;
+  std::string inFileAntineutrino = fSubInFiles.at(0);
+  std::string inFileNeutrino     = fSubInFiles.at(1);
+
+  // Push classes back into list for processing loop
+  fSubChain.push_back(MIN_anu);
+  fSubChain.push_back(MIN_nu);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Setup Sub classes
+  nuiskey antinukey = Config::CreateKey("sample");
+  antinukey.SetS("name", antineutrinoclass);
+  antinukey.SetS("input", inFileAntineutrino);
+  antinukey.SetS("type", fSettings.GetS("type"));
+  MIN_anu = new MINERvA_CCQE_XSec_1DQ2_antinu(antinukey);
+
+  nuiskey nukey = Config::CreateKey("sample");
+  nukey.SetS("name", neutrinoclass);
+  nukey.SetS("input", inFileNeutrino);
+  nukey.SetS("type", fSettings.GetS("type"));
+  MIN_nu = new MINERvA_CCQE_XSec_1DQ2_nu(nukey);
 
   // Add to chain for processing
   this->fSubChain.clear();
   this->fSubChain.push_back(MIN_anu);
   this->fSubChain.push_back(MIN_nu);
 
-  // Setup Default MC Hists
-  SetupDefaultHist();
-
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void MINERvA_CCQE_XSec_1DQ2_joint::MakePlots(){
+void MINERvA_CCQE_XSec_1DQ2_joint::MakePlots() {
 //********************************************************************
 
   UInt_t sample = 0;
-  for (std::vector<MeasurementBase*>::const_iterator expIter = fSubChain.begin(); expIter != fSubChain.end(); expIter++){
+  for (std::vector<MeasurementBase*>::const_iterator expIter = fSubChain.begin(); expIter != fSubChain.end(); expIter++) {
     MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
 
-    if (sample == 0){
+    if (sample == 0) {
 
       MIN_anu = static_cast<MINERvA_CCQE_XSec_1DQ2_antinu*>(exp);
       TH1D* MIN_anu_mc = (TH1D*) MIN_anu->GetMCList().at(0);
-      for (int i = 0; i < 8; i++){
-	std::cout << "Adding MIN_anu_MC " << i+1 << " : " << i+1 << " " << MIN_anu_mc->GetBinContent(i+1) << std::endl;
-	fMCHist->SetBinContent(i+1, MIN_anu_mc->GetBinContent(i+1));
-	fMCHist->SetBinError(i+1, MIN_anu_mc->GetBinError(i+1));
+      for (int i = 0; i < 8; i++) {
+        std::cout << "Adding MIN_anu_MC " << i + 1 << " : " << i + 1 << " " << MIN_anu_mc->GetBinContent(i + 1) << std::endl;
+        fMCHist->SetBinContent(i + 1, MIN_anu_mc->GetBinContent(i + 1));
+        fMCHist->SetBinError(i + 1, MIN_anu_mc->GetBinError(i + 1));
       }
-    } else if (sample == 1){
+    } else if (sample == 1) {
 
       MIN_nu = static_cast<MINERvA_CCQE_XSec_1DQ2_nu*>(exp);
       TH1D* MIN_nu_mc = (TH1D*) MIN_nu->GetMCList().at(0);
-      for (int i = 0; i < 8; i++){
-	std::cout << "Adding MIN_nu_MC " << i+1+8 << " : " << i+1 << " " << MIN_nu_mc->GetBinContent(i+1) << std::endl;
-	fMCHist->SetBinContent(i+1+8, MIN_nu_mc->GetBinContent(i+1));
-	fMCHist  ->SetBinError(i+1+8, MIN_nu_mc->GetBinError(i+1));
+      for (int i = 0; i < 8; i++) {
+        std::cout << "Adding MIN_nu_MC " << i + 1 + 8 << " : " << i + 1 << " " << MIN_nu_mc->GetBinContent(i + 1) << std::endl;
+        fMCHist->SetBinContent(i + 1 + 8, MIN_nu_mc->GetBinContent(i + 1));
+        fMCHist  ->SetBinError(i + 1 + 8, MIN_nu_mc->GetBinError(i + 1));
       }
 
     }
     sample++;
   }
 
   return;
 }
 
 
 
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.h b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.h
index af42670..e74f055 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.h
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_joint.h
@@ -1,50 +1,50 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_1DQ2_joint_H_SEEN
 #define MINERVA_1DQ2_joint_H_SEEN
 
 // Fit Includes
 #include "MeasurementBase.h"
 #include "JointMeas1D.h"
 #include "MINERvA_CCQE_XSec_1DQ2_nu.h"
 #include "MINERvA_CCQE_XSec_1DQ2_antinu.h"
 
 class MINERvA_CCQE_XSec_1DQ2_joint : public JointMeas1D {
 public:
 
-  MINERvA_CCQE_XSec_1DQ2_joint(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCQE_XSec_1DQ2_joint(nuiskey samplekey);
   virtual ~MINERvA_CCQE_XSec_1DQ2_joint() {};
   void MakePlots();
 
  private:
 
   // This is a dummy, the signal is defined separately for each sample!
   bool isSignal(){return false;};
 
   bool isFluxFix, fullphasespace;
 
   // Need to have the neutrino and anti-neutrino objects here
   MINERvA_CCQE_XSec_1DQ2_nu * MIN_nu;
   MINERvA_CCQE_XSec_1DQ2_antinu * MIN_anu;
   Int_t nBins;
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.cxx b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.cxx
index 250eb4f..f92592e 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.cxx
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.cxx
@@ -1,138 +1,148 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCQE_XSec_1DQ2_nu.h"
 
 //********************************************************************
-MINERvA_CCQE_XSec_1DQ2_nu::MINERvA_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCQE_XSec_1DQ2_nu::MINERvA_CCQE_XSec_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Defaults
-  fName = name;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  isFluxFix      = name.find("_oldflux") == std::string::npos;
-  fullphasespace = name.find("_20deg")   == std::string::npos;
-  EnuMin = 1.5;
-  EnuMax = 10.;
-  fNormError = 0.101;
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG,FULL/NORM";
-  fDefaultTypes = "FIX/FULL";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup the Data Plots
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCQE/";
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCQE_XSec_1DQ2_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current Numu \n" \
+                        "Signal: True CCQE/2p2h defined at the vertex level \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(1.5, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  isFluxFix      = !fSettings.Found("name", "_oldflux");
+  fullphasespace = !fSettings.Found("name", "_20deg");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCQE_XSec_1DQ2_nu");
+
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CCQE/";
   std::string datafilename  = "";
   std::string covarfilename = "";
 
   // Full Phase Space
-  if (fullphasespace){
+  if (fullphasespace) {
 
-    if (isFluxFix){
-      if (fIsShape){
+    if (isFluxFix) {
+      if (fIsShape) {
         ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
                  << "datasets with fixed flux information. NUISANCE will scale MC to match "
                  << "data normalization but full covariance will be used. " << std::endl;
       }
       datafilename  = "Q2QE_numu_data_fluxfix.txt";
       covarfilename = "Q2QE_numu_covar_fluxfix.txt";
 
     } else {
-      if (fIsShape){
-	datafilename  = "Q2QE_numu_data_SHAPE-extracted.txt";
-	covarfilename = "Q2QE_numu_covar_SHAPE-extracted.txt";
+      if (fIsShape) {
+        datafilename  = "Q2QE_numu_data_SHAPE-extracted.txt";
+        covarfilename = "Q2QE_numu_covar_SHAPE-extracted.txt";
       } else {
-	datafilename  = "Q2QE_numu_data.txt";
-	covarfilename = "Q2QE_numu_covar.txt";
+        datafilename  = "Q2QE_numu_data.txt";
+        covarfilename = "Q2QE_numu_covar.txt";
       }
     }
 
-  // Restricted Phase Space
+    // Restricted Phase Space
   } else {
-    if (isFluxFix){
-      if (fIsShape){
+    if (isFluxFix) {
+      if (fIsShape) {
         ERR(WRN) << "SHAPE likelihood comparison not available for MINERvA "
                  << "datasets with fixed flux information. NUISANCE will scale MC to match "
                  << "data normalization but full covariance will be used. " << std::endl;
       }
       datafilename  = "20deg_Q2QE_numu_data_fluxfix.txt";
       covarfilename = "20deg_Q2QE_numu_covar_fluxfix.txt";
 
     } else {
-      if (fIsShape){
-	datafilename  = "20deg_Q2QE_numu_data_SHAPE-extracted.txt";
-	covarfilename = "20deg_Q2QE_numu_covar_SHAPE-extracted.txt";
+      if (fIsShape) {
+        datafilename  = "20deg_Q2QE_numu_data_SHAPE-extracted.txt";
+        covarfilename = "20deg_Q2QE_numu_covar_SHAPE-extracted.txt";
       } else {
-	datafilename  = "20deg_Q2QE_numu_data.txt";
-	covarfilename = "20deg_Q2QE_numu_covar.txt";
+        datafilename  = "20deg_Q2QE_numu_data.txt";
+        covarfilename = "20deg_Q2QE_numu_covar.txt";
       }
     }
   }
 
-  this->SetDataValues( basedir + datafilename );
-  this->SetCovarMatrixFromText( basedir + covarfilename, 8 );
-
-  // Quick Fix for Correl/Covar Issues only for old data
-  if (!isFluxFix){
-    fCorrel = (TMatrixDSym*)fFullCovar->Clone();
-    delete fFullCovar;
-    delete covar;
-    delete fDecomp;
-    fFullCovar = StatUtils::GetCovarFromCorrel(fCorrel,fDataHist);
-    (*fFullCovar) *= 1E76;
-  }
+  fSettings.SetDataInput(  basedir + datafilename );
+  fSettings.SetCovarInput( basedir + covarfilename );
+  fSettings.DefineAllowedSpecies("numu");
 
-  covar = StatUtils::GetInvert(fFullCovar);
-  fDecomp = StatUtils::GetDecomp(fFullCovar);
+  FinaliseSampleSettings();
 
-  // Setup Default MC Histograms
-  this->SetupDefaultHist();
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 * 13.0 / 6.0 / (fNEvents + 0.)) / TotalIntegratedFlux();
 
-  // Set Scale Factor (EventHist/nucleons) * NNucl / NNeutons
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38*13.0/6.0/(fNEvents+0.))/this->TotalIntegratedFlux();
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+
+  if (!isFluxFix or !fullphasespace){ 
+    SetCorrelationFromTextFile( fSettings.GetCovarInput() );
+  } else {
+    SetCovarFromTextFile( fSettings.GetCovarInput() );
+  }
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
+
+
 //********************************************************************
-void MINERvA_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent *event){
+void MINERvA_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double ThetaMu  = Pnu.Vect().Angle(Pmu.Vect());
-  double q2qe     = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 34.,true);
+  double q2qe     = FitUtils::Q2QErec(Pmu, cos(ThetaMu), 34., true);
 
   // Set binning variable
   fXVar = q2qe;
+
   return;
 }
 
 
 
 //********************************************************************
-bool MINERvA_CCQE_XSec_1DQ2_nu::isSignal(FitEvent *event){
+bool MINERvA_CCQE_XSec_1DQ2_nu::isSignal(FitEvent *event) {
 //*******************************************************************
   return SignalDef::isCCQEnumu_MINERvA(event, EnuMin, EnuMax, fullphasespace);
 }
 
diff --git a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.h b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.h
index 5134e15..8ab8bbe 100644
--- a/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.h
+++ b/src/MINERvA/MINERvA_CCQE_XSec_1DQ2_nu.h
@@ -1,62 +1,62 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #ifndef MINERVA_1DQ2_nu_H_SEEN
 #define MINERVA_1DQ2_nu_H_SEEN
 
 #include "Measurement1D.h"
 
 ///\brief MINERvA CCQE+2p2h Analysis : Q2 Distribution
 ///
 ///\n Ref:
 ///\n Input: CH events generated with at least CCQE+2p2h interaction modes with flux given in Ref.
 //********************************************************************
 class MINERvA_CCQE_XSec_1DQ2_nu : public Measurement1D {
 //********************************************************************
 public:
 
   ///\brief Setup data histograms and full covariance matrix
   ///\n Available fit options: FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK
   ///\n Sample is given as /neutron.
   ///
   ///\n Valid Sample Names:
   ///\n 1. MINERvA_CCQE_XSec_1DQ2_nu - Latest update full phase space
   ///\n 2. MINERvA_CCQE_XSec_1DQ2_nu_20deg - Latest update restricted phase space
   ///\n 3. MINERvA_CCQE_XSec_1DQ2_nu_oldflux - Old flux from original release, full phase space
   ///\n 4. MINERvA_CCQE_XSec_1DQ2_nu_20deg_oldflux - Old flux from original release, restricted phase space
-  MINERvA_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCQE_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~MINERvA_CCQE_XSec_1DQ2_nu() {};
 
   ///\brief Signal is True CCQE+2p2h
   ///
   ///\n 1. True Mode == 1 or 2
   ///\n 2. 1.5 < Enu < 10.0
   ///\n 3. Muon Angle < 20deg (Restricted PS)
   bool isSignal(FitEvent* event);
 
   ///\brief Determine Q2 from the muon
   void FillEventVariables(FitEvent *event);
 
  private:
 
   bool isFluxFix; /// Flag for using updated flux
   bool fullphasespace; /// Flag for restricting phase space
 
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.cxx b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.cxx
index 5864c16..a176039 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.cxx
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.cxx
@@ -1,116 +1,124 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCinc_XSec_1DEnu_nu.h"
 
+
 //********************************************************************
-MINERvA_CCinc_XSec_1DEnu_nu::MINERvA_CCinc_XSec_1DEnu_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type,
-						     std::string fakeDataFile){
+MINERvA_CCinc_XSec_1DEnu_nu::MINERvA_CCinc_XSec_1DEnu_nu(std::string name, std::string inputfile, std::string type){
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  fPlotTitles = "; Neutrino energy (GeV); d#sigma/dE_{#nu} (cm^{2}/GeV/nucleon)";
-  EnuMin = 2.;
-  EnuMax = 20.;
-  target = "";
-  fIsRawEvents = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCinc_XSec_1DEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(name, inputfile, type);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("d#sigma/dE_{#nu} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX/DIAG/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(2.0, 20.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetTitle("MINERvA_CCinc_XSec_1DEnu_nu");
 
-  if      (name.find("C12")   != std::string::npos) target =   "C12";
+  target = "";
+  if      (name.find("C12")  != std::string::npos) target =   "C12";
   else if (name.find("Fe56")  != std::string::npos) target =  "Fe56";
   else if (name.find("Pb208") != std::string::npos) target = "Pb208";
   if      (name.find("DEN")   != std::string::npos) target =   "CH";
   if (target == "") ERR(WRN) << "target " << target << " was not found!" << std::endl;
 
-  // Setup the Data Plots
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCinc/";
-  std::string smearfilename  = "CCinc_"+target+"_x_smear.csv";
-  int nbins = 8;
-  double bins[9] = {2, 3, 4, 5, 6, 8, 10, 15, 20};
+  // fSettings.SetSmearingInput( FitPar::GetDataBase() + "/MINERvA/CCinc/CCinc_"+target+"_x_smear.csv" );
 
-  // Make a dummy fDataHist so it is used to construct other histograms...
-  this->fDataHist = new TH1D(name.c_str(),(name+fPlotTitles).c_str(),nbins,bins);
+  FinaliseSampleSettings();
 
-  // Setup Default MC Histograms
-  this->SetupDefaultHist();
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux();
 
-  // Set Scale Factor (EventHist/nucleons) so I don't need to know what the target is here
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux(); // NEUT
+  // Plot Setup -------------------------------------------------------
+  double binsx[9] = {2, 3, 4, 5, 6, 8, 10, 15, 20};
+  CreateDataHistogram(8, binsx);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
 void MINERvA_CCinc_XSec_1DEnu_nu::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   Enu  = Pnu.E()/1000.;
   ThetaMu = Pnu.Vect().Angle(Pmu.Vect());
 
   fXVar   = Enu;
   return;
 }
 
 
-
 //********************************************************************
 bool MINERvA_CCinc_XSec_1DEnu_nu::isSignal(FitEvent *event){
 //*******************************************************************
 
   // Throw away NC events
   if (event->Mode > 30) return false;
 
   // Only look at numu events
   if ((event->PartInfo(0))->fPID != 14) return false;
 
   // Restrict the phase space to theta < 17 degrees
   if (ThetaMu > 0.296706) return false;
 
   // restrict energy range
   if (Enu < this->EnuMin || Enu > this->EnuMax) return false;
 
   return true;
 };
 
 //********************************************************************
 void MINERvA_CCinc_XSec_1DEnu_nu::ScaleEvents(){
 //********************************************************************
 
   // Get rid of this because it causes odd behaviour
   //Measurement1D::ScaleEvents();
 
   this->fMCHist->Scale(this->fScaleFactor, "width");
 
   // Proper error scaling - ROOT Freaks out with xsec weights sometimes
   for(int i=0; i<this->fMCStat->GetNbinsX();i++) {
 
     if (this->fMCStat->GetBinContent(i+1) != 0)
       this->fMCHist->SetBinError(i+1, this->fMCHist->GetBinContent(i+1) * this->fMCStat->GetBinError(i+1) / this->fMCStat->GetBinContent(i+1) );
     else this->fMCHist->SetBinError(i+1, this->fMCHist->Integral());
   }
 
 }
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.h b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.h
index 5db3d4f..56a993c 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.h
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_nu.h
@@ -1,49 +1,49 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_1DEnu_nu_H_SEEN
 #define MINERVA_1DEnu_nu_H_SEEN
 
 #include "Measurement1D.h"
 
 //********************************************************************
 class MINERvA_CCinc_XSec_1DEnu_nu : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MINERvA_CCinc_XSec_1DEnu_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCinc_XSec_1DEnu_nu(std::string name, std::string inputfile, std::string  type);
   virtual ~MINERvA_CCinc_XSec_1DEnu_nu() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
 
   bool isSignal(FitEvent *event);
 
   void ScaleEvents();
 
   double GetChi2(){return 0.0;};
 
  private:
 
   double Enu, ThetaMu;
   std::string target;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.cxx b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.cxx
index 0d30c1f..a274bd7 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.cxx
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.cxx
@@ -1,179 +1,167 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCinc_XSec_1DEnu_ratio.h"
 
+
 //********************************************************************
-MINERvA_CCinc_XSec_1DEnu_ratio::MINERvA_CCinc_XSec_1DEnu_ratio(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCinc_XSec_1DEnu_ratio::MINERvA_CCinc_XSec_1DEnu_ratio(nuiskey samplekey) {
 //********************************************************************
 
-  // Setup The Measurement
-  fName = name;
-  nBins = 8;
-  fPlotTitles = "; Neutrino energy (GeV); d#sigma/dE_{#nu} (cm^{2}/GeV/nucleon)";
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCinc_XSec_1DEnu_ratio sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle(" d#sigma/dE_{#nu} (cm^{2}/GeV/nucleon)");
+  fSettings.SetAllowedTypes("FIX/DIAG,FULL/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 20.0);
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCinc_XSec_1DEnu_ratio");
+  
   fIsRatio = true;
-  fIsDiag  = false;
-  target  = "";
-  SetupMeasurement(inputfiles, type, rw, fakeDataFile);
+  nBins = 8;
 
-  if      (name.find("C12")   != std::string::npos) target =   "C12";
-  else if (name.find("Fe56")  != std::string::npos) target =  "Fe56";
-  else if (name.find("Pb208") != std::string::npos) target = "Pb208";
+  target  = "";
+  if      (fSettings.Found("name", "C12")) target =   "C12";
+  else if (fSettings.Found("name", "Fe56")) target =   "Fe56";
+  else if (fSettings.Found("name", "Pb208")) target =   "Pb208";
   else {
     ERR(FTL) << "target " << target << " was not found!" << std::endl;
     exit(-1);
   }
 
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CCinc/";
+  fSettings.SetDataInput(  basedir + "CCinc_" + target + "_CH_ratio_Enu_data.csv" );
+  fSettings.SetCovarInput( basedir + "CCinc_" + target + "_CH_ratio_Enu_covar.csv" );
+  FinaliseSampleSettings();
+
   // Get parsed input files
-  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA CCinc ratio requires input files in format: NUMERATOR;DENOMINATOR"<<std::endl;
+  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA CCinc ratio requires input files in format: NUMERATOR;DENOMINATOR" << std::endl;
   std::string inFileNUM = fSubInFiles.at(0);
   std::string inFileDEN = fSubInFiles.at(1);
 
-  // Push classes back into list for processing loop
-  // this->fSubChain.push_back(NUM);
-  // this->fSubChain.push_back(DEN);
+  // Scaling Setup ---------------------------------------------------
+  // Ratio of sub classes so non needed
 
-  // Setup the Data input
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCinc/";
-  std::string datafilename  = "CCinc_"+target+"_CH_ratio_Enu_data.csv";
-  std::string covarfilename = "CCinc_"+target+"_CH_ratio_Enu_covar.csv";
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile(fSettings.GetCovarInput());
 
-  this->SetDataValues( basedir + datafilename );
-  this->SetCovarMatrixFromText( basedir + covarfilename, nBins);
 
-  // Setup Experiments
-  NUM  = new MINERvA_CCinc_XSec_1DEnu_nu("MINERvA_CCinc_XSec_1DEnu_"+target+"_CH_NUM", inFileNUM, rw, type, fakeDataFile);
-  DEN  = new MINERvA_CCinc_XSec_1DEnu_nu("MINERvA_CCinc_XSec_1DEnu_"+target+"_CH_DEN", inFileDEN, rw, type, fakeDataFile);
+  // Setup Experiments  -------------------------------------------------------
+  std::string type = samplekey.GetS("type");
+  NUM  = new MINERvA_CCinc_XSec_1DEnu_nu("MINERvA_CCinc_XSec_1DEnu_" + target + "_CH_NUM", inFileNUM, type);
+  DEN  = new MINERvA_CCinc_XSec_1DEnu_nu("MINERvA_CCinc_XSec_1DEnu_" + target + "_CH_DEN", inFileDEN, type);
   NUM  ->SetNoData();
   DEN  ->SetNoData();
 
   // Add to chain for processing
   this->fSubChain.clear();
   this->fSubChain.push_back(NUM);
   this->fSubChain.push_back(DEN);
 
-  // Setup Default MC Hists
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void MINERvA_CCinc_XSec_1DEnu_ratio::MakePlots(){
+void MINERvA_CCinc_XSec_1DEnu_ratio::MakePlots() {
 //********************************************************************
 
   UInt_t sample = 0;
-  for (std::vector<MeasurementBase*>::const_iterator expIter = this->fSubChain.begin(); expIter != this->fSubChain.end(); expIter++){
+  for (std::vector<MeasurementBase*>::const_iterator expIter = this->fSubChain.begin(); expIter != this->fSubChain.end(); expIter++) {
     MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
 
     if      (sample == 0) this->NUM = static_cast<MINERvA_CCinc_XSec_1DEnu_nu*>(exp);
     else if (sample == 1) this->DEN = static_cast<MINERvA_CCinc_XSec_1DEnu_nu*>(exp);
     else break;
     sample++;
   }
 
   // Now make the ratio histogram
   TH1D* NUM_MC = (TH1D*)this->NUM->GetMCList().at(0)->Clone();
   TH1D* DEN_MC = (TH1D*)this->DEN->GetMCList().at(0)->Clone();
 
-  for (int i=0; i < nBins; ++i){
+  for (int i = 0; i < nBins; ++i) {
     double binVal = 0;
     double binErr = 0;
 
-    if (DEN_MC->GetBinContent(i+1) && NUM_MC->GetBinContent(i+1)) {
-      binVal = NUM_MC->GetBinContent(i+1)/DEN_MC->GetBinContent(i+1);
-      double fractErrNUM = NUM_MC->GetBinError(i+1)/NUM_MC->GetBinContent(i+1);
-      double fractErrDEN = DEN_MC->GetBinError(i+1)/DEN_MC->GetBinContent(i+1);
-      binErr = binVal*sqrt(fractErrNUM*fractErrNUM + fractErrDEN*fractErrDEN);
+    if (DEN_MC->GetBinContent(i + 1) && NUM_MC->GetBinContent(i + 1)) {
+      binVal = NUM_MC->GetBinContent(i + 1) / DEN_MC->GetBinContent(i + 1);
+      double fractErrNUM = NUM_MC->GetBinError(i + 1) / NUM_MC->GetBinContent(i + 1);
+      double fractErrDEN = DEN_MC->GetBinError(i + 1) / DEN_MC->GetBinContent(i + 1);
+      binErr = binVal * sqrt(fractErrNUM * fractErrNUM + fractErrDEN * fractErrDEN);
     }
 
-    this->fMCHist->SetBinContent(i+1, binVal);
-    this->fMCHist->SetBinError(i+1, binErr);
+    this->fMCHist->SetBinContent(i + 1, binVal);
+    this->fMCHist->SetBinError(i + 1, binErr);
   }
 
   return;
 }
 
 
 //********************************************************************
-void MINERvA_CCinc_XSec_1DEnu_ratio::SetCovarMatrixFromText(std::string covarFile, int dim){
+void MINERvA_CCinc_XSec_1DEnu_ratio::SetCovarMatrixFromText(std::string covarFile, int dim) {
 //********************************************************************
 
   // WARNING this reads in the data CORRELATIONS
   // Make a counter to track the line number
   int row = 0;
 
   std::string line;
-  std::ifstream covar(covarFile.c_str(),ifstream::in);
+  std::ifstream covar(covarFile.c_str(), ifstream::in);
 
-  this->covar = new TMatrixDSym(dim);
   this->fFullCovar = new TMatrixDSym(dim);
-  if(covar.is_open()) LOG(SAM) << "Reading covariance matrix from file: " << covarFile << std::endl;
-  else ERR(FTL) <<"Covariance matrix provided is incorrect: "<<covarFile<<std::endl;
+  if (covar.is_open()) LOG(SAM) << "Reading covariance matrix from file: " << covarFile << std::endl;
+  else ERR(FTL) << "Covariance matrix provided is incorrect: " << covarFile << std::endl;
 
-  while(std::getline(covar >> std::ws, line, '\n')){
+  while (std::getline(covar >> std::ws, line, '\n')) {
     int column = 0;
 
     // Loop over entries and insert them into matrix
     // Multiply by the errors to get the covariance, rather than the correlation matrix
     std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
     for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++){
+         iter != entries.end(); iter++) {
 
-	double val = (*iter) * this->fDataHist->GetBinError(row+1)*this->fDataHist->GetBinError(column+1);
+      double val = (*iter) * this->fDataHist->GetBinError(row + 1) * this->fDataHist->GetBinError(column + 1);
 
-	(*this->covar)(row, column) = val;
-	(*this->fFullCovar)(row, column) = val;
-	column++;
+      (*this->fFullCovar)(row, column) = val;
+      column++;
     }
     row++;
   }
 
   // Robust matrix inversion method
-  TDecompSVD LU = TDecompSVD(*this->covar);
-  this->covar = new TMatrixDSym(dim, LU .Invert().GetMatrixArray(), "");
+  this->covar = StatUtils::GetInvert(fFullCovar);
 
   return;
 };
 
 
-
-//********************************************************************
-void MINERvA_CCinc_XSec_1DEnu_ratio::Write(std::string drawOpt){
-//********************************************************************
-
-  LOG(SAM)<<"Writing Normal Plots in MINERvA_CCinc_XSec_1DEnu_ratio::Write()" <<std::endl;
-  this->GetDataList().at(0)->Write();
-  this->GetMCList()  .at(0)->Write();
-
-  if (this->fFullCovar){
-    TH2D cov = TH2D((*this->fFullCovar));
-    cov.SetNameTitle((this->fName+"_cov").c_str(),(this->fName+"_cov;Bins; Bins;").c_str());
-    cov.Write();
-  }
-
-  if (this->covar){
-    TH2D covinv = TH2D((*this->covar));
-    covinv.SetNameTitle((this->fName+"_covinv").c_str(),(this->fName+"_covinv;Bins; Bins;").c_str());
-    covinv.Write();
-  }
-
-  return;
-}
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h
index c8e3aaa..357c14a 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1DEnu_ratio.h
@@ -1,57 +1,54 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCinc_XSec_1DEnu_ratio_H_SEEN
 #define MINERVA_CCinc_XSec_1DEnu_ratio_H_SEEN
 
 // Fit Includes
 #include "MeasurementBase.h"
 #include "JointMeas1D.h"
 #include "MINERvA_CCinc_XSec_1DEnu_nu.h"
 
 class MINERvA_CCinc_XSec_1DEnu_ratio : public JointMeas1D {
 public:
 
-  MINERvA_CCinc_XSec_1DEnu_ratio(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCinc_XSec_1DEnu_ratio(nuiskey samplekey);
   virtual ~MINERvA_CCinc_XSec_1DEnu_ratio() {};
 
   void MakePlots();
 
   // This is a dummy function as it is not required for the ratio (and does bad bad things)
   void ScaleEvents(){return;};;
 
   void SetCovarMatrixFromText(std::string covarFile, int dim);
 
-  // Custom write function because the ratio has much more limited information available than normal.
-  void Write(std::string drawOpt);
-
  private:
 
   // This is a dummy, the signal is defined separately for each sample!
   bool isSignal(){return false;};  
 
   // Need to have the distributions for the numerator and denominator stored separately
   MINERvA_CCinc_XSec_1DEnu_nu * NUM;
   MINERvA_CCinc_XSec_1DEnu_nu * DEN;
   Int_t nBins;
   std::string target;
 
 };
   
 #endif
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.cxx b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.cxx
index 50e07c4..40e7b14 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.cxx
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.cxx
@@ -1,124 +1,131 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCinc_XSec_1Dx_nu.h"
 
+
 //********************************************************************
-MINERvA_CCinc_XSec_1Dx_nu::MINERvA_CCinc_XSec_1Dx_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type,
-						     std::string fakeDataFile){
+MINERvA_CCinc_XSec_1Dx_nu::MINERvA_CCinc_XSec_1Dx_nu(std::string name, std::string inputfile, std::string type){
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  fPlotTitles = "; Reconstructed Bjorken x; d#sigma/dx (cm^{2}/nucleon)";
-  EnuMin = 2.;
-  EnuMax = 20.;
-  target = "";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCinc_XSec_1Dx_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(name, inputfile, type);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Reconstructed Bjorken x");
+  fSettings.SetYTitle("d#sigma/dx (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX/DIAG/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(2.0, 20.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetTitle("MINERvA_CCinc_XSec_1Dx_nu");
 
-  if      (name.find("C12")   != std::string::npos) target =   "C12";
+  target = "";
+  if      (name.find("C12")  != std::string::npos) target =   "C12";
   else if (name.find("Fe56")  != std::string::npos) target =  "Fe56";
   else if (name.find("Pb208") != std::string::npos) target = "Pb208";
   if      (name.find("DEN")   != std::string::npos) target =   "CH";
   if (target == "") ERR(WRN) << "target " << target << " was not found!" << std::endl;
 
-  // Setup the Data Plots
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCinc/";
-  std::string smearfilename  = "CCinc_"+target+"_x_smear.csv";
-  int nbins = 6;
-  double bins[7] = {0, 0.1, 0.3, 0.7, 0.9, 1.1, 1.5};
+  FinaliseSampleSettings();
 
-  // Note that only the ratio is given, so I can't do this->SetDataValues or this->SetCovarMatrix
-  this->fDataHist = new TH1D(name.c_str(),(name+fPlotTitles).c_str(),nbins,bins);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux();
 
-  // Setup Default MC Histograms
-  this->SetupDefaultHist();
+  // Plot Setup -------------------------------------------------------
+  double binsx[7] = {0, 0.1, 0.3, 0.7, 0.9, 1.1, 1.5};
+  CreateDataHistogram(6, binsx);
 
-  // The smearing matrix is rectangular
-  this->SetSmearingMatrix(basedir + smearfilename, nbins, nbins+1);
+  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCinc/";
+  std::string smearfilename  = "CCinc_"+target+"_x_smear.csv";
+  SetSmearingMatrix(basedir + smearfilename, 6, 7);
 
-  // Set Scale Factor (EventHist/nucleons) so I don't need to know what the target is here
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))/this->TotalIntegratedFlux(); // NEUT
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
 void MINERvA_CCinc_XSec_1Dx_nu::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   ThetaMu     = Pnu.Vect().Angle(Pmu.Vect());
   TLorentzVector q = Pnu - Pmu;
   double q0   = q.E()/1000.0;
   double Emu  = (Pmu.E())/1000.0;
   Enu_rec     = Emu + q0;
   double Q2   = 4*Enu_rec*Emu*sin(ThetaMu/2)*sin(ThetaMu/2);
   bjork_x     = Q2/2./q0/((PhysConst::mass_proton+PhysConst::mass_neutron)/2.); // Average nucleon masses
 
+  //  if (fIsNumerator)
+
   fXVar   = bjork_x;
   return;
 }
 
 
 
 //********************************************************************
 bool MINERvA_CCinc_XSec_1Dx_nu::isSignal(FitEvent *event){
 //*******************************************************************
 
   // Only look at numu events
   if (!SignalDef::isCCINC(event, 14, EnuMin, EnuMax)) return false;
 
   // Restrict the phase space to theta < 17 degrees
   if (ThetaMu > 0.296706) return false;
 
   // restrict energy range
   if (Enu_rec < this->EnuMin || Enu_rec > this->EnuMax) return false;
 
   return true;
 };
 
 //********************************************************************
 void MINERvA_CCinc_XSec_1Dx_nu::ScaleEvents(){
 //********************************************************************
 
   this->fDataHist = (TH1D*)this->GetMCList().at(0)->Clone();
   this->fDataHist->SetNameTitle((this->fName+"_unsmear").c_str(), (this->fName+"_unsmear"+this->fPlotTitles).c_str());
   this->ApplySmearingMatrix();
 
-  // Get rid of this because it causes odd behaviour
-  //Measurement1D::ScaleEvents();
-
   this->fMCHist->Scale(this->fScaleFactor, "width");
 
   // Proper error scaling - ROOT Freaks out with xsec weights sometimes
   for(int i=0; i<this->fMCStat->GetNbinsX();i++) {
 
     if (this->fMCStat->GetBinContent(i+1) != 0)
       this->fMCHist->SetBinError(i+1, this->fMCHist->GetBinContent(i+1) * this->fMCStat->GetBinError(i+1) / this->fMCStat->GetBinContent(i+1) );
     else this->fMCHist->SetBinError(i+1, this->fMCHist->Integral());
   }
 
 }
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.h b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.h
index bd60130..7e3d49f 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.h
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_nu.h
@@ -1,48 +1,48 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_1Dx_nu_H_SEEN
 #define MINERVA_1Dx_nu_H_SEEN
 
 #include "Measurement1D.h"
 //********************************************************************
 class MINERvA_CCinc_XSec_1Dx_nu : public Measurement1D {
 //********************************************************************
 
 public:
 
-  MINERvA_CCinc_XSec_1Dx_nu(std::string name, std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCinc_XSec_1Dx_nu(std::string name, std::string inputfile, std::string type);
   virtual ~MINERvA_CCinc_XSec_1Dx_nu() {};
 
   // Functions for handling each neut event
   void FillEventVariables(FitEvent *event);
 
   bool isSignal(FitEvent *event);
 
   void ScaleEvents();
 
   double GetChi2(){return 0.0;};
 
  private:
 
   double Enu, Enu_rec, ThetaMu, bjork_x;
   std::string target;
 };
 
 #endif
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.cxx b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.cxx
index fc8b678..6a803c5 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.cxx
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.cxx
@@ -1,179 +1,198 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
-
 #include "MINERvA_CCinc_XSec_1Dx_ratio.h"
 
 //********************************************************************
-MINERvA_CCinc_XSec_1Dx_ratio::MINERvA_CCinc_XSec_1Dx_ratio(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile){
+MINERvA_CCinc_XSec_1Dx_ratio::MINERvA_CCinc_XSec_1Dx_ratio(nuiskey samplekey) {
 //********************************************************************
 
-  // Setup The Measurement
-  fName = name;
-  nBins = 6;
-  fPlotTitles = "; Reconstructed Bjorken x; d#sigma/dx (cm^{2}/nucleon)";
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCinc_XSec_1Dx_ratio sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Reconstructed Bjorken x");
+  fSettings.SetYTitle("d#sigma/dx (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX/DIAG,FULL/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 20.0);
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCinc_XSec_1Dx_ratio");
   fIsRatio = true;
-  fIsDiag  = false;
-  target  = "";
-  SetupMeasurement(inputfiles, type, rw, fakeDataFile);
+  nBins = 8;
 
-  if      (name.find("C12")   != std::string::npos) target =   "C12";
-  else if (name.find("Fe56")  != std::string::npos) target =  "Fe56";
-  else if (name.find("Pb208") != std::string::npos) target = "Pb208";
+  target  = "";
+  if      (fSettings.Found("name", "C12")) target =   "C12";
+  else if (fSettings.Found("name", "Fe56")) target =   "Fe56";
+  else if (fSettings.Found("name", "Pb208")) target =   "Pb208";
   else {
     ERR(FTL) << "target " << target << " was not found!" << std::endl;
     exit(-1);
   }
 
+  std::string basedir = FitPar::GetDataBase() + "/MINERvA/CCinc/";
+  fSettings.SetDataInput(  basedir + "CCinc_" + target + "_CH_ratio_x_data.csv" );
+  fSettings.SetCovarInput( basedir + "CCinc_" + target + "_CH_ratio_x_covar.csv" );
+
+  FinaliseSampleSettings();
+
+
   // Get parsed input files
-  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA CCinc ratio requires input files in format: NUMERATOR;DENOMINATOR"<<std::endl;
+  if (fSubInFiles.size() != 2) ERR(FTL) << "MINERvA CCinc ratio requires input files in format: NUMERATOR;DENOMINATOR" << std::endl;
   std::string inFileNUM = fSubInFiles.at(0);
   std::string inFileDEN = fSubInFiles.at(1);
 
-  // Push classes back into list for processing loop
-  // this->fSubChain.push_back(NUM);
-  // this->fSubChain.push_back(DEN);
-
-  // Setup the Data input
-  std::string basedir = FitPar::GetDataBase()+"/MINERvA/CCinc/";
-  std::string datafilename  = "CCinc_"+target+"_CH_ratio_x_data.csv";
-  std::string covarfilename = "CCinc_"+target+"_CH_ratio_x_covar.csv";
+  // Scaling Setup ---------------------------------------------------
+  // Ratio of sub classes so non needed
 
-  this->SetDataValues( basedir + datafilename );
-  this->SetCovarMatrixFromText( basedir + covarfilename, nBins);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile(fSettings.GetCovarInput());
 
-  // Setup Experiments
-  NUM  = new MINERvA_CCinc_XSec_1Dx_nu("MINERvA_CCinc_XSec_1Dx_"+target+"_CH_NUM", inFileNUM, rw, type, fakeDataFile);
-  DEN  = new MINERvA_CCinc_XSec_1Dx_nu("MINERvA_CCinc_XSec_1Dx_"+target+"_CH_DEN", inFileDEN, rw, type, fakeDataFile);
+  // Setup Experiments  -------------------------------------------------------
+  std::string type = samplekey.GetS("type");
+  NUM  = new MINERvA_CCinc_XSec_1Dx_nu("MINERvA_CCinc_XSec_1Dx_" + target + "_CH_NUM", inFileNUM, type);
+  DEN  = new MINERvA_CCinc_XSec_1Dx_nu("MINERvA_CCinc_XSec_1Dx_" + target + "_CH_DEN", inFileDEN, type);
   NUM  ->SetNoData();
   DEN  ->SetNoData();
 
   // Add to chain for processing
   this->fSubChain.clear();
   this->fSubChain.push_back(NUM);
   this->fSubChain.push_back(DEN);
 
-  // Setup Default MC Hists
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void MINERvA_CCinc_XSec_1Dx_ratio::MakePlots(){
+void MINERvA_CCinc_XSec_1Dx_ratio::MakePlots() {
 //********************************************************************
 
   UInt_t sample = 0;
-  for (std::vector<MeasurementBase*>::const_iterator expIter = this->fSubChain.begin(); expIter != this->fSubChain.end(); expIter++){
+  for (std::vector<MeasurementBase*>::const_iterator expIter = this->fSubChain.begin(); expIter != this->fSubChain.end(); expIter++) {
     MeasurementBase* exp = static_cast<MeasurementBase*>(*expIter);
 
     if      (sample == 0) this->NUM = static_cast<MINERvA_CCinc_XSec_1Dx_nu*>(exp);
     else if (sample == 1) this->DEN = static_cast<MINERvA_CCinc_XSec_1Dx_nu*>(exp);
     else break;
     sample++;
   }
 
   // Now make the ratio histogram
   TH1D* NUM_MC = (TH1D*)this->NUM->GetMCList().at(0)->Clone();
   TH1D* DEN_MC = (TH1D*)this->DEN->GetMCList().at(0)->Clone();
 
-  for (int i=0; i < nBins; ++i){
+  std::cout << "MakingPlots CCINC X = " << NUM_MC->Integral() << " " << DEN_MC->Integral() << std::endl;
+  sleep(10);
+
+  for (int i = 0; i < nBins; ++i) {
     double binVal = 0;
     double binErr = 0;
 
-    if (DEN_MC->GetBinContent(i+1) && NUM_MC->GetBinContent(i+1)) {
-      binVal = NUM_MC->GetBinContent(i+1)/DEN_MC->GetBinContent(i+1);
-      double fractErrNUM = NUM_MC->GetBinError(i+1)/NUM_MC->GetBinContent(i+1);
-      double fractErrDEN = DEN_MC->GetBinError(i+1)/DEN_MC->GetBinContent(i+1);
-      binErr = binVal*sqrt(fractErrNUM*fractErrNUM + fractErrDEN*fractErrDEN);
+    if (DEN_MC->GetBinContent(i + 1) && NUM_MC->GetBinContent(i + 1)) {
+      binVal = NUM_MC->GetBinContent(i + 1) / DEN_MC->GetBinContent(i + 1);
+      double fractErrNUM = NUM_MC->GetBinError(i + 1) / NUM_MC->GetBinContent(i + 1);
+      double fractErrDEN = DEN_MC->GetBinError(i + 1) / DEN_MC->GetBinContent(i + 1);
+      binErr = binVal * sqrt(fractErrNUM * fractErrNUM + fractErrDEN * fractErrDEN);
     }
 
-    this->fMCHist->SetBinContent(i+1, binVal);
-    this->fMCHist->SetBinError(i+1, binErr);
+    this->fMCHist->SetBinContent(i + 1, binVal);
+    this->fMCHist->SetBinError(i + 1, binErr);
   }
 
   return;
 }
 
 
 //********************************************************************
-void MINERvA_CCinc_XSec_1Dx_ratio::SetCovarMatrixFromText(std::string covarFile, int dim){
+void MINERvA_CCinc_XSec_1Dx_ratio::SetCovarMatrixFromText(std::string covarFile, int dim) {
 //********************************************************************
 
   // WARNING this reads in the data CORRELATIONS
   // Make a counter to track the line number
   int row = 0;
 
   std::string line;
-  std::ifstream covar(covarFile.c_str(),ifstream::in);
+  std::ifstream covar(covarFile.c_str(), ifstream::in);
 
   this->covar = new TMatrixDSym(dim);
   this->fFullCovar = new TMatrixDSym(dim);
-  if(covar.is_open()) LOG(SAM) << "Reading covariance matrix from file: " << covarFile << std::endl;
-  else ERR(FTL) <<"Covariance matrix provided is incorrect: "<<covarFile<<std::endl;
+  if (covar.is_open()) LOG(SAM) << "Reading covariance matrix from file: " << covarFile << std::endl;
+  else ERR(FTL) << "Covariance matrix provided is incorrect: " << covarFile << std::endl;
 
-  while(std::getline(covar >> std::ws, line, '\n')){
+  while (std::getline(covar >> std::ws, line, '\n')) {
     int column = 0;
 
     // Loop over entries and insert them into matrix
     // Multiply by the errors to get the covariance, rather than the correlation matrix
     std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
     for (std::vector<double>::iterator iter = entries.begin();
-         iter != entries.end(); iter++){
+         iter != entries.end(); iter++) {
 
-      double val = (*iter) * this->fDataHist->GetBinError(row+1)*this->fDataHist->GetBinError(column+1);
+      double val = (*iter) * this->fDataHist->GetBinError(row + 1) * this->fDataHist->GetBinError(column + 1);
 
       (*this->covar)(row, column) = val;
       (*this->fFullCovar)(row, column) = val;
       column++;
     }
     row++;
   }
 
   // Robust matrix inversion method
   TDecompSVD LU = TDecompSVD(*this->covar);
   this->covar = new TMatrixDSym(dim, LU .Invert().GetMatrixArray(), "");
 
   return;
 };
 
 
 
 //********************************************************************
-void MINERvA_CCinc_XSec_1Dx_ratio::Write(std::string drawOpt){
+void MINERvA_CCinc_XSec_1Dx_ratio::Write(std::string drawOpt) {
 //********************************************************************
 
-  LOG(SAM)<<"Writing Normal Plots in MINERvA_CCinc_XSec_1Dx_ratio::Write()" <<std::endl;
-  this->GetDataList().at(0)->Write();
-  this->GetMCList()  .at(0)->Write();
+  LOG(SAM) << "Writing Normal Plots in MINERvA_CCinc_XSec_1Dx_ratio::Write()" << std::endl;
+  JointMeas1D::Write(drawOpt);
+  return;
+
+  //this->GetDataList().at(0)->Write();
+  //  this->GetMCList()  .at(0)->Write();
 
-  if (this->fFullCovar){
+  if (this->fFullCovar) {
     TH2D cov = TH2D((*this->fFullCovar));
-    cov.SetNameTitle((this->fName+"_cov").c_str(),(this->fName+"_cov;Bins; Bins;").c_str());
+    cov.SetNameTitle((this->fName + "_cov").c_str(), (this->fName + "_cov;Bins; Bins;").c_str());
     cov.Write();
   }
 
-  if (this->covar){
+  if (this->covar) {
     TH2D covinv = TH2D((*this->covar));
-    covinv.SetNameTitle((this->fName+"_covinv").c_str(),(this->fName+"_covinv;Bins; Bins;").c_str());
+    covinv.SetNameTitle((this->fName + "_covinv").c_str(), (this->fName + "_covinv;Bins; Bins;").c_str());
     covinv.Write();
   }
 
   return;
 }
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.h b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.h
index 7984eef..fa4e101 100644
--- a/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.h
+++ b/src/MINERvA/MINERvA_CCinc_XSec_1Dx_ratio.h
@@ -1,57 +1,57 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_CCinc_XSec_1Dx_ratio_H_SEEN
 #define MINERVA_CCinc_XSec_1Dx_ratio_H_SEEN
 
 // Fit Includes
 #include "MeasurementBase.h"
 #include "JointMeas1D.h"
 #include "MINERvA_CCinc_XSec_1Dx_nu.h"
 
 class MINERvA_CCinc_XSec_1Dx_ratio : public JointMeas1D {
 public:
 
-  MINERvA_CCinc_XSec_1Dx_ratio(std::string name, std::string inputfiles, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  MINERvA_CCinc_XSec_1Dx_ratio(nuiskey samplekey);
   virtual ~MINERvA_CCinc_XSec_1Dx_ratio() {};
 
   void MakePlots();
 
   // This is a dummy function as it is not required for the ratio (and does bad bad things)
   void ScaleEvents(){return;};;
 
   void SetCovarMatrixFromText(std::string covarFile, int dim);
 
   // Custom write function because the ratio has much more limited information available than normal.
   void Write(std::string drawOpt);
 
  private:
 
   // This is a dummy, the signal is defined separately for each sample!
   bool isSignal(){return false;};  
 
   // Need to have the distributions for the numerator and denominator stored separately
   MINERvA_CCinc_XSec_1Dx_nu * NUM;
   MINERvA_CCinc_XSec_1Dx_nu * DEN;
   Int_t nBins;
   std::string target;
 
 };
   
 #endif
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.cxx b/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.cxx
index c2d201f..02710ca 100755
--- a/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.cxx
+++ b/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.cxx
@@ -1,139 +1,153 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MINERvA_SignalDef.h"
 
 #include "MINERvA_CCinc_XSec_2DEavq3_nu.h"
 
+
+
 //********************************************************************
-MINERvA_CCinc_XSec_2DEavq3_nu::MINERvA_CCinc_XSec_2DEavq3_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MINERvA_CCinc_XSec_2DEavq3_nu::MINERvA_CCinc_XSec_2DEavq3_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = "MINERvA_CCinc_XSec_2DEavq3_nu";
-  fPlotTitles = "; q_{3} (GeV); E_{avail} (GeV); d^{2}#sigma/dq_{3}dE_{avail} (cm^{2}/GeV^{2})";
-  EnuMin = 2.;
-  EnuMax = 6.;
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MINERvA_CCinc_XSec_2DEavq3_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Medium Energy FHC numu  \n" \
+                        "Signal: CC-inclusive with theta < 20deg \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("q_{3} (GeV)");
+  fSettings.SetYTitle("E_{avail} (GeV)");
+  fSettings.SetZTitle("d^{2}#sigma/dq_{3}dE_{avail} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(2.0, 6.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MINERvA_CCinc_XSec_2DEavq3_nu");
+
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MINERvA/CCEavq3/data_2D.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MINERvA/CCEavq3/covar_2D.txt" );
+  fSettings.SetMapInput( FitPar::GetDataBase() + "/MINERvA/CCEavq3/map_2D.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
   hadroncut = FitPar::Config().GetParB("MINERvA_CCinc_XSec_2DEavq3_nu.hadron_cut");
   useq3true = FitPar::Config().GetParB("MINERvA_CCinc_XSec_2DEavq3_nu.useq3true");
   splitMEC_PN_NN = FitPar::Config().GetParB("Modes.split_PN_NN");
-  fNormError = 0.107;
-  fDefaultTypes = "FIX/FULL";
-  fAllowedTypes = "FIX,FREE,SHAPE/FULL,DIAG/MASK";
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Binning for the 2D Histograms
-  this->fNDataPointsX = 7;
-  this->fNDataPointsY = 17;
-  Double_t tempx[7] = {0.0, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8};
-  Double_t tempy[17] = {0.0, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.20, 0.25, 0.30, 0.35, 0.40, 0.50, 0.60, 0.80};
-  this->fXBins = tempx;
-  this->fYBins = tempy;
-
-  // Fill data and 1Dto2D Maps for covariance
-  SetDataValuesFromText(   FitPar::GetDataBase()+"/MINERvA/CCEavq3/data_2D.txt", 1E-42);
-  SetMapValuesFromText(    FitPar::GetDataBase()+"/MINERvA/CCEavq3/map_2D.txt");
-  SetCovarMatrixFromChol(  FitPar::GetDataBase()+"/MINERvA/CCEavq3/covar_2D.txt", 67);
-
-  // Data is in 1E-42 and so is the covariance, need to scale accordingly.
-  (*this->fFullCovar) *= 1E-16;
-  (*this->covar)      *= 1E16;
-
-  // Set data errors from covariance matrix
-  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, fMapHist, 1E-38);
 
-  // Setup mc Histograms
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  // Set Scale Factor
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-42/(fNEvents+0.))/this->TotalIntegratedFlux();
-};
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-42 / (fNEvents + 0.)) / this->TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  Double_t binx[7] = {0.0, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8};
+  Double_t biny[17] = {0.0, 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.20, 0.25, 0.30, 0.35, 0.40, 0.50, 0.60, 0.80};
+  CreateDataHistogram(7, binx, 17, biny);
 
+  SetDataValuesFromTextFile( fSettings.GetDataInput() );
+  ScaleData(1E-42);
 
+  SetMapValuesFromText( fSettings.GetMapInput() );
+
+  SetCholDecompFromTextFile( fSettings.GetCovarInput() );
+  ScaleCovar(1E-16);
+
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, fMapHist, 1E-38);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 //********************************************************************
-void MINERvA_CCinc_XSec_2DEavq3_nu::FillEventVariables(FitEvent *event){
+void MINERvA_CCinc_XSec_2DEavq3_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Seperate MEC
-  if (splitMEC_PN_NN){
+  if (splitMEC_PN_NN) {
     int npr = 0;
     int nne = 0;
 
-    for (UInt_t j = 0; j < event->Npart(); j++){
+    for (UInt_t j = 0; j < event->Npart(); j++) {
       if ((event->PartInfo(j))->fIsAlive) continue;
 
       if (event->PartInfo(j)->fPID == 2212) npr++;
       else if (event->PartInfo(j)->fPID == 2112) nne++;
     }
 
-    if (event->Mode == 2 and npr == 1 and nne == 1){
+    if (event->Mode == 2 and npr == 1 and nne == 1) {
       event->Mode = 2;
       Mode = 2;
 
-    } else if (event->Mode == 2 and npr == 0 and nne == 2){
+    } else if (event->Mode == 2 and npr == 0 and nne == 2) {
       event->Mode = 3;
       Mode = 3;
 
     }
   }
 
   // Set Defaults
   double Eav = -999.9;
   double q3 = -999.9;
 
   // If muon found get kinematics
   FitParticle* muon      = event->GetHMFSParticle(13);
   FitParticle* neutrino  = event->GetNeutrinoIn();
-  if (muon && neutrino){
+  if (muon && neutrino) {
 
     // Set Q from Muon
     TLorentzVector q = neutrino->fP - muon->fP;
-    double q0 = (q.E())/1.E3;
+    double q0 = (q.E()) / 1.E3;
     //double q3_true = (q.Vect().Mag())/1.E3;
     double thmu = muon->fP.Vect().Angle(neutrino->fP.Vect());
-    double pmu  = muon->fP.Vect().Mag()/1.E3;
-    double emu  = muon->fP.E()/1.E3;
-    double mmu  = muon->fP.Mag()/1.E3;
+    double pmu  = muon->fP.Vect().Mag() / 1.E3;
+    double emu  = muon->fP.E() / 1.E3;
+    double mmu  = muon->fP.Mag() / 1.E3;
 
     // Get Enu Rec
     double enu_rec = emu + q0;
 
     // Set Q2 QE
-    double q2qe = 2*enu_rec * (emu - pmu * cos(thmu)) - mmu*mmu;
+    double q2qe = 2 * enu_rec * (emu - pmu * cos(thmu)) - mmu * mmu;
 
     // Calc Q3 from Q2QE and EnuTree
-    q3 = sqrt(q2qe + q0*q0);
+    q3 = sqrt(q2qe + q0 * q0);
 
     // Get Eav too
     Eav = FitUtils::GetErecoil_MINERvA_LowRecoil(event) / 1.E3;
   }
 
   // Set Hist Variables
   fXVar = q3;
   fYVar = Eav;
 
   return;
 }
 
 //********************************************************************
-bool MINERvA_CCinc_XSec_2DEavq3_nu::isSignal(FitEvent *event){
+bool MINERvA_CCinc_XSec_2DEavq3_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCCincLowRecoil_MINERvA(event, EnuMin, EnuMax);
 }
diff --git a/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.h b/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.h
index 7352b02..5b274e7 100755
--- a/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.h
+++ b/src/MINERvA/MINERvA_CCinc_XSec_2DEavq3_nu.h
@@ -1,68 +1,68 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINERVA_XSEC_CCINC_2DEAVQ3_H_SEEN
 #define MINERVA_XSEC_CCINC_2DEAVQ3_H_SEEN
 
 #include "Measurement2D.h"
 
 //********************************************************************  
 class MINERvA_CCinc_XSec_2DEavq3_nu : public Measurement2D {
 //********************************************************************  
 
  public:
 
   // Constructor
- MINERvA_CCinc_XSec_2DEavq3_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+ MINERvA_CCinc_XSec_2DEavq3_nu(nuiskey samplekey);
 
   // Destructor
   virtual ~MINERvA_CCinc_XSec_2DEavq3_nu() {
 
     // Remove all the content histograms
     //    for (int i = 0; i < 9; i++)  
       // delete this->fMCHist_content[i];   
 
     // delete everything
     /* delete difHist; */
     /* delete evtsignalHist; */
     /* delete fluxsignalHist; */
     /* delete fMapHist; */
     /* delete status; */
     /* delete PDGHistogram; */
     
     /* // Delete MODE histograms */
     /* for (int i = 0; i < 60; i++) */
     /*   delete fMCHist_PDG[i]; */
 
     return;
   };
 
   // Required functions
   bool isSignal(FitEvent *nvect);
   void FillEventVariables(FitEvent *event);
   
  protected:
   
   // Cuts
   bool hadroncut;
   bool useq3true;
   bool splitMEC_PN_NN;
 };
   
 #endif
diff --git a/src/MINERvA/SAMPLEREADME b/src/MINERvA/SAMPLEREADME
deleted file mode 100644
index fd8c0f0..0000000
--- a/src/MINERvA/SAMPLEREADME
+++ /dev/null
@@ -1,9 +0,0 @@
-./MINERvA_CC0pi_XSec_1DQ2_nu_proton.cxx
-./MINERvA_CC0pi_XSec_1DEe_nue.cxx
-./MINERvA_CC0pi_XSec_1DFill_nue.cxx
-./MINERvA_CC0pi_XSec_1DQ2_nue.cxx
-./MINERvA_CC0pi_XSec_1DThetae_nue.cxx
-./MINERvA_CCQE_XSec_1DQ2_antinu.cxx
-./MINERvA_CCQE_XSec_1DQ2_joint.cxx
-./MINERvA_CCQE_XSec_1DQ2_nu.cxx
-./MINERvA_CCinc_XSec_2DEavq3_nu.cxx
diff --git a/src/MiniBooNE/CMakeLists.txt b/src/MiniBooNE/CMakeLists.txt
index 7b0ad7b..256f82f 100644
--- a/src/MiniBooNE/CMakeLists.txt
+++ b/src/MiniBooNE/CMakeLists.txt
@@ -1,98 +1,102 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.cxx
 MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.cxx
 MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.cxx
 MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.cxx
 MiniBooNE_CC1pi0_XSec_1DEnu_nu.cxx
 MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.cxx
 MiniBooNE_CC1pi0_XSec_1Dppi0_nu.cxx
 MiniBooNE_CC1pip_XSec_2DTuEnu_nu.cxx
 MiniBooNE_CC1pi0_XSec_1DQ2_nu.cxx
 MiniBooNE_CCQE_XSec_1DQ2_antinu.cxx
 MiniBooNE_CC1pi0_XSec_1DTu_nu.cxx
 MiniBooNE_CC1pip_XSec_1DEnu_nu.cxx
 MiniBooNE_CCQE_XSec_1DQ2_nu.cxx
 MiniBooNE_CC1pip_XSec_1DQ2_nu.cxx
 MiniBooNE_CCQE_XSec_2DTcos_antinu.cxx
 MiniBooNE_CC1pip_XSec_1DTpi_nu.cxx
 MiniBooNE_CCQE_XSec_2DTcos_nu.cxx
 MiniBooNE_CC1pip_XSec_1DTu_nu.cxx
-# MiniBooNE_NCEL_XSec_Treco_nu.cxx
+MiniBooNE_NCEL_XSec_Treco_nu.cxx
 MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.cxx
 MiniBooNE_NC1pi0_XSec_1Dppi0_nu.cxx
 MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.cxx
 MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.cxx
 MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.cxx
 )
 
 set(HEADERFILES
 MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h
 MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h
 MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h
 MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h
 MiniBooNE_CC1pi0_XSec_1DEnu_nu.h
 MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h
 MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h
 MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h
 MiniBooNE_CC1pi0_XSec_1DQ2_nu.h
 MiniBooNE_CCQE_XSec_1DQ2_antinu.h
 MiniBooNE_CC1pi0_XSec_1DTu_nu.h
 MiniBooNE_CC1pip_XSec_1DEnu_nu.h
 MiniBooNE_CCQE_XSec_1DQ2_nu.h
 MiniBooNE_CC1pip_XSec_1DQ2_nu.h
 MiniBooNE_CCQE_XSec_2DTcos_antinu.h
 MiniBooNE_CC1pip_XSec_1DTpi_nu.h
 MiniBooNE_CCQE_XSec_2DTcos_nu.h
 MiniBooNE_CC1pip_XSec_1DTu_nu.h
-# MiniBooNE_NCEL_XSec_Treco_nu.h
+MiniBooNE_NCEL_XSec_Treco_nu.h
 MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h
 MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h
 MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h
 MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h
 MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h
+MiniBooNE_Boxes.h
 )
 
 set(LIBNAME expMiniBooNE)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/MiniBooNE/MiniBooNE_Boxes.h b/src/MiniBooNE/MiniBooNE_Boxes.h
new file mode 100644
index 0000000..ba65a40
--- /dev/null
+++ b/src/MiniBooNE/MiniBooNE_Boxes.h
@@ -0,0 +1,51 @@
+#ifndef MINIBOONE_BOXES_H
+#define MINIBOONE_BOXES_H
+#include "MeasurementBase.h"
+#include "MeasurementVariableBox.h"
+
+
+// Example box for MeasurementVariables.
+// Only really applicable if you want to save extra variables
+// that are the same across many samples and don't want to rewrite it each time.
+// For signal events CloneSignalBox() is called, so if you have something that is
+// needed EVERY reconfigure to calculate the main MC hist then you should override that function.
+class MiniBooNE_CCQELike_Box : public MeasurementVariableBox {
+public:
+	MiniBooNE_CCQELike_Box() { Reset(); };
+
+	void Reset() {
+		fTargetTest = -999;
+		fNProtons = fNNeutrons = fNIntermediatePions = 0;
+		fFSPionMom.clear();
+	}
+
+	void FillBoxFromEvent(FitEvent* event) {
+
+		fPDGnu = event->PDGnu();
+		fNProtons = event->NumFSParticle(2212);
+		fNNeutrons = event->NumFSParticle(2112);
+		fTargetTest = event->fTargetPDG;
+
+		for (size_t i = 0; i < (UInt_t)event->fNParticles; i++) {
+			FitParticle* p = event->PartInfo(i);
+
+			if (p->Status() == kInitialState) {
+				continue;
+			} else if (p->Status() == kFinalState) {
+				fFSPionMom.push_back(p->fP.Vect().Mag());
+			} else {
+				fNIntermediatePions++;
+			}
+		}
+	};
+
+	int fNProtons;
+	int fNNeutrons;
+	int fNIntermediatePions;
+	std::vector<double> fFSPionMom;
+	int fTargetTest;
+	int fPDGnu;
+
+};
+
+#endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.cxx
index b76b42a..e55e2f6 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.cxx
@@ -1,74 +1,94 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1DEnu_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1DEnu_nu::MiniBooNE_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "MiniBooNE_CC1pi0_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/CH_{2})";
-  fIsDiag = false;
-  fIsEnu1D = true;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+MiniBooNE_CC1pi0_XSec_1DEnu_nu::MiniBooNE_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/totalxsec_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/totalxsec_covar.txt", this->fNDataPointsX);
-  //this->SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/cc1pi0/totalxsec_covar.txt", this->fNDataPointsX-1);
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pi0_XSec_1DEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
 
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pi0_XSec_1DEnu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pi0/totalxsec_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/CC1pi0/totalxsec_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
 };
 
 void MiniBooNE_CC1pi0_XSec_1DEnu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  =event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Enu = FitUtils::EnuCC1pi0rec(Pnu, Pmu, Ppi0);
 
   fXVar = Enu;
 
   return;
 };
 
 // **************************************************
 // MiniBooNE CC1pi0 signal definition
 //
 // The signal definition is:
 //                          Exactly one negative muon
 //                          Exactly one pi0
 //                          No additional mesons
 //                          Any number of nucleons
 //
 // Does a few clever cuts on the likelihood to reduce CCQE contamination by
 // looking at "fuzziness" of the ring; CCQE events are sharp, CC1pi0 are fuzzy
 // (because of the pi0->2 gamma collinearity)
 bool MiniBooNE_CC1pi0_XSec_1DEnu_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.h
index 99e227a..c4ed8d2 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DEnu_nu.h
@@ -1,35 +1,35 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DENU_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pi0_XSec_1DEnu_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pi0_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.cxx
index c7ab786..17d43dc 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.cxx
@@ -1,62 +1,84 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1DQ2_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1DQ2_nu::MiniBooNE_CC1pi0_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_CC1pi0_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ_{CC#pi}^{2} (cm^{2}/GeV^{2})";
-  fIsDiag = false;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdq2_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdq2_covar.txt", this->fNDataPointsX);
-  //this->SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/cc1pi0/dxsecdq2_covar.txt", this->fNDataPointsX-1);
-  this->SetupDefaultHist();
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+//********************************************************************
+MiniBooNE_CC1pi0_XSec_1DQ2_nu::MiniBooNE_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pi0_XSec_1DQ2_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{CC#pi}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pi0_XSec_1DQ2_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdq2_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdq2_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 void MiniBooNE_CC1pi0_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double q2CCpi0 = FitUtils::Q2CC1pi0rec(Pnu, Pmu, Ppi0);
 
   fXVar = q2CCpi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pi0_XSec_1DQ2_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.h
index ca44f0f..274622d 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DQ2_nu.h
@@ -1,39 +1,39 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DQ2_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 #include "FitUtils.h"
 #include "SignalDef.h"
 
 class MiniBooNE_CC1pi0_XSec_1DQ2_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pi0_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1DQ2_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.cxx
index 6bb7fe2..bac106d 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.cxx
@@ -1,62 +1,83 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1DTu_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1DTu_nu::MiniBooNE_CC1pi0_XSec_1DTu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_CC1pi0_XSec_1DTu_nu";
-  fPlotTitles = "; T_{#mu} (GeV); d#sigma/dE_{#mu} (cm^{2}/GeV^{2}/CH_{2})";
-  fIsDiag = false;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdemu_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdemu_covar.txt", this->fNDataPointsX);
-  //this->SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/cc1pi0/dxsecdemu_covar.txt", this->fNDataPointsX-1);
-  this->SetupDefaultHist();
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+//********************************************************************
+MiniBooNE_CC1pi0_XSec_1DTu_nu::MiniBooNE_CC1pi0_XSec_1DTu_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pi0_XSec_1DTu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#mu} (GeV)");
+  fSettings.SetYTitle("d#sigma/dE_{#mu} (cm^{2}/GeV^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pi0_XSec_1DTu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdemu_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdemu_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 void MiniBooNE_CC1pi0_XSec_1DTu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double TuCCpi0 = FitUtils::T(Pmu);
 
   fXVar = TuCCpi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pi0_XSec_1DTu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h
index 99e0312..9f76ccc 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DTU_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DTU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pi0_XSec_1DTu_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1DTu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pi0_XSec_1DTu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1DTu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.cxx
index 68659eb..ca3e1a6 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.cxx
@@ -1,63 +1,85 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1Dcosmu_nu::MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_CC1pi0_XSec_1Dcosmu_nu";
-  fPlotTitles = "; cos#theta_{#mu}; d#sigma/dcos#theta_{#mu} (cm^{2}/CH_{2})";
-  fIsDiag = false;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdcosmu_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdcosmu_covar.txt", this->fNDataPointsX);
-  this->SetupDefaultHist();
-
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+//********************************************************************
+MiniBooNE_CC1pi0_XSec_1Dcosmu_nu::MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pi0_XSec_1Dcosmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#mu}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#mu} (cm^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pi0_XSec_1Dcosmu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdcosmu_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdcosmu_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 void MiniBooNE_CC1pi0_XSec_1Dcosmu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // No W cut on MiniBooNE CC1pi+
   double CosMu = cos(FitUtils::th(Pnu, Pmu));
 
   fXVar = CosMu;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pi0_XSec_1Dcosmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h
index 80cac46..7e6a291 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcosmu_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DCOSMU_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DCOSMU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pi0_XSec_1Dcosmu_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pi0_XSec_1Dcosmu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1Dcosmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.cxx
index 0fefad6..81d61ca 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.cxx
@@ -1,64 +1,84 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1Dcospi0_nu::MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_CC1pi0_XSec_1Dcospi0_nu";
-  fPlotTitles = "; cos#theta_{#pi^{0}}; d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/CH_{2})";
-  fIsDiag = false;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdcospi_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdcospi_covar.txt", this->fNDataPointsX);
-  //this->SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/cc1pi0/dxsecdcospi_covar.txt", this->fNDataPointsX -1 );
-  this->SetupDefaultHist();
-
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
-};
 
+//********************************************************************
+MiniBooNE_CC1pi0_XSec_1Dcospi0_nu::MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pi0_XSec_1Dcospi0_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi^{0}}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pi0_XSec_1Dcospi0_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdcospi_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/CC1pi0/dxsecdcospi_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 void MiniBooNE_CC1pi0_XSec_1Dcospi0_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  =event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double CosPi0 = cos(FitUtils::th(Pnu, Ppi0));
 
   fXVar = CosPi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pi0_XSec_1Dcospi0_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h
index c85453c..3780d45 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dcospi0_nu.h
@@ -1,37 +1,37 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DCOSPI0_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DCOSPI0_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pi0_XSec_1Dcospi0_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pi0_XSec_1Dcospi0_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1Dcospi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.cxx
index 7df8da2..0b258df 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.cxx
@@ -1,62 +1,90 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h"
 
-// The constructor
-MiniBooNE_CC1pi0_XSec_1Dppi0_nu::MiniBooNE_CC1pi0_XSec_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_CC1pi0_XSec_1Dppi0_nu";
-  fPlotTitles = "; p_{#pi^{0}} (GeV/c); d#sigma/dp_{#pi^{0}} (cm^{2}/GeV/CH_{2})";
-  fIsDiag = false;
-  fNormError = 0.107;
-  EnuMin = 0.5;
-  EnuMax = 2.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdppi_edit.txt");
-  this->SetCovarMatrixFromCorrText(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pi0/dxsecdppi_covar.txt", this->fNDataPointsX);
-  //this->SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/cc1pi0/dxsecdppi_covar.txt", this->fNDataPointsX-1);
-  this->SetupDefaultHist();
-
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+MiniBooNE_CC1pi0_XSec_1Dppi0_nu::MiniBooNE_CC1pi0_XSec_1Dppi0_nu(nuiskey confkey) {
+
+  // 1. Initalise sample Settings (all overrideable in cardfile) --------------
+  fSettings = LoadSampleSettings(confkey); // Must go first
+  fSettings.SetDescription("");
+  fSettings.SetXTitle("p_{#pi^{0}} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#pi^{0}} (cm^{2}/GeV/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.5, 2.0);
+  fSettings.SetSuggestedFlux( FitPar::GetDataBase() + "/MiniBooNE/ccqe/mb_fhc_flux.root");
+
+  fSettings.SetTitle("MiniBooNE #nu_#mu CC1#pi^{0} on CH");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pi0/dxsecdppi_edit.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MiniBooNE/CC1pi0/dxsecdppi_covar.txt" );
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.DefineAllowedTargets("C,H");
+  FinaliseSampleSettings(); // Must go after all settings
+
+  // 2. Set Scale Factor -------------------------------------------------------
+  fScaleFactor = GetEventHistogram()->Integral("width")
+                 * double(1E-38) / double(fNEvents)
+                 * (14.08) / TotalIntegratedFlux("width");
+
+  // 3. Plot Setup -------------------------------------------------------
+  SetDataValues( fSettings.GetDataInput() );
+  SetCovarMatrixFromCorrText( fSettings.GetCovarInput(), fDataHist->GetNbinsX() );
+
+  // Create a Target Species Stack copying data
+  fTargetStack = new TargetTypeStack( fSettings.Name() + "_TGT", 
+                                         "Target Contributions" + fSettings.PlotTitles(), 
+                                         fDataHist);
+  SetAutoProcessTH1(fTargetStack);
+
+  // Final MC Setup
+   // Must go last
+  FinaliseMeasurement();
 };
 
 void MiniBooNE_CC1pi0_XSec_1Dppi0_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(111) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
-  TLorentzVector Pnu  =event->GetNeutrinoIn()->fP;
+  TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double p_pi0 = FitUtils::p(Ppi0);
 
   fXVar = p_pi0;
+  fTargetPDG = event->fTargetPDG;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pi0_XSec_1Dppi0_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 111, EnuMin, EnuMax);
 }
+
+//********************************************************************
+void MiniBooNE_CC1pi0_XSec_1Dppi0_nu::FillExtraHistograms(MeasurementVariableBox* box, double weight){
+//********************************************************************
+  if (!Signal) return;
+  fTargetStack->Fill( fTargetPDG, fXVar, weight );
+}
+
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h
index 0becc96..6b45035 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1Dppi0_nu.h
@@ -1,37 +1,40 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PI0_XSEC_1DPPI0_NU_H_SEEN
 #define MINIBOONE_CC1PI0_XSEC_1DPPI0_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pi0_XSec_1Dppi0_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pi0_XSec_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+MiniBooNE_CC1pi0_XSec_1Dppi0_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pi0_XSec_1Dppi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
+  void FillExtraHistograms(MeasurementVariableBox* box, double weight);
 
 private:
+	int fTargetPDG;
+	TargetTypeStack* fTargetStack;
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.cxx
index b8a9e9b..55adb49 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.cxx
@@ -1,90 +1,110 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_1DEnu_nu.h"
 
-// The constructor
+
+//********************************************************************
+MiniBooNE_CC1pip_XSec_1DEnu_nu::MiniBooNE_CC1pip_XSec_1DEnu_nu(nuiskey samplekey) {
 //********************************************************************
-MiniBooNE_CC1pip_XSec_1DEnu_nu::MiniBooNE_CC1pip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile) {
 
-  fName = "MiniBooNE_CC1pip_XSec_1DEnu_nu";
-  fPlotTitles = "; E_{#nu} (MeV); #sigma(E_{#nu}) (cm^{2}/CH_{2})";
-  fIsDiag = true;
-  fIsEnu1D = true;
-  fNormError = 0.107;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_1DEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (MeV)");
+  fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_1DEnu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pip/ccpipXSec_enu.txt" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSec_enu.txt");
-  this->SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-  //StatUtils::ForceNormIntoCovar(this->covar, this->fDataHist, this->fNormError);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
 };
 
 
+
 //********************************************************************
 void MiniBooNE_CC1pip_XSec_1DEnu_nu::FillEventVariables(FitEvent* event) {
 //********************************************************************
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // No W cut on MiniBooNE data from publication
   // WARNING: DRAGONS LAY HERE! Mike Wilking's thesis might not have this. Beware that the publication says W < 1.35 GeV, but this is "efficiency corrected", i.e. FILLED WITH MONTE-CARLO!!!!!!!! AAAAAH
   //double hadMass = FitUtils::Wrec(Pnu, Pmu, Ppip);
 
   double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip);
   //  if (isRat) Enu = Enu/1000.; //CCpi+/CCQE ratio paper puts in GeV, CCpi+ paper in MeV
 
   fXVar = Enu;
 
   return;
 };
 
 // *********************************************
 // MiniBooNE CC1pi+ signal definition
 // Warning: This one is a little scary because there's a W = 1.35 GeV cut for
 // signal in the selection
 //          Although this is unfolded over and is filled up with NUANCE
 //          So there is actually no W cut applied, but everything above W = 1.35
 //          GeV is NUANCE...
 //
 // The signal definition is:
 //                            Exactly one negative muon
 //                            Exactly one positive pion
 //                            No other mesons
 //                            No requirements on photons, nucleons and
 //                            multi-nucleons
 //                            Doesn't mention other leptons
 //
 // Additionally, it asks for 2 Michel e- from decay of muon and pion
 // So there is good purity and we can be fairly sure that the positive pion is a
 // positive pion
 //
 bool MiniBooNE_CC1pip_XSec_1DEnu_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.h
index be39246..de8ff7a 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DEnu_nu.h
@@ -1,35 +1,35 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_1DENU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_1DENU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pip_XSec_1DEnu_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pip_XSec_1DEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_1DEnu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_1DEnu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.cxx
index 943e927..70eb368 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.cxx
@@ -1,69 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_1DQ2_nu.h"
 
+
+//********************************************************************
+MiniBooNE_CC1pip_XSec_1DQ2_nu::MiniBooNE_CC1pip_XSec_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
-/// @brief MiniBooNE CC1pi+ numu 1DQ2 Measurement on CH2 (Ref: - )
-///
-// The constructor
-MiniBooNE_CC1pip_XSec_1DQ2_nu::MiniBooNE_CC1pip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "MiniBooNE_CC1pip_XSec_1DQ2_nu";
-  fPlotTitles = "; Q^{2}_{CC#pi} (GeV^{2}); d#sigma/dQ_{CC#pi^{+}}^{2} (cm^{2}/MeV^{2}/CH_{2})";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_1DQ2_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{CC#pi} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{CC#pi^{+}}^{2} (cm^{2}/MeV^{2}/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.DefineAllowedTargets("C,H");
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSec_Q2.txt");
-  this->SetupDefaultHist();
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE CC1pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pip/ccpipXSec_Q2.txt" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  FinaliseSampleSettings();
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width")/1E6;
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width")/1E6;
   // Added /1E6. comes from Q2 being in MeV^2, not GeV^2 I think... Or maybe the units in the paper are simply wrong; 1E-45 is very small! :D
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 //********************************************************************
 void  MiniBooNE_CC1pip_XSec_1DQ2_nu::FillEventVariables(FitEvent *event){
 //********************************************************************
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // No W cut on MiniBooNE CC1pi+
   double Q2CC1pip = FitUtils::Q2CC1piprec(Pnu, Pmu, Ppip);
 
   fXVar = Q2CC1pip;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_1DQ2_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.h
index 4061190..5e64e6d 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DQ2_nu.h
@@ -1,38 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_1DQ2_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_1DQ2_NU_H_SEEN
 
 // Fit Includes
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pip_XSec_1DQ2_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pip_XSec_1DQ2_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_1DQ2_nu() {};
   
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
 private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.cxx
index fa83916..8524b8d 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.cxx
@@ -1,68 +1,90 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_1DTpi_nu.h"
 
-// The constructor
-MiniBooNE_CC1pip_XSec_1DTpi_nu::MiniBooNE_CC1pip_XSec_1DTpi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+//********************************************************************
+MiniBooNE_CC1pip_XSec_1DTpi_nu::MiniBooNE_CC1pip_XSec_1DTpi_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_1DTpi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#pi} (MeV)");
+  fSettings.SetYTitle("d#sigma/dT_{#pi^{+}}} (cm^{2}/MeV/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
 
-  fName = "MiniBooNE_CC1pip_XSec_1DTpi_nu";
-  fPlotTitles = "; T_{#pi} (MeV); d#sigma/dT_{#pi^{+}}} (cm^{2}/MeV/CH_{2})";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_1DTpi_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pip/ccpipXSec_KEpi.txt" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSec_KEpi.txt");
-  this->SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar = StatUtils::GetInvert(fFullCovar);
-  //StatUtils::ForceNormIntoCovar(this->covar, this->fDataHist, this->fNormError);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
 };
 
 
+
 //********************************************************************
 void MiniBooNE_CC1pip_XSec_1DTpi_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // No W cut on MiniBooNE data from publication
   // WARNING: DRAGONS LAY HERE! Mike Wilking's thesis might not have this. Beware that the publication says W < 1.35 GeV, but this is "efficiency corrected", i.e. FILLED WITH MONTE-CARLO!!!!!!!! AAAAAH
   //double hadMass = FitUtils::Wrec(Pnu, Pmu, Ppip);
 
   double Tpi = FitUtils::T(Ppip)*1000.;
 
   fXVar = Tpi;
 
   return;
 };
 
 
 bool MiniBooNE_CC1pip_XSec_1DTpi_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.h
index 186d7a7..95e12e9 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTpi_nu.h
@@ -1,35 +1,35 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_1DTPI_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_1DTPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pip_XSec_1DTpi_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pip_XSec_1DTpi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_1DTpi_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_1DTpi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.cxx
index b51eaaa..d9fb93a 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.cxx
@@ -1,64 +1,84 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_1DTu_nu.h"
 
-MiniBooNE_CC1pip_XSec_1DTu_nu::MiniBooNE_CC1pip_XSec_1DTu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+//********************************************************************
+MiniBooNE_CC1pip_XSec_1DTu_nu::MiniBooNE_CC1pip_XSec_1DTu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  fName = "MiniBooNE_CC1pip_XSec_1DTu_nu";
-  fPlotTitles = "; T_{#mu} (MeV); d#sigma/dT_{#mu} (cm^{2}/MeV/CH_{2})";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_1DTu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSec_KEmu.txt");
-  this->SetupDefaultHist();
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#mu} (MeV)");
+  fSettings.SetYTitle("d#sigma/dT_{#mu} (cm^{2}/MeV/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_1DTu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/CC1pip/ccpipXSec_KEmu.txt" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
+  FinaliseSampleSettings();
 
-};
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
 
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 //********************************************************************
 void MiniBooNE_CC1pip_XSec_1DTu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // No W cut on MiniBooNE CC1pi+
   double Tmu = FitUtils::T(Pmu)*1000.;
 
   fXVar = Tmu;
 
   return;
 };
 
 bool MiniBooNE_CC1pip_XSec_1DTu_nu::isSignal(FitEvent *event) {
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.h
index e0dd897..c8d2137 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_1DTu_nu.h
@@ -1,35 +1,35 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_1DTU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_1DTU_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_CC1pip_XSec_1DTu_nu : public Measurement1D {
 public:
 
-  MiniBooNE_CC1pip_XSec_1DTu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_1DTu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_1DTu_nu() {};
   
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.cxx
index 625a2bd..2548fde 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.cxx
@@ -1,66 +1,88 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h"
 
+
 //********************************************************************
-MiniBooNE_CC1pip_XSec_2DQ2Enu_nu::MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MiniBooNE_CC1pip_XSec_2DQ2Enu_nu::MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MiniBooNE_CC1pip_XSec_2DQ2Enu_nu";
-  fPlotTitles = "; E_{#nu} (MeV); Q^{2} (MeV^{2}/c^{4}); d#sigma(E_{#nu})/dQ^{2} (cm^{2}/(MeV^{2}/c^{4})/CH_{2})";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_2DQ2Enu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (MeV); Q^{2} (MeV^{2}/c^{4})");
+  fSettings.SetYTitle("Q^{2} (MeV^{2}/c^{4})");
+  fSettings.SetZTitle(" d#sigma(E_{#nu})/dQ^{2} (cm^{2}/(MeV^{2}/c^{4})/CH_{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_2DQ2Enu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pip/ccpipXSecs.root;QSQVENUXSec" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSecs.root", std::string("QSQVENUXSec"));//data comes in .root file, yes!
-  this->SetupDefaultHist();
+  FinaliseSampleSettings();
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) / double(fNEvents) * (14.08);
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
+//********************************************************************
 void MiniBooNE_CC1pip_XSec_2DQ2Enu_nu::FillEventVariables(FitEvent *event) {
+//********************************************************************
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
-  double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip)*1000.;
-  double Q2 = FitUtils::Q2CC1piprec(Pnu, Pmu, Ppip)*1E6;
+  double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip) * 1000.;
+  double Q2 = FitUtils::Q2CC1piprec(Pnu, Pmu, Ppip) * 1E6;
 
   fXVar = Enu;
   fYVar = Q2;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_2DQ2Enu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h
index c0dfd37..d1e505f 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DQ2Enu_nu.h
@@ -1,38 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_2DQ2ENU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_2DQ2ENU_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class MiniBooNE_CC1pip_XSec_2DQ2Enu_nu : public Measurement2D {
 public:
 
-  MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_2DQ2Enu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_2DQ2Enu_nu() {};
-
-  //void SetDataValues(std::string fileLocation);
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.cxx
index 8cb5d24..a6de49f 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.cxx
@@ -1,81 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h"
 
-// The constructor
-MiniBooNE_CC1pip_XSec_2DTpiCospi_nu::MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "MiniBooNE_CC1pip_XSec_2DTpiCospi_nu";
-  fPlotTitles = "; T_{#pi} (MeV); cos#theta_{#pi}; d^{2}#sigma/dT_{#pi}dcos#theta_{#pi} (cm^{2}/MeV)";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+MiniBooNE_CC1pip_XSec_2DTpiCospi_nu::MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSecs.root", std::string("PICTVKEXSec"));//data comes in .root file, yes!
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_2DTpiCospi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#pi} (MeV)");
+  fSettings.SetYTitle("cos#theta_{#pi}");
+  fSettings.SetZTitle("d^{2}#sigma/dT_{#pi}dcos#theta_{#pi} (cm^{2}/MeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
-};
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_2DTpiCospi_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pip/ccpipXSecs.root;PICTVKEXSec" );
+  fSettings.DefineAllowedSpecies("numu");
 
+  FinaliseSampleSettings();
 
-/*
-void MiniBooNE_CC1pip_XSec_2DTpiCospi_nu::SetDataValues(std::string fileLocation) {
-  LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
-  TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
 
-  fDataHist = (TH2D*)(dataFile->Get("PICTVKEXSec")->Clone());
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  dataFile->Close();
-  delete dataFile;
 };
-*/
-
-
 
 void MiniBooNE_CC1pip_XSec_2DTpiCospi_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Tpi = FitUtils::T(Ppip)*1000.;
   double costh = cos(FitUtils::th(Pnu, Ppip));
 
   fXVar = Tpi;
   fYVar = costh;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_2DTpiCospi_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h
index b565d8b..287fa00 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiCospi_nu.h
@@ -1,38 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_2DTPICOSPI_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_2DTPICOSPI_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class MiniBooNE_CC1pip_XSec_2DTpiCospi_nu : public Measurement2D {
 public:
 
-  MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_2DTpiCospi_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_2DTpiCospi_nu() {};
-
-  //void SetDataValues(std::string fileLocation);
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.cxx
index 1863569..35300f1 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.cxx
@@ -1,83 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h"
 
+
+
 //********************************************************************
-MiniBooNE_CC1pip_XSec_2DTpiEnu_nu::MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MiniBooNE_CC1pip_XSec_2DTpiEnu_nu::MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "MiniBooNE_CC1pip_XSec_2DTpiEnu_nu";
-  fPlotTitles = "; E_{#nu} (MeV); T_{#pi} (MeV); d#sigma(E_{#nu})/dT_{#pi} (cm^{2}/MeV)";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_2DTpiEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSecs.root", std::string("PIKEVENUXSec"));//data comes in .root file, yes!
-  this->SetupDefaultHist();
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (MeV)");
+  fSettings.SetYTitle("T_{#pi} (MeV)");
+  fSettings.SetZTitle("d#sigma(E_{#nu})/dT_{#pi} (cm^{2}/MeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_2DTpiEnu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pip/ccpipXSecs.root;PIKEVENUXSec" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
-
-};
+  FinaliseSampleSettings();
 
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
 
-/*
-void MiniBooNE_CC1pip_XSec_2DTpiEnu_nu::SetDataValues(std::string fileLocation) {
-  LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
-  TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fDataHist = (TH2D*)(dataFile->Get("PIKEVENUXSec")->Clone());
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
-
-  dataFile->Close();
-  delete dataFile;
 };
-*/
-
-
 
 void MiniBooNE_CC1pip_XSec_2DTpiEnu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip)*1000.;
   double Tpi = FitUtils::T(Ppip)*1000.;
 
   fXVar = Enu;
   fYVar = Tpi;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_2DTpiEnu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h
index 5dc4545..1fdddd2 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTpiEnu_nu.h
@@ -1,38 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_2DTPIENU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_2DTPIENU_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class MiniBooNE_CC1pip_XSec_2DTpiEnu_nu : public Measurement2D {
 public:
 
-  MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_2DTpiEnu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_2DTpiEnu_nu() {};
 
   //void SetDataValues(std::string fileLocation);
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.cxx
index 1ebc9c5..935f875 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.cxx
@@ -1,79 +1,87 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h"
 
-// The constructor
-MiniBooNE_CC1pip_XSec_2DTuCosmu_nu::MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "MiniBooNE_CC1pip_XSec_2DTuCosmu_nu";
-  fPlotTitles = "; T_{#mu} (MeV); cos#theta_{#mu}; d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/MeV)";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSecs.root", std::string("MUCTVKEXSec"));//data comes in .root file, yes!
-  this->SetupDefaultHist();
+//********************************************************************
+MiniBooNE_CC1pip_XSec_2DTuCosmu_nu::MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_2DTuCosmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
-};
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#mu} (MeV)");
+  fSettings.SetYTitle("cos#theta_{#mu}");
+  fSettings.SetZTitle("d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/MeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_2DTuCosmu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pip/ccpipXSecs.root;MUCTVKEXSec" );
+  fSettings.DefineAllowedSpecies("numu");
 
+  FinaliseSampleSettings();
 
-/*
-void MiniBooNE_CC1pip_XSec_2DTuCosmu_nu::SetDataValues(std::string fileLocation) {
-  LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
-  TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08)/TotalIntegratedFlux("width");
 
-  fDataHist = (TH2D*)(dataFile->Get("MUCTVKEXSec")->Clone());
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  dataFile->Close();
-  delete dataFile;
 };
-*/
 
 void MiniBooNE_CC1pip_XSec_2DTuCosmu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Tmu = FitUtils::T(Pmu)*1000.;
   double costh = cos(FitUtils::th(Pnu, Pmu));
 
   fXVar = Tmu;
   fYVar = costh;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_2DTuCosmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h
index e2fc27d..f0614fa 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuCosmu_nu.h
@@ -1,38 +1,38 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_2DTUCOSMU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_2DTUCOSMU_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class MiniBooNE_CC1pip_XSec_2DTuCosmu_nu : public Measurement2D {
 public:
 
-  MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_2DTuCosmu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_2DTuCosmu_nu() {};
 
   //void SetDataValues(std::string fileLocation);
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.cxx b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.cxx
index aa8295c..a186c6e 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.cxx
@@ -1,79 +1,86 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h"
 
-// The constructor
-MiniBooNE_CC1pip_XSec_2DTuEnu_nu::MiniBooNE_CC1pip_XSec_2DTuEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = "MiniBooNE_CC1pip_XSec_2DTuEnu_nu";
-  fPlotTitles = "; E_{#nu} (MeV); T_{#mu} (MeV); d#sigma(E_{#nu})/dT_{#mu} (cm^{2}/MeV)";
-  fIsDiag = true;
-  fNormError = 0.107;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+MiniBooNE_CC1pip_XSec_2DTuEnu_nu::MiniBooNE_CC1pip_XSec_2DTuEnu_nu(nuiskey samplekey) {
+//********************************************************************
 
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/MiniBooNE/CC1pip/ccpipXSecs.root", std::string("MUKEVENUXSec"));//data comes in .root file, yes!
-  this->SetupDefaultHist();
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CC1pip_XSec_2DTuEnu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (MeV)");
+  fSettings.SetYTitle("T_{#mu} (MeV)");
+  fSettings.SetZTitle("d#sigma(E_{#nu})/dT_{#mu} (cm^{2}/MeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.107);
+  fSettings.DefineAllowedTargets("C,H");
 
-  // Calculates a flux averaged cross-section from (Evt("width")/Flux("width")) * 14.08/6.0
-  this->fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
-};
+  fSettings.SetTitle("MiniBooNE_CC1pip_XSec_2DTuEnu_nu");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/CC1pip/ccpipXSecs.root;MUKEVENUXSec" );
+  fSettings.DefineAllowedSpecies("numu");
 
+  FinaliseSampleSettings();
 
-/*
-void MiniBooNE_CC1pip_XSec_2DTuEnu_nu::SetDataValues(std::string fileLocation) {
-  LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
-  TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = GetEventHistogram()->Integral("width")*double(1E-38)/double(fNEvents)*(14.08);
 
-  fDataHist = (TH2D*)(dataFile->Get("MUKEVENUXSec")->Clone());
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
 
-  fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  dataFile->Close();
-  delete dataFile;
 };
-*/
 
 void MiniBooNE_CC1pip_XSec_2DTuEnu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(211) == 0 ||
       event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip)*1000.;
   double Tmu = FitUtils::T(Pmu)*1000.;
 
   fXVar = Enu;
   fYVar = Tmu;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_CC1pip_XSec_2DTuEnu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax);
 }
diff --git a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h
index 6c46e0f..24dba02 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CC1pip_XSec_2DTuEnu_nu.h
@@ -1,38 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CC1PIP_XSEC_2DTUENU_NU_H_SEEN
 #define MINIBOONE_CC1PIP_XSEC_2DTUENU_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class MiniBooNE_CC1pip_XSec_2DTuEnu_nu : public Measurement2D {
 public:
 
-  MiniBooNE_CC1pip_XSec_2DTuEnu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CC1pip_XSec_2DTuEnu_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CC1pip_XSec_2DTuEnu_nu() {};
-
-  //void SetDataValues(std::string fileLocation);
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.cxx b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.cxx
index fa48df8..a1cfcae 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.cxx
@@ -1,247 +1,195 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CCQE_XSec_1DQ2_antinu.h"
-
 #include <csignal>
 
-//********************************************************************
-/// @brief MiniBooNE CCQE antinumu 1DQ2 Measurement on CH2 (Ref: - )
-///
-//********************************************************************
-MiniBooNE_CCQE_XSec_1DQ2_antinu::MiniBooNE_CCQE_XSec_1DQ2_antinu(
-    std::string name, std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile) {
-  //********************************************************************
-
-  // Measurement Details
-  fName = name;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  EnuMin = 0.;
-  EnuMax = 3.;
-  fNormError = 0.130;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/NORM";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Plots
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  fCCQElike = name.find("CCQELike") != std::string::npos;
-
-  if(fCCQElike){
-    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
-  }
-
-  fUseCorrectedCTarget = name.find("CTarg") != std::string::npos;
+MiniBooNE_CCQE_XSec_1DQ2_antinu::MiniBooNE_CCQE_XSec_1DQ2_antinu(nuiskey samplekey) {
+
+  // Sample overview
+  std::string descrip = "MiniBooNE CCQE/CC0pi sample. \n" \
+                        "Target: CH2.08 \n" \
+                        "Flux: CCQE  = Forward Horn Current numu \n" \
+                        "      CC0pi = Forward Horn Current numu+numub \n" \
+                        "Signal: CCQE  = True CCQE + True 2p2h (Mode == 1 or 2) \n" \
+                        "        CC0pi = Events with 1 mu+/mu-, N nucleons, 0 other";
+
+  // 1. Initalise sample Settings ---------------------------------------
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetSuggestedFlux( FitPar::GetDataBase() + "/MiniBooNE/ccqe/mb_ccqe_flux.root");
+
+  // Define input data information
+  fSettings.FoundFill("name", "CCQELike", fCCQElike, true);
+  fSettings.FoundFill("name", "CTarg", fUseCorrectedCTarget, true);
 
   if (fCCQElike && fUseCorrectedCTarget) {
     ERR(FTL) << "Sample: MiniBooNE_CCQE_XSec_1DQ2_antinu cannot run in both "
-                "QELike and C-Target mode. You're welcome to add the data set."
+             "QELike and C-Target mode. You're welcome to add the data set."
              << std::endl;
     throw;
   }
 
-  if(fUseCorrectedCTarget){
-    SetDataValues(FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_con_ctarget.txt");
-  } else {
-    SetDataValues(FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_con.txt");
-  }
+  if (fCCQElike) {
 
-  SetupDefaultHist();
+    // CCQELike plot information
+    fSettings.SetTitle("MiniBooNE #nu_#mu CCQE on CH");
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_like.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_diagcovar" );
+    fSettings.SetDefault( "ccqelikebkg_input", FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_bkg_ccqe.txt" );
+    fSettings.SetDefault( "ccpimbkg_input", FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_bkg_ccpim.txt" );
+    fSettings.SetHasExtraHistograms(true);
+    fSettings.DefineAllowedSpecies("numu,numub");
+    fSettings.DefineAllowedTargets("C,H");
+
+  } else if (!fUseCorrectedCTarget) {
+    // CCQE Plot Information
+    fSettings.SetTitle("MiniBooNE #nu_#mu CC0#pi on CH");
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_con.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_diagcovar" );
+    fSettings.DefineAllowedSpecies("numu");
+    fSettings.DefineAllowedTargets("C,H");
 
-  if (!fIsDiag){
-    ERR(FTL) << "Not allowed to run with non-diagonal covariance for MB CCQE antinu!" << std::endl;
-    ERR(FTL) << "Please run with DIAG or DEFAULT option" << std::endl;
-    throw;
   } else {
-    LOG(SAM) << "Making diagonal covar" << endl;
-    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-    covar = StatUtils::GetInvert(fFullCovar);
+
+    // CCQE Corrected Target Plot Information
+    fSettings.SetTitle("MiniBooNE #nu_#mu CC0#pi on C");
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_con_ctarget.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_diagcovar" );
+    fSettings.DefineAllowedSpecies("numu");
+    fSettings.DefineAllowedTargets("C");
   }
 
+  FinaliseSampleSettings();
+
+  // 2. Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  // Multiply by 14.08/6.0 to get per neutron
+  double NNucPerNTarg = fUseCorrectedCTarget ? 12.0 / 6.0 : 14.08 / 8.0;
+  fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) *
+                  NNucPerNTarg / TotalIntegratedFlux());
+
+  // 3. Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+
   ///
   /// If CCQELike is used an additional the CCQELike BKG is used and a PDG
   /// Histogram is saved
   if (fCCQElike) {
-    fDataHist_CCQELIKE = PlotUtils::GetTH1DFromFile(
-        FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_bkg_ccqe.txt",
-        (fName + "_data_CCQELIKE"), fPlotTitles);
 
-    fDataHist_CCPIM = PlotUtils::GetTH1DFromFile(
-        FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/asqq_bkg_ccpim.txt",
-        (fName + "_data_CCPIM"), fPlotTitles);
+    // CCQELike Data
+    fDataHist_CCQELIKE = PlotUtils::GetTH1DFromFile( fSettings.GetS("ccqelikebkg_input"),
+                         fSettings.GetName() + "_CCQELIKE_data" );
+    fDataHist_CCQELIKE->SetNameTitle( (fSettings.Name() + "_CCQELIKE_BKG").c_str(),
+                                      ("MiniBooNE #nu_#mu CCQE-Like Backgrounds" + fSettings.PlotTitles()).c_str() );
+    SetAutoProcessTH1(fDataHist_CCQELIKE, kCMD_Write);
 
-    // Make NON CCPIM
-    fDataHist_NONCCPIM = (TH1D *)fDataHist_CCQELIKE->Clone();
-    fDataHist_NONCCPIM->SetNameTitle((fName + "_data_NONCCPIM").c_str(),
-                                     (fName + "_data_NONCCPIM").c_str());
+    // CCQELike MC
+    fMCHist_CCQELIKE = new NuNuBarTrueModeStack( fSettings.Name() + "_CCQELIKE_MC",
+        "CCQE-like MC" + fSettings.PlotTitles(),
+        fDataHist_CCQELIKE );
+    SetAutoProcessTH1(fMCHist_CCQELIKE);
 
-    // Perform fDataHist Sums
-    for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
-      fDataHist_NONCCPIM->SetBinContent(
-          i + 1, fDataHist_CCQELIKE->GetBinContent(i + 1) -
-                     fDataHist_CCPIM->GetBinContent(i + 1));
-      fDataHist->SetBinContent(i + 1,
-                               fDataHist->GetBinContent(i + 1) +
-                                   fDataHist_CCQELIKE->GetBinContent(i + 1));
-    }
 
-    PlotUtils::CreateNeutModeArray((TH1D *)fMCHist, (TH1 **)fMCHist_CCQELIKE);
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_CCQELIKE);
+    // Data CCRES
+    fDataHist_CCPIM = PlotUtils::GetTH1DFromFile( fSettings.GetS("ccpimbkg_input"),
+                      fSettings.GetName() + "_CCPIM_BKG_data" );
+    fDataHist_CCPIM->SetNameTitle( (fSettings.Name() + "_CCPIM_data").c_str(),
+                                   ("MiniBooNE #nu_#mu CCQE-Like Backgrounds" + fSettings.PlotTitles()).c_str() );
+    SetAutoProcessTH1(fDataHist_CCQELIKE, kCMD_Write);
 
-    PlotUtils::CreateNeutModeArray((TH1D *)fMCHist, (TH1 **)fMCHist_NONCCPIM);
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_NONCCPIM);
+    // MC CCRES
+    fMCHist_CCPIM = new NuNuBarTrueModeStack(fSettings.Name() + "_CCPIM_BKG_MC", "CCQE-like BKG CC-RES" + fSettings.PlotTitles(), fDataHist_CCPIM);
+    SetAutoProcessTH1(fMCHist_CCPIM);
 
-    PlotUtils::CreateNeutModeArray((TH1D *)fMCHist, (TH1 **)fMCHist_CCPIM);
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_CCPIM);
+    // Make NON CCPIM
+    fDataHist_NONCCPIM = (TH1D *)fDataHist_CCQELIKE->Clone();
+    fDataHist_NONCCPIM->SetNameTitle((fName + "_data_NONCCPIM").c_str(),
+                                     (fName + "_data_NONCCPIM").c_str());
+    fDataHist_NONCCPIM->Add( fDataHist_CCPIM, -1.0 );
+    SetAutoProcessTH1(fDataHist_NONCCPIM, kCMD_Write);
+
+    fMCHist_NONCCPIM = new NuNuBarTrueModeStack(
+      fSettings.Name() + "_NONCCPIM_BKG",
+      "CCQE-like BKG CC-NonRES" + fSettings.PlotTitles(),
+      fDataHist_NONCCPIM);
+    SetAutoProcessTH1(fMCHist_NONCCPIM);
   }
 
-  // ScaleFactor
-  double NNucPerNTarg = fUseCorrectedCTarget ? 12.0/6.0 : 14.08/8.0;
-  fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) *
-                  NNucPerNTarg / TotalIntegratedFlux());
+  FinaliseMeasurement();
 };
 
-//********************************************************************
-/// @details Extract q2qe(fXVar) from the event
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::FillEventVariables(FitEvent *event) {
-  //********************************************************************
+void MiniBooNE_CCQE_XSec_1DQ2_antinu::FillEventVariables(FitEvent * event) {
 
   if (event->NumFSParticle(PhysConst::pdg_muons) == 0) return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
 
   // The highest momentum mu+/mu-. The isSignal definition should make sure we
   // only
   // accept events we want, so no need to do an additional check here.
   TLorentzVector Pmu = event->GetHMFSParticle(PhysConst::pdg_muons)->fP;
 
   // Set X Variables
   fXVar = FitUtils::Q2QErec(Pmu, cos(Pnu.Vect().Angle(Pmu.Vect())), 30., false);
+  fPDGnu = event->PDGnu();
 
   return;
 };
 
-//********************************************************************
-bool MiniBooNE_CCQE_XSec_1DQ2_antinu::isSignal(FitEvent *event) {
-  //********************************************************************
+bool MiniBooNE_CCQE_XSec_1DQ2_antinu::isSignal(FitEvent * event) {
 
   // If CC0pi, include both charges
   if (fCCQElike) {
     if (SignalDef::isCC0pi(event, 14, EnuMin, EnuMax) ||
-        SignalDef::isCC0pi(event, -14, EnuMin, EnuMax)){
-      // P. Stowell Removed this bad check for only pdg=14 types
-      //      if(event->GetNeutrinoIn()->fPID == -14){
-      //        return false;
-      //      }
+        SignalDef::isCC0pi(event, -14, EnuMin, EnuMax)) {
       return true;
     }
   } else {
     if (SignalDef::isCCQELike(event, -14, EnuMin, EnuMax)) return true;
   }
 
   return false;
 };
 
-//********************************************************************
-/// @details Fills a ccqe-like and ccpim background plot if required
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::FillHistograms() {
-  //********************************************************************
 
-  Measurement1D::FillHistograms();
+void MiniBooNE_CCQE_XSec_1DQ2_antinu::FillExtraHistograms(MeasurementVariableBox* vars, double weight) {
 
-  if (Mode != -1 && Mode != -2 and fCCQElike and Signal) {
-    if (fabs(Mode) == 11 or fabs(Mode) == 13)
-      PlotUtils::FillNeutModeArray(fMCHist_CCPIM, Mode, fXVar, Weight);
-    else
-      PlotUtils::FillNeutModeArray(fMCHist_NONCCPIM, Mode, fXVar, Weight);
+  // No Extra Hists if not ccqelike
+  if (!fCCQElike or !Signal) return;
 
-    PlotUtils::FillNeutModeArray(fMCHist_CCQELIKE, Mode, fXVar, Weight);
-  }
-}
-
-//********************************************************************
-/// @details Extra write command to save the CCQELike/CCPIM PDG if required
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::Write(std::string drawOpt) {
-  //********************************************************************
-
-  Measurement1D::Write(drawOpt);
-
-  if (fCCQElike) {
-    fDataHist_CCQELIKE->Write();
-
-    THStack combo_fMCHist_CCQELIKE = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_CCQELIKE").c_str(), (TH1 **)fMCHist_CCQELIKE, 0);
-    combo_fMCHist_CCQELIKE.Write();
-
-    fDataHist_CCPIM->Write();
-
-    THStack combo_fMCHist_CCPIM = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_CCPIM").c_str(), (TH1 **)fMCHist_CCPIM, 0);
-    combo_fMCHist_CCPIM.Write();
-
-    fDataHist_NONCCPIM->Write();
-
-    THStack combo_fMCHist_NONCCPIM = PlotUtils::GetNeutModeStack(
-        (fName + "_MC_NONCCPIM").c_str(), (TH1 **)fMCHist_NONCCPIM, 0);
-    combo_fMCHist_NONCCPIM.Write();
+  // Fill Stacks
+  if (Mode != -1 and Mode != -2) {
+    if (fabs(Mode) == 11 or fabs(Mode) == 12 or fabs(Mode == 13)) {
+      fMCHist_CCPIM->Fill(fPDGnu, Mode, fXVar, weight);
+    } else {
+      fMCHist_NONCCPIM->Fill(fPDGnu, Mode, fXVar, weight);
+    }
   }
-}
-
-//********************************************************************
-/// @details Extra scale command for CCQELIKE/CCPIM PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::ScaleEvents() {
-  //********************************************************************
-
-  Measurement1D::ScaleEvents();
 
-  if (fCCQElike) {
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_CCQELIKE, fScaleFactor,
-                                  "width");
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_CCPIM, fScaleFactor, "width");
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_NONCCPIM, fScaleFactor,
-                                  "width");
-  }
+  fMCHist_CCQELIKE->Fill(fPDGnu, Mode, fXVar, weight);
 }
 
-//********************************************************************
-/// @details Apply norm scaling to CCQELIKE/CCPIM PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::ApplyNormScale(double norm) {
-  //********************************************************************
-
-  Measurement1D::ApplyNormScale(norm);
 
-  if (fCCQElike) {
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_CCQELIKE, 1.0 / norm, "");
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_CCPIM, 1.0 / norm, "");
-    PlotUtils::ScaleNeutModeArray((TH1 **)fMCHist_NONCCPIM, 1.0 / norm, "");
-  }
-}
 
-//********************************************************************
-///// @details Extra scale command for CCQELIKE PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_antinu::ResetAll() {
-  //********************************************************************
-  Measurement1D::ResetAll();
-  if (fCCQElike) {
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_CCQELIKE);
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_CCPIM);
-    PlotUtils::ResetNeutModeArray((TH1 **)fMCHist_NONCCPIM);
-  }
-}
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h
index c7873f1..86a188d 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_antinu.h
@@ -1,53 +1,65 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CCQE_XSEC_1DQ2_ANTINU_H_SEEN
 #define MINIBOONE_CCQE_XSEC_1DQ2_ANTINU_H_SEEN
 
 #include "Measurement1D.h"
+#include "MeasurementBase.h"
+#include "MiniBooNE_Boxes.h"
 
-//********************************************************************
+/// MiniBooNE antinu CCQE sample class : arXiv:1002:2680
 class MiniBooNE_CCQE_XSec_1DQ2_antinu : public Measurement1D {
-//********************************************************************
 
 public:
 
-  MiniBooNE_CCQE_XSec_1DQ2_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  /// Default constructor. Setup from the following name keys
+  /// MiniBooNE_CCQE_XSec_1DQ2_antinu \n
+  /// MiniBooNE_CCQELike_XSec_1DQ2_antinu \n
+  /// MiniBooNE_CCQE_XSec_1DQ2_antinu_CTarg 
+  MiniBooNE_CCQE_XSec_1DQ2_antinu(nuiskey samplekey);
   virtual ~MiniBooNE_CCQE_XSec_1DQ2_antinu() {};
 
+  /// Main fill event variables: X = Q2_QE
   void FillEventVariables(FitEvent *event);
-  void Write(std::string drawOpt);
-  void FillHistograms();
+
+  /// Signal definition: antinumu CCQE+2p2h or numu/antinumu CC0pi
   bool isSignal(FitEvent *event);
-  void ScaleEvents();
-  void ApplyNormScale(double norm);
-  void ResetAll();
-  TH1D* fMCHist_NONCCPIM[61]; ///< Plots in CCQELike mode to tag PDG of the NONCCPIM background
-  TH1D* fMCHist_CCPIM[61]; ///< Plots in CCQELike mode to tag PDG of the CCPIM background
-  TH1D* fMCHist_CCQELIKE[61]; ///< Plots in CCQELike mode to tag PDG of the background
-
- private:
+
+  /// Uses MiniBooNE_CCQELike_Box instead.
+  // MeasurementVariableBox* CreateBox();
+
+  /// Fills extra PDG Histograms
+  void FillExtraHistograms(MeasurementVariableBox* vars,
+                              double weight = 1.0);
+
+private:
   bool fCCQElike; ///< Flag for running in CCQELike mode
   bool fUseCorrectedCTarget; ///< Flag for using corrected `C-Target' data.
   TH1D* fDataHist_CCQELIKE; ///< CCQELike data contribution
   TH1D* fDataHist_CCPIM; ///< CCPIM data contribution
   TH1D* fDataHist_NONCCPIM; ///< NONCCPIM data contribution
+
+  NuNuBarTrueModeStack* fMCHist_NONCCPIM; ///< Plots in CCQELike mode to tag PDG of the NONCCPIM 
+  NuNuBarTrueModeStack* fMCHist_CCPIM; ///< Plots in CCQELike mode to tag PDG of the CCPIM 
+  NuNuBarTrueModeStack* fMCHist_CCQELIKE; ///< Plots in CCQELike mode to tag PDG numu/numubar modes
+  int fPDGnu;
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.cxx b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.cxx
index 72c37c7..052ce2b 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.cxx
@@ -1,184 +1,182 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CCQE_XSec_1DQ2_nu.h"
 
 //********************************************************************
-MiniBooNE_CCQE_XSec_1DQ2_nu::MiniBooNE_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile,
-							 FitWeight *rw, std::string type,
-							 std::string fakeDataFile){
+MiniBooNE_CCQE_XSec_1DQ2_nu::MiniBooNE_CCQE_XSec_1DQ2_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
+  // Initalise sample Settings ---------------------------------------
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.FoundFill("name", "CCQELike", ccqelike, true);
 
-  /// Using the sample name "MiniBooNE_CCQE_XSec_1DQ2_nu_CCQELike" will allow
-  /// the CCQELike sample without background subtraction to be fitted.
-  ccqelike = name.find("CCQELike") != std::string::npos;
+  // Multiple constructors for similar samples
+  if (ccqelike) Setup_MiniBooNE_CCQELike_XSec_1DQ2_nu();
+  else Setup_MiniBooNE_CCQE_XSec_1DQ2_nu();
 
-  if(ccqelike){
-    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
-  }
+  // Final Check for all requirements, necessary to setup all extra plots.
+  FinaliseMeasurement();
+}
 
-  EnuMin = 0.;
-  EnuMax = 3.;
-  fNormError = 0.107;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/NORM/MASK";
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Plots
-  this->fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  this->SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/ccqe/asqq_con.txt");
-  this->SetupDefaultHist();
-
-  // Setup Covariance
-  if (!this->fIsDiag) {
-    ERR(FTL) << "Non diagonal covariance not allowed for MB CCQE!" << std::endl;
-    ERR(FTL) << "Run with DIAG or DEFAULT option" << std::endl;
-    throw;
-  } else {
-    /// Assume a diagonal shape-only error is default
-    fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-    covar     = StatUtils::GetInvert(fFullCovar);
-  }
+//********************************************************************
+void MiniBooNE_CCQE_XSec_1DQ2_nu::Setup_MiniBooNE_CCQE_XSec_1DQ2_nu() {
+//********************************************************************
 
-  /// If CCQELike is used an additional the CCQELike BKG is used and a PDG Histogram is saved
-  if (ccqelike){
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE CCQE sample. \n" \
+                        "Target: CH2.08 \n" \
+                        "Flux: CCQE  = Forward Horn Current numu \n" \
+                        "Signal: CCQE  = True CCQE + True 2p2h (Mode == 1 or 2) \n";
 
-    fDataHist_CCQELIKE = PlotUtils::GetTH1DFromFile(FitPar::GetDataBase()+"/MiniBooNE/ccqe/asqq_bkg.txt",
-						   (this->fName+"_data_CCQELIKE"), this->fPlotTitles);
+                        // Setup common settings
+                        fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.SetSuggestedFlux( FitPar::GetDataBase() + "/MiniBooNE/ccqe/mb_ccqe_flux.root");
 
-    for (int i = 0; i < fDataHist->GetNbinsX(); i++){
-      this->fDataHist->SetBinContent(i+1, fDataHist->GetBinContent(i+1) + fDataHist_CCQELIKE->GetBinContent(i+1));
-    }
+  // CCQE Plot Information
+  fSettings.SetTitle("MiniBooNE #nu_#mu CC0#pi");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/ccqe/asqq_con.txt" );
+  fSettings.DefineAllowedSpecies("numu");
 
-    PlotUtils::CreateNeutModeArray((TH1D*)this->fMCHist,(TH1**)this->fMCHist_CCQELIKE);
-    PlotUtils::ResetNeutModeArray((TH1**)this->fMCHist_CCQELIKE);
+  FinaliseSampleSettings();
 
-  }
+  // 2. Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  // Multiply by 14.08/6.0 to get per neutron
+  fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) *
+                  (14.08 / 6.0) / TotalIntegratedFlux());
+
+  // 3. Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromDiagonal();
+  
+};
+
+//********************************************************************
+void MiniBooNE_CCQE_XSec_1DQ2_nu::Setup_MiniBooNE_CCQELike_XSec_1DQ2_nu() {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE CC0pi sample. \n" \
+                        "Target: CH2.08 \n" \
+                        "Flux: MiniBooNE Forward Horn Current numu \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
 
-  // Get Scale Factor
-  fScaleFactor = ((GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))
-		 * (14.08/6.0)
-		 / TotalIntegratedFlux());
+  // Setup common settings
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("Q^{2}_{QE} (GeV^{2})");
+  fSettings.SetYTitle("d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.SetSuggestedFlux( FitPar::GetDataBase() + "/MiniBooNE/ccqe/mb_ccqe_flux.root");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE #nu_#mu CCQE");
+  fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/ccqe/asqq_like.txt" );
+  fSettings.SetCovarInput( FitPar::GetDataBase() + "/MiniBooNE/ccqe/asqq_diagcovar" );
+  fSettings.SetDefault( "ccqelikebkg_input", FitPar::GetDataBase() + "/MiniBooNE/ccqe/asqq_bkg.txt" );
+  fSettings.SetHasExtraHistograms(true);
+  fSettings.DefineAllowedSpecies("numu,numub");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  // Multiply by 14.08/6.0 to get per neutron
+  fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) *
+                  (14.08 / 6.0) / TotalIntegratedFlux());
+
+  // Plot Setup -------------------------------------------------------
+  fDataHist  = PlotUtils::GetTH1DFromFile( fSettings.GetDataInput(), fSettings.GetName() );
+  fDataHist->SetTitle( (fSettings.Title() + fSettings.PlotTitles()).c_str() );
+
+
+  // Make Data CCQELike BKG
+  fDataHist_CCQELIKE = PlotUtils::GetTH1DFromFile( fSettings.GetS("ccqelikebkg_input"),
+                       fSettings.GetName() + "_CCQELIKEBKG_data" );
+  fDataHist_CCQELIKE->SetNameTitle( (fSettings.Name() + "_CCQELIKE_BKG_data").c_str(),
+                                    ("MiniBooNE #nu_#mu CCQE-Like Backgrounds" + fSettings.PlotTitles()).c_str() );
+  SetAutoProcessTH1(fDataHist_CCQELIKE, kCMD_Write);
+
+  // Make MC Clone
+  fMCHist_CCQELIKE = new TrueModeStack( fSettings.Name() + "_CCQELIKE_BKG_MC",
+                                        "CCQE-like BKG MC" + fSettings.PlotTitles(),
+                                        fDataHist_CCQELIKE);
+  SetAutoProcessTH1(fMCHist_CCQELIKE);
 
 };
 
+
 //********************************************************************
-/// @details Extract q2qe(fXVar) from the event
-void  MiniBooNE_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent *event){
+void  MiniBooNE_CCQE_XSec_1DQ2_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(PhysConst::pdg_muons) == 0)
     return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
 
   // The highest momentum mu+/mu-. The isSignal definition should make sure we only
   // accept events we want, so no need to do an additional check here.
   TLorentzVector Pmu = event->GetHMFSParticle(PhysConst::pdg_muons)->fP;
 
-  q2qe = FitUtils::Q2QErec(Pmu,cos(Pnu.Vect().Angle(Pmu.Vect())), 34., false);
+  q2qe = FitUtils::Q2QErec(Pmu, cos(Pnu.Vect().Angle(Pmu.Vect())), 34., false);
 
   // Set X Variables
   fXVar = q2qe;
-
   return;
 };
 
 //********************************************************************
-bool MiniBooNE_CCQE_XSec_1DQ2_nu::isSignal(FitEvent *event){
+bool MiniBooNE_CCQE_XSec_1DQ2_nu::isSignal(FitEvent *event) {
 //********************************************************************
 
   // If CC0pi, include both charges
   if (ccqelike) {
     if (SignalDef::isCC0pi(event, 14, EnuMin, EnuMax) ||
         SignalDef::isCC0pi(event, -14, EnuMin, EnuMax))
       return true;
   } else {
     if (SignalDef::isCCQELike(event, 14, EnuMin, EnuMax))
       return true;
   }
 
   return false;
 
 };
 
-//********************************************************************
-/// @details Fills a ccqe-like background plot if required
-void MiniBooNE_CCQE_XSec_1DQ2_nu::FillHistograms(){
-//********************************************************************
-
-  Measurement1D::FillHistograms();
 
-  if (Mode != 1 and Mode != 2 and ccqelike and Signal){
-    PlotUtils::FillNeutModeArray(fMCHist_CCQELIKE, Mode, fXVar, Weight);
-  }
-}
-
-
-//********************************************************************
-/// @details Extra write command to save the CCQELike PDG if required
-void MiniBooNE_CCQE_XSec_1DQ2_nu::Write(std::string drawOpt){
-//********************************************************************
-
-  Measurement1D::Write(drawOpt);
+void MiniBooNE_CCQE_XSec_1DQ2_nu::FillExtraHistograms(MeasurementVariableBox* vars, double weight) {
 
-  if (ccqelike){
-    fDataHist_CCQELIKE->Write();
+  // No Extra Hists if not ccqelike
+  if (!ccqelike) return;
 
-    THStack combo_fMCHist_CCQELIKE = PlotUtils::GetNeutModeStack((this->fName + "_MC_CCQELIKE").c_str(), (TH1**)this->fMCHist_CCQELIKE, 0);
-    combo_fMCHist_CCQELIKE.Write();
+  if ((Mode != 1 and Mode != 2) and (Signal)) {
+    fMCHist_CCQELIKE->Fill(Mode, fXVar, weight);
   }
 
+  return;
 }
 
-
-//********************************************************************
-/// @details Extra scale command for CCQELIKE PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_nu::ResetAll(){
-//********************************************************************
-
-  if (ccqelike)
-    PlotUtils::ResetNeutModeArray((TH1**)fMCHist_CCQELIKE);
-
-}
-
-//********************************************************************
-/// @details Extra scale command for CCQELIKE PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_nu::ScaleEvents(){
-//********************************************************************
-
-  Measurement1D::ScaleEvents();
-  if (ccqelike)
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_CCQELIKE, fScaleFactor,"width");
-
-}
-
-
-//********************************************************************
-/// @details Apply norm scaling to CCQELIKE PDG Hist
-void MiniBooNE_CCQE_XSec_1DQ2_nu::ApplyNormScale(double norm){
-//********************************************************************
-  Measurement1D::ApplyNormScale(norm);
-  if (ccqelike)
-    PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_CCQELIKE, 1.0/norm, "");
-}
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.h b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.h
index a3992ad..260c4e4 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_1DQ2_nu.h
@@ -1,51 +1,50 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CCQE_XSEC_1DQ2_NU_H_SEEN
 #define MINIBOONE_CCQE_XSEC_1DQ2_NU_H_SEEN
 
 #include "Measurement1D.h"
 
-//******************************************************************** 
+//********************************************************************
 class MiniBooNE_CCQE_XSec_1DQ2_nu : public Measurement1D {
-//******************************************************************** 
+//********************************************************************
 
 public:
 
-  MiniBooNE_CCQE_XSec_1DQ2_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CCQE_XSec_1DQ2_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CCQE_XSec_1DQ2_nu() {};
-  
-  void FillEventVariables(FitEvent *event);
-  void FillHistograms();
-  void Write(std::string drawOpt);
-  bool isSignal(FitEvent *event);
-  void ScaleEvents();
-  void ApplyNormScale(double norm);
-  void ResetAll();
 
-  TH1D* fMCHist_CCQELIKE[61]; ///<! Plots in CCQELike mode to tag PDG of the background
+  // Multiple Constrictuors.
+  void Setup_MiniBooNE_CCQE_XSec_1DQ2_nu();
+  void Setup_MiniBooNE_CCQELike_XSec_1DQ2_nu();
 
- private:
+  void FillEventVariables(FitEvent *event);
+  bool isSignal(FitEvent *event);
+  void FillExtraHistograms(MeasurementVariableBox* vars, double weight = 1.0);
+  
+private:
   double q2qe; ///<! X_Variable
   bool bad_particle; ///<! Used in CCQELike mode to tag events without nucleons, muons or photons.
   bool ccqelike; ///<! Flag for running in CCQELike mode
   TH1D* fDataHist_CCQELIKE; ///<! CCQELike data contribution
+  TrueModeStack* fMCHist_CCQELIKE;
 };
-  
+
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.cxx b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.cxx
index 43f4cf0..d7fc791 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.cxx
@@ -1,114 +1,126 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CCQE_XSec_2DTcos_antinu.h"
 
+
+
 //********************************************************************
-MiniBooNE_CCQE_XSec_2DTcos_antinu::MiniBooNE_CCQE_XSec_2DTcos_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
+MiniBooNE_CCQE_XSec_2DTcos_antinu::MiniBooNE_CCQE_XSec_2DTcos_antinu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  fPlotTitles = "; Q^{2}_{QE} (GeV^{2}); d#sigma/dQ_{QE}^{2} (cm^{2}/GeV^{2})";
-  EnuMin = 0.;
-  EnuMax = 3.;
-  fNormError = 0.130;
-  fDefaultTypes="FIX/DIAG";
-  fAllowedTypes="FIX,FREE,SHAPE/DIAG/NORM";
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Plots
-  fPlotTitles = "; T_{#mu} (GeV); cos#theta_{#mu}; d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)";
-  ccqelike = name.find("CCQELike") != std::string::npos;
-
-  if(ccqelike){
-    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
-  }
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CCQE_XSec_2DTcos_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#mu} (GeV)");
+  fSettings.SetYTitle("cos#theta_{#mu}");
+  fSettings.SetZTitle("d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.130);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CCQE_XSec_2DTcos_antinu");
+
+  ccqelike = fSettings.Found("name", "CCQELike");
+  if (!ccqelike) {
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/aski_con.txt" );
+    fSettings.SetErrorInput( FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/aski_err.txt" );
+    fSettings.DefineAllowedSpecies("numub");
 
-  // Define Bin Edges
-  fNDataPointsX = 19;
-  fNDataPointsY = 21;
-  Double_t tempx[19] = { 0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1.0,  1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0};
-  Double_t tempy[21] = {-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
-  fXBins = tempx;
-  fYBins = tempy;
-
-  // Setup Data Plots
-  if (!ccqelike){
-    SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/anti-ccqe/aski_con.txt", 1E-41,
-		  FitPar::GetDataBase()+"/MiniBooNE/anti-ccqe/aski_err.txt", 1E-42);
   } else {
-    SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/anti-ccqe/aski_like.txt", 1E-41,
-		  FitPar::GetDataBase()+"/MiniBooNE/anti-ccqe/aski_err.txt", 1E-42);
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/aski_like.txt" );
+    fSettings.SetErrorInput( FitPar::GetDataBase() + "/MiniBooNE/anti-ccqe/aski_err.txt" );
+    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
+    fSettings.DefineAllowedSpecies("numu,numub");
   }
-  this->SetupDefaultHist();
 
-  // Setup Covariances
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-  fIsDiag    = true;
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = ((GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) * (14.08 / 8.) / TotalIntegratedFlux());
+
+  // Plot Setup -------------------------------------------------------
+  Double_t binx[19] = { 0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1.0,  1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0};
+  Double_t biny[21] = { -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
+  CreateDataHistogram(19, binx, 21, biny);
+
+  SetDataValuesFromTextFile( fSettings.GetDataInput() );
+  ScaleData(1E-41);
+
+  SetDataErrorsFromTextFile( fSettings.GetErrorInput() );
+  ScaleDataErrors(1E-42);
+
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  // Set Scaling for Differential Cross-section
-  fScaleFactor = ((GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))
-		 *(14.08/8.)
-		 /TotalIntegratedFlux());
 };
 
 //********************************************************************
-void  MiniBooNE_CCQE_XSec_2DTcos_antinu::FillEventVariables(FitEvent *event){
+void  MiniBooNE_CCQE_XSec_2DTcos_antinu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(PhysConst::pdg_muons) == 0)
     return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
 
   // The highest momentum mu+/mu-. The isSignal definition should make sure we only
   // accept events we want, so no need to do an additional check here.
   TLorentzVector Pmu = event->GetHMFSParticle(PhysConst::pdg_muons)->fP;
 
   // Now find the kinematic values and fill the histogram
-  Ekmu     = Pmu.E()/1000.0 - PhysConst::mass_muon;
+  Ekmu     = Pmu.E() / 1000.0 - PhysConst::mass_muon;
   costheta = cos(Pnu.Vect().Angle(Pmu.Vect()));
 
   // Set X Variables
   fXVar = Ekmu;
   fYVar = costheta;
 
   return;
 };
 
 //********************************************************************
-bool MiniBooNE_CCQE_XSec_2DTcos_antinu::isSignal(FitEvent *event){
+bool MiniBooNE_CCQE_XSec_2DTcos_antinu::isSignal(FitEvent *event) {
 //********************************************************************
 
   // If CC0pi, include both charges
   if (ccqelike) {
     if (SignalDef::isCC0pi(event, 14, EnuMin, EnuMax) ||
         SignalDef::isCC0pi(event, -14, EnuMin, EnuMax))
       return true;
   } else {
     if (SignalDef::isCCQELike(event, -14, EnuMin, EnuMax))
       return true;
   }
 
   return false;
 
 };
 
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.h b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.h
index ad2f792..a0aced5 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.h
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_antinu.h
@@ -1,42 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CCQE_XSEC_2DTcos_ANTINU_H_SEEN
 #define MINIBOONE_CCQE_XSEC_2DTcos_ANTINU_H_SEEN
 
 #include "Measurement2D.h"
 
 //******************************************************************** 
 class MiniBooNE_CCQE_XSec_2DTcos_antinu : public Measurement2D {
 //******************************************************************** 
 
 public:
 
-  MiniBooNE_CCQE_XSec_2DTcos_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CCQE_XSec_2DTcos_antinu(nuiskey samplekey);
   virtual ~MiniBooNE_CCQE_XSec_2DTcos_antinu() {};
   
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
   double Ekmu, costheta, q2qe;
   bool bad_particle, ccqelike;
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.cxx b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.cxx
index 68b2162..049b090 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.cxx
@@ -1,115 +1,125 @@
 /// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_CCQE_XSec_2DTcos_nu.h"
 
+
 //********************************************************************
-MiniBooNE_CCQE_XSec_2DTcos_nu::MiniBooNE_CCQE_XSec_2DTcos_nu(std::string name, std::string inputfile,
-							     FitWeight *rw, std::string type,
-							     std::string fakeDataFile){
+MiniBooNE_CCQE_XSec_2DTcos_nu::MiniBooNE_CCQE_XSec_2DTcos_nu(nuiskey samplekey) {
 //********************************************************************
 
-  // Measurement Details
-  fName = name;
-  EnuMin = 0.;
-  EnuMax = 3.;
-  fIsDiag = true;
-  fNormError = 0.107;
-  fDefaultTypes = "FIX/DIAG";
-  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/NORM";
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Setup Plots
-  fPlotTitles = "; T_{#mu} (GeV); cos#theta_{#mu}; d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)";
-  ccqelike = name.find("CCQELike") != std::string::npos;
-
-  if(ccqelike){
-    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
-  }
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_CCQE_XSec_2DTcos_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{#mu} (GeV)");
+  fSettings.SetYTitle("cos#theta_{#mu}");
+  fSettings.SetZTitle("d^{2}#sigma/dT_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 3.0);
+  fSettings.SetNormError(0.101);
+  fSettings.DefineAllowedTargets("C,H");
+
+  // CCQELike plot information
+  fSettings.SetTitle("MiniBooNE_CCQE_XSec_2DTcos_nu");
+
+  ccqelike = fSettings.Found("name", "CCQELike");
+  if (!ccqelike) {
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/ccqe/aski_con.txt" );
+    fSettings.SetErrorInput( FitPar::GetDataBase() + "/MiniBooNE/ccqe/aski_err.txt" );
+    fSettings.DefineAllowedSpecies("numu");
 
-  // Define Bin Edges
-  fNDataPointsX = 19;
-  fNDataPointsY = 21;
-  Double_t tempx[19] = { 0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1.0,  1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0};
-  Double_t tempy[21] = {-1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
-  fXBins = tempx;
-  fYBins = tempy;
-
-  // Setup Data Plots
-  if (!ccqelike){
-    SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/ccqe/aski_con.txt", 1E-41,
-		  FitPar::GetDataBase()+"/MiniBooNE/ccqe/aski_err.txt", 1E-42);
   } else {
-     SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/ccqe/aski_like.txt", 1E-41,
-		   FitPar::GetDataBase()+"/MiniBooNE/ccqe/aski_err.txt",  1E-42);
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "/MiniBooNE/ccqe/aski_like.txt" );
+    fSettings.SetErrorInput( FitPar::GetDataBase() + "/MiniBooNE/ccqe/aski_err.txt" );
+    fMeasurementSpeciesType = kNumuWithWrongSignMeasurement;
+    fSettings.DefineAllowedSpecies("numu,numub");
   }
-  SetupDefaultHist();
 
-  // Setup Covariances
-  fFullCovar = StatUtils::MakeDiagonalCovarMatrix(fDataHist);
-  covar     = StatUtils::GetInvert(fFullCovar);
-  fIsDiag = true;
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38 / (fNEvents + 0.)) * 14.08 / 6. / TotalIntegratedFlux();
+
+  // Plot Setup -------------------------------------------------------
+  Double_t binx[19] = { 0.2,  0.3,  0.4,  0.5,  0.6,  0.7,  0.8,  0.9,  1.0,  1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0};
+  Double_t biny[21] = { -1.0, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0};
+  CreateDataHistogram(19, binx, 21, biny);
+
+  SetDataValuesFromTextFile( fSettings.GetDataInput() );
+  ScaleData(1E-41);
+
+  SetDataErrorsFromTextFile( fSettings.GetErrorInput() );
+  ScaleDataErrors(1E-42);
+
+  SetCovarFromDiagonal();
 
-   // Different generators require slightly different rescaling factors.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38/(fNEvents+0.))*14.08/6./TotalIntegratedFlux();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 //********************************************************************
-void  MiniBooNE_CCQE_XSec_2DTcos_nu::FillEventVariables(FitEvent *event){
+void  MiniBooNE_CCQE_XSec_2DTcos_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   if (event->NumFSParticle(PhysConst::pdg_muons) == 0)
     return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
 
   // The highest momentum mu+/mu-. The isSignal definition should make sure we only
   // accept events we want, so no need to do an additional check here.
   TLorentzVector Pmu = event->GetHMFSParticle(PhysConst::pdg_muons)->fP;
 
   // Now find the kinematic values and fill the histogram
-  Ekmu     = Pmu.E()/1000.0 - PhysConst::mass_muon;
+  Ekmu     = Pmu.E() / 1000.0 - PhysConst::mass_muon;
   costheta = cos(Pnu.Vect().Angle(Pmu.Vect()));
 
   // Set X and Y Variables
   fXVar = Ekmu;
   fYVar = costheta;
 
   return;
 };
 
 //********************************************************************
-bool MiniBooNE_CCQE_XSec_2DTcos_nu::isSignal(FitEvent *event){
+bool MiniBooNE_CCQE_XSec_2DTcos_nu::isSignal(FitEvent *event) {
 //********************************************************************
 
   // If CC0pi, include both charges
   if (ccqelike) {
     if (SignalDef::isCC0pi(event, 14, EnuMin, EnuMax) ||
         SignalDef::isCC0pi(event, -14, EnuMin, EnuMax))
       return true;
   } else {
     if (SignalDef::isCCQELike(event, 14, EnuMin, EnuMax))
       return true;
   }
 
   return false;
 
 };
 
diff --git a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.h b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.h
index 2b6ac9b..7d65682 100644
--- a/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.h
+++ b/src/MiniBooNE/MiniBooNE_CCQE_XSec_2DTcos_nu.h
@@ -1,42 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_CCQE_XSEC_2DTcos_NU_H_SEEN
 #define MINIBOONE_CCQE_XSEC_2DTcos_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 //******************************************************************** 
 class MiniBooNE_CCQE_XSec_2DTcos_nu : public Measurement2D {
 //******************************************************************** 
 
 public:
 
-  MiniBooNE_CCQE_XSec_2DTcos_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_CCQE_XSec_2DTcos_nu(nuiskey samplekey);
   virtual ~MiniBooNE_CCQE_XSec_2DTcos_nu() {};
   
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
  private:
   double Ekmu, costheta;
   bool bad_particle, ccqelike;
 };
   
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.cxx b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.cxx
index 71971fc..5013411 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.cxx
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.cxx
@@ -1,88 +1,102 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h"
 
-// The constructor
-MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu::MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = name;
-  fPlotTitles = "; cos#theta_{#pi^{0}}; d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/nucleon)";
-  // (CP) I don't know what these energies should be, setting EnuMin to 5 for
-  // now. You made this life choice based upon Fig 29 in arxiv:0806.1449v2
-  EnuMin = 0.;
-  EnuMax = 5.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  std::string data_filename = "";
-  std::string covar_filename = "";
+//********************************************************************
+MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu::MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(nuiskey samplekey) {
+//********************************************************************
 
-  nunubar_mode = fName.find("combined") != std::string::npos;
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi^{0}}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 5.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fSettings.SetTitle("MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu");
+  nunubar_mode = fSettings.Found("name", "combined");
   if (!nunubar_mode) {
-    data_filename = "/data/MiniBooNE/NC1pi0/nubarcosthetapi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/nubarcosthetapi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nubarcosthetapi0xsec_edit.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nubarcosthetapi0xsecerrormatrix.txt" );
+    fSettings.DefineAllowedSpecies("numub");
+
   } else {
-    data_filename = "/data/MiniBooNE/NC1pi0/combinedsignnumodecosthetapi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/combinedsignnumodecosthetapi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnumodecosthetapi0xsec_edit.txt");
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnumodecosthetapi0xsecerrormatrix.txt");
+    fSettings.DefineAllowedSpecies("numu,numub");
+
   }
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() + data_filename);
+  FinaliseSampleSettings();
 
-  SetCovarMatrixFromText(GeneralUtils::GetTopLevelDir() + covar_filename, 10,1.E-5);
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
 
-  SetupDefaultHist();
-  StatUtils::SetDataErrorFromCov(fDataHist,fFullCovar,1E-38);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+  ScaleCovar(1.E-5);
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, 1E-38);
 
-  // (CP) setting my scale factor, the paper reports in cm^2/nucleon so I
-  // apparently don't need to faff with any other numbers.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
-};
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
+};
 
 void MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu::FillEventVariables(FitEvent *event) {
 
   // (CP) require pi0 in final state (this makes some assumptions about how the
   // generator treats the pi0 after it is produced in the nucleus.
   // MB required 2 photons to make a pion signal, so check for those later
   if (event->NumFSParticle(111) == 0 ) {
     return;
   }
 
-  if (abs(event->NumFSParticle(13)) == 1 || abs(event->NumFSParticle(11)) == 1 || abs(event->NumFSParticle(15)) == 1 || abs(event->NumFSParticle(17)) == 1) return; 
+  if (abs(event->NumFSParticle(13)) == 1 || abs(event->NumFSParticle(11)) == 1 || abs(event->NumFSParticle(15)) == 1 || abs(event->NumFSParticle(17)) == 1) return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
 
   double CosPi0 = cos(FitUtils::th(Pnu, Ppi0));
 
   fXVar = CosPi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu::isSignal(FitEvent *event) {
 //********************************************************************
-  if (nunubar_mode){
+  if (nunubar_mode) {
     return (SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax) ||
-	    SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax));
+            SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax));
   } else {
-      return SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax);
+    return SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax);
   }
 }
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h
index 936a688..a7267d7 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu.h
@@ -1,42 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_NC1PI0_XSEC_1DCOSPI0_NUBAR_H_SEEN
 #define MINIBOONE_NC1PI0_XSEC_1DCOSPI0_NUBAR_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu : public Measurement1D {
 public:
 
-  MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu(nuiskey samplekey);
   virtual ~MiniBooNE_NC1pi0_XSec_1Dcospi0_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
   /* As MB provides data for the nu/antinu siganl of nu/antinu running
      mode, as well as the combined nu+antinu signal for each mode, set
      these bools in the .cxx to select which signal to use from which mode*/ 
   bool nunubar_mode;
 
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.cxx b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.cxx
index 40474cb..e413b2c 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.cxx
@@ -1,86 +1,104 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h"
 
-// The constructor
-MiniBooNE_NC1pi0_XSec_1Dcospi0_nu::MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = name;
-  fPlotTitles = "; cos#theta_{#pi^{0}}; d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/nucleon)";
-  // (CP) I don't know what these energies should be, setting EnuMin to 5 for
-  // now. You made this life choice based upon Fig 29 in arxiv:0806.1449v2
-  EnuMin = 0.;
-  EnuMax = 5.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  std::string data_filename = "";
-  std::string covar_filename = "";
+//********************************************************************
+MiniBooNE_NC1pi0_XSec_1Dcospi0_nu::MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(nuiskey samplekey) {
+//********************************************************************
 
-  nunubarmode = name.find("combined") != std::string::npos;
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_NC1pi0_XSec_1Dcospi0_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi^{0}}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi^{0}} (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 5.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fSettings.SetTitle("MiniBooNE_NC1pi0_XSec_1Dcospi0_nu");
+  nunubarmode = fSettings.Found("name", "combined");
   if (!nunubarmode) {
-    data_filename = "/data/MiniBooNE/NC1pi0/nucosthetapi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/nucosthetapi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nucosthetapi0xsec_edit.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nucosthetapi0xsecerrormatrix.txt" );
+    fSettings.DefineAllowedSpecies("numu");
+
   } else {
-    data_filename = "/data/MiniBooNE/NC1pi0/combinedsignnubarmodecosthetapi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/combinedsignnubarmodecosthetapi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnubarmodecosthetapi0xsec_edit.txt");
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnubarmodecosthetapi0xsecerrormatrix.txt");
+    fSettings.DefineAllowedSpecies("numu,numub");
+
   }
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() + data_filename);
-  SetCovarMatrixFromText(GeneralUtils::GetTopLevelDir() + covar_filename, 18, 1.E-5);
-  SetupDefaultHist();
-  StatUtils::SetDataErrorFromCov(fDataHist,fFullCovar,1E-38);
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+  ScaleCovar(1.E-5);
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, 1E-38);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  // (CP) setting my scale factor, the paper reports in cm^2/nucleon so I
-  // apparently don't need to faff with any other numbers.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 
 void MiniBooNE_NC1pi0_XSec_1Dcospi0_nu::FillEventVariables(FitEvent *event) {
 
   // (CP) require pi0 in final state (this makes some assumptions about how the
   // generator treats the pi0 after it is produced in the nucleus.
   // MB required 2 photons to make a pion signal, so check for those later
   if (event->NumFSParticle(111) == 0 ) {
     return;
   }
 
   if (abs(event->NumFSParticle(13)) == 1 || abs(event->NumFSParticle(11)) == 1 || abs(event->NumFSParticle(15)) == 1 || abs(event->NumFSParticle(17)) == 1) return; 
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
 
   double CosPi0 = cos(FitUtils::th(Pnu, Ppi0));
 
   fXVar = CosPi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_NC1pi0_XSec_1Dcospi0_nu::isSignal(FitEvent *event) {
 //********************************************************************
   if (nunubarmode){
     return (SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax) ||
 	    SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax));
   } else {
     return SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax);
   }
 }
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h
index 063ca3d..4e75239 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dcospi0_nu.h
@@ -1,42 +1,42 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_NC1PI0_XSEC_1DCOSPI0_NU_H_SEEN
 #define MINIBOONE_NC1PI0_XSEC_1DCOSPI0_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_NC1pi0_XSec_1Dcospi0_nu : public Measurement1D {
 public:
 
-  MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_NC1pi0_XSec_1Dcospi0_nu(nuiskey samplekey);
   virtual ~MiniBooNE_NC1pi0_XSec_1Dcospi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 
   /* As MB provides data for the nu/nubar siganl of nu/nubar running
      mode, as well as the combined nu+nubar signal for each mode,
      use these bools to select which signal to use from which mode*/
   bool nunubarmode;
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.cxx b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.cxx
index 6b62714..de94f25 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.cxx
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.cxx
@@ -1,85 +1,103 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h"
 
-// The constructor
-MiniBooNE_NC1pi0_XSec_1Dppi0_antinu::MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
 
-  fName = name;
-  fPlotTitles = "; p_{#pi^{0}} (GeV/c); d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)";
-  // (CP) I don't know what these energies should be, setting EnuMin to 5 for
-  // now. You made this life choice based upon Fig 29 in arxiv:0806.1449v2
-  EnuMin = 0.;
-  EnuMax = 5.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+MiniBooNE_NC1pi0_XSec_1Dppi0_antinu::MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_NC1pi0_XSec_1Dppi0_antinu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
 
-  std::string data_filename = "";
-  std::string covar_filename = "";
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi^{0}} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 5.0);
+  fSettings.DefineAllowedTargets("C,H");
 
-  nunubarmode = fName.find("combined") != std::string::npos;
+  fSettings.SetTitle("MiniBooNE_NC1pi0_XSec_1Dppi0_antinu");
+
+  nunubarmode = fSettings.Found("name", "combined");
   if (!nunubarmode) {
-    data_filename = "/data/MiniBooNE/NC1pi0/nubarppi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/nubarppi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nubarppi0xsec_edit.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nubarppi0xsecerrormatrix.txt" );
+    fSettings.DefineAllowedSpecies("numu");
+
   } else {
-    data_filename = "/data/MiniBooNE/NC1pi0/combinedsignnumodeppi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/combinedsignnumodeppi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnumodeppi0xsec_edit.txt");
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnumodeppi0xsecerrormatrix.txt");
+    fSettings.DefineAllowedSpecies("numu,numub");
+
   }
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() + data_filename);
-  SetCovarMatrixFromText(GeneralUtils::GetTopLevelDir() + covar_filename, 10, 1.E-5);
-  SetupDefaultHist();
-  StatUtils::SetDataErrorFromCov(fDataHist,fFullCovar,1E-38);
+  FinaliseSampleSettings();
 
-  // (CP) setting my scale factor, the paper reports in cm^2/nucleon so I
-  // apparently don't need to faff with any other numbers.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
-};
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+  ScaleCovar(1.E-5);
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, 1E-38);
 
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 void MiniBooNE_NC1pi0_XSec_1Dppi0_antinu::FillEventVariables(FitEvent *event) {
 
   // (CP) require pi0 in final state (this makes some assumptions about how the
   // generator treats the pi0 after it is produced in the nucleus.
   // MB required 2 photons to make a pion signal, so check for those later
   if (event->NumFSParticle(111) == 0) {
     return;
   }
 
   if (abs(event->NumFSParticle(13)) == 1 || abs(event->NumFSParticle(11)) == 1 || abs(event->NumFSParticle(15)) == 1 || abs(event->NumFSParticle(17)) == 1) return;
   
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
 
   double p_pi0 = FitUtils::p(Ppi0);
 
   fXVar = p_pi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_NC1pi0_XSec_1Dppi0_antinu::isSignal(FitEvent *event) {
 //********************************************************************
   if (nunubarmode){
     return (SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax) ||
 	    SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax) );
   } else {
     return SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax);
   }
 }
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h
index 8f611cc..ee6f982 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_antinu.h
@@ -1,41 +1,41 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_NC1PI0_XSEC_1DPPI0_NUBAR_H_SEEN
 #define MINIBOONE_NC1PI0_XSEC_1DPPI0_NUBAR_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_NC1pi0_XSec_1Dppi0_antinu : public Measurement1D {
 public:
 
-  MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_NC1pi0_XSec_1Dppi0_antinu(nuiskey samplekey);
   virtual ~MiniBooNE_NC1pi0_XSec_1Dppi0_antinu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
   /* As MB provides data for the nu/nubar siganl of nu/nubar running
      mode, as well as the combined nu+nubar signal for each mode, set
      these bools in the .cxx to select which signal to use from which mode */
   bool nunubarmode;
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.cxx b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.cxx
index 8b3a265..1dc1119 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.cxx
@@ -1,87 +1,103 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h"
 
-// The constructor
-MiniBooNE_NC1pi0_XSec_1Dppi0_nu::MiniBooNE_NC1pi0_XSec_1Dppi0_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = name;
-  fPlotTitles = "; p_{#pi^{0}} (GeV/c); d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)";
-  // (CP) I don't know what these energies should be, setting EnuMin to 5 for
-  // now. You made this life choice based upon Fig 29 in arxiv:0806.1449v2
-  EnuMin = 0.;
-  EnuMax = 5.0;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  std::string data_filename = "";
-  std::string covar_filename = "";
-  
-  nunubar_mode_nu = fName.find("combined") != std::string::npos;
+
+//********************************************************************
+MiniBooNE_NC1pi0_XSec_1Dppi0_nu::MiniBooNE_NC1pi0_XSec_1Dppi0_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_NC1pi0_XSec_1Dppi0_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 muon, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi^{0}} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#pi^{0}} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 5.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fSettings.SetTitle("MiniBooNE_NC1pi0_XSec_1Dppi0_nu");
+  nunubar_mode_nu = fSettings.Found("name", "combined");
   if (!nunubar_mode_nu) {
-    data_filename = "/data/MiniBooNE/NC1pi0/nuppi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/nuppi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nuppi0xsec_edit.txt" );
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/nuppi0xsecerrormatrix.txt" );
+    fSettings.DefineAllowedSpecies("numu");
+
   } else {
-    data_filename = "/data/MiniBooNE/NC1pi0/combinedsignnubarmodeppi0xsec_edit.txt";
-    covar_filename = "/data/MiniBooNE/NC1pi0/combinedsignnubarmodeppi0xsecerrormatrix.txt";
+    fSettings.SetDataInput(  FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnubarmodeppi0xsec_edit.txt");
+    fSettings.SetCovarInput( FitPar::GetDataBase() + "MiniBooNE/NC1pi0/combinedsignnubarmodeppi0xsecerrormatrix.txt");
+    fSettings.DefineAllowedSpecies("numu,numub");
+
   }
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() + data_filename);
-  SetCovarMatrixFromText(GeneralUtils::GetTopLevelDir() + covar_filename, 11, 1.E-5);
-  StatUtils::SetDataErrorFromCov(fDataHist,fFullCovar,1E-38);
+  FinaliseSampleSettings();
 
-  SetupDefaultHist();
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
 
-  // (CP) setting my scale factor, the paper reports in cm^2/nucleon so I
-  // apparently don't need to faff with any other numbers.
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
-};
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  SetCovarFromTextFile( fSettings.GetCovarInput() );
+  ScaleCovar(1.E-5);
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, 1E-38);
 
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
 
 void MiniBooNE_NC1pi0_XSec_1Dppi0_nu::FillEventVariables(FitEvent *event) {
 
   // (CP) require pi0 in final state (this makes some assumptions about how the
   // generator treats the pi0 after it is produced in the nucleus.
   // MB required 2 photons to make a pion signal, so check for those later
   if (event->NumFSParticle(111) == 0) {
     return;
   }
 
   if (abs(event->NumFSParticle(13)) == 1 || abs(event->NumFSParticle(11)) == 1 || abs(event->NumFSParticle(15)) == 1 || abs(event->NumFSParticle(17)) == 1) return;
   
   TLorentzVector Ppi0 = event->GetHMFSParticle(111)->fP;
 
   double p_pi0 = FitUtils::p(Ppi0);
 
   fXVar = p_pi0;
 
   return;
 };
 
 //********************************************************************
 bool MiniBooNE_NC1pi0_XSec_1Dppi0_nu::isSignal(FitEvent *event) {
 //********************************************************************
 
   if (nunubar_mode_nu){
     return (SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax) ||
 	    SignalDef::isNC1pi(event, -14, 111, EnuMin, EnuMax));
   } else {
     return SignalDef::isNC1pi(event, 14, 111, EnuMin, EnuMax);
   }
 }
diff --git a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h
index f6d3c39..112e278 100644
--- a/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h
+++ b/src/MiniBooNE/MiniBooNE_NC1pi0_XSec_1Dppi0_nu.h
@@ -1,41 +1,41 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_NC1PI0_XSEC_1DPPI0_NU_H_SEEN
 #define MINIBOONE_NC1PI0_XSEC_1DPPI0_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 class MiniBooNE_NC1pi0_XSec_1Dppi0_nu : public Measurement1D {
 public:
 
-  MiniBooNE_NC1pi0_XSec_1Dppi0_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
+  MiniBooNE_NC1pi0_XSec_1Dppi0_nu(nuiskey samplekey);
   virtual ~MiniBooNE_NC1pi0_XSec_1Dppi0_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
   /* As MB provides data for the nu/nubar siganl of nu/nubar running
      mode, as well as the combined nu+nubar signal for each mode, set
      these bools in the .cxx to select which signal to use from which mode*/ 
   bool nunubar_mode_nu;
 };
 
 #endif
diff --git a/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.cxx b/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.cxx
index 5a1eb89..e46ae68 100644
--- a/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.cxx
+++ b/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.cxx
@@ -1,224 +1,264 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "MiniBooNE_NCEL_XSec_Treco_nu.h"
 #include "TLorentzVector.h"
 
-// The constructor
-MiniBooNE_NCEL_XSec_Treco_nu::MiniBooNE_NCEL_XSec_Treco_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile){
-
-  fName = "MiniBooNE_NCEL_XSec_Treco_nu";
-  fPlotTitles = "; T_{reco} (MeV); Events/(12 MeV)";
-  EnuMin = 0.;
-  EnuMax = 10.0;
-  fTRecoEdges = {40.0, 52.0, 63.9, 75.9, 87.8, 99.8, 111.8, 123.7, 135.7, 147.6, 159.6, 171.6, 183.5, 195.5,
-   207.5, 219.4, 231.4, 243.3, 255.3, 267.3, 279.2, 291.2, 303.1, 315.1, 327.1, 339.0, 351.0, 362.9, 374.9, 386.9,
-   398.8, 410.8, 422.7, 434.7, 446.7, 458.6, 470.6, 482.5, 494.5, 506.5, 518.4, 530.4, 542.4, 554.3, 566.3, 578.2,
-   590.2, 602.2, 614.1, 626.1, 638.0, 650.0};
+//********************************************************************
+MiniBooNE_NCEL_XSec_Treco_nu::MiniBooNE_NCEL_XSec_Treco_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "MiniBooNE_NCEL_XSec_Treco_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MiniBooNE Numu Flux \n" \
+                        "Signal: Any event with True NCEL modes \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("T_{reco} (MeV)");
+  fSettings.SetYTitle("Events/(12 MeV)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/FULL,DIAG/NORM/MASK", "FIX/FULL,DIAG");
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+  fSettings.SetEnuRange(0.0, 10.0);
+  
+  double arr_treco[52] = {40.0, 52.0, 63.9, 75.9, 87.8, 99.8, 111.8, 123.7, 135.7, 147.6, 159.6, 171.6, 183.5, 195.5, \
+	       207.5, 219.4, 231.4, 243.3, 255.3, 267.3, 279.2, 291.2, 303.1, 315.1, 327.1, 339.0, 351.0, 362.9, 374.9, 386.9, \
+	       398.8, 410.8, 422.7, 434.7, 446.7, 458.6, 470.6, 482.5, 494.5, 506.5, 518.4, 530.4, 542.4, 554.3, 566.3, 578.2, \
+	       590.2, 602.2, 614.1, 626.1, 638.0, 650.0}; 
+  
+  SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/ncqe/input_data.txt", arr_treco);
+  SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/ncqe/ErrorMatrix.tab",   51);
+  SetResponseMatrix(FitPar::GetDataBase()+"/MiniBooNE/ncqe/response_mat.txt", 51, arr_treco);
+  SetFluxHistogram(FitPar::GetDataBase()+"/MiniBooNE/ncqe/flux.txt");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // The scale factor is quite complicated because MB didn't divide by number of targets.
+  // nMolMB is the number of CH_2 molecules in the MB FV (610.6 cm radius sphere) and 0.845 is the published density of the mineral oil.
+  // UPDATE: nMolMB is the number of CH_2 molecules in the MB FV (500 cm radius sphere) and 0.845 is the published density of the mineral oil.
+  // UPDATE UPDATE: They didn't account for fiducial cut, so neither do we.
+  double nMolMB = 6.023E+23*0.845*4.0*M_PI*610.6*610.6*610.6/3.0;
+  double POT = 6.46e20;
 
-   SetDataValues(FitPar::GetDataBase()+"/MiniBooNE/ncqe/input_data.txt");
-   SetCovarMatrix(FitPar::GetDataBase()+"/MiniBooNE/ncqe/ErrorMatrix.tab",   51);
-   SetResponseMatrix(FitPar::GetDataBase()+"/MiniBooNE/ncqe/response_mat.txt", 51);
+  // Need to update scalefactor to reflect actual flux used
+  fScaleFactor = (this->newFluxHist->Integral("")*POT*(GetEventHistogram()->Integral("width"))*1E-38*14.08/(fNEvents+0.))*nMolMB;
+  fScaleFactor /= GetFluxHistogram()->Integral("width");
 
-  // Setup MC Hists
-   Measurement1D::SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
   // Usually the MCFine histogram is a finer binned version of MC Hist.
   // In this case we need to use it to save the true distribution before smearing.
-   if (fMCFine) delete fMCFine;
-   fMCFine = new TH1D((this->fName+"_Ttrue").c_str(), (this->fName+this->fPlotTitles).c_str(), 50, 0, 900);
+  if (fMCFine) delete fMCFine;
+  fMCFine = new TH1D((this->fName+"_Ttrue").c_str(), (this->fName+this->fPlotTitles).c_str(), 50, 0, 900);
 
-  // The scale factor is quite complicated because MB didn't divide by number of targets.
-  // nMolMB is the number of CH_2 molecules in the MB FV (610.6 cm radius sphere) and 0.845 is the published density of the mineral oil.
-   double nMolMB = 6.023E+23*0.845*4.0*M_PI*610.6*610.6*610.6/3.0;
-   fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38*14.08/(fNEvents+0.))*nMolMB*0.646165;
 
- };
+};
+
 
- void MiniBooNE_NCEL_XSec_Treco_nu::FillEventVariables(FitEvent *event){
+void MiniBooNE_NCEL_XSec_Treco_nu::Write(std::string arg){
+  newFluxHist->Write("MB_NCEL_newFlux");
+  response_mat->Write("MB_NCEL_response matrix");
+
+  Measurement1D::Write(arg);
+  return;
+}
+
+void MiniBooNE_NCEL_XSec_Treco_nu::FillEventVariables(FitEvent *event){
 
   double t_raw = 0.0;
 
   // Loop and add all Tnucleon
   for (UInt_t i = 0; i < event->Npart(); i++){
     if (event->PartInfo(i)->Status() != kFinalState) continue;
 
     int pdg = event->PartInfo(i)->fPID;
     if (pdg == 2212 || pdg == 2112){
       t_raw += FitUtils::T(event->PartInfo(i)->fP)*1.E3;
     }
   }
 
   fXVar = t_raw;
 }
 
-bool MiniBooNE_NCEL_XSec_Treco_nu::ScaleEvents(){
+void MiniBooNE_NCEL_XSec_Treco_nu::ScaleEvents(){
 
   // Now convert Ttrue to Treco...
   for (int treco = 0; treco < 51; ++treco){
     double total = 0.;
-    for (int ttrue = 0; ttrue < 50; ++ttrue) total += fMCFine->GetBinContent(ttrue+1)*response_mat->GetBinContent(ttrue+1, treco+1);
-      fMCHist->SetBinContent(treco+1, total);
+    for (int ttrue = 0; ttrue < 50; ++ttrue)
+      total += fMCFine->GetBinContent(ttrue+1)*response_mat->GetBinContent(ttrue+1, treco+1);
+    fMCHist->SetBinContent(treco+1, total);
   }
 
   // Scale
   this->fMCHist->Scale(this->fScaleFactor, "width");
   this->fMCFine->Scale(this->fScaleFactor, "width");
   PlotUtils::ScaleNeutModeArray((TH1**)fMCHist_PDG, fScaleFactor, "width");
 
   // Add in the backgrounds...
   for (int treco = 0; treco < 51; ++treco){
-     double total = this->fMCHist->GetBinContent(treco+1) + this->BKGD_other->GetBinContent(treco+1) + this->BKGD_irrid->GetBinContent(treco+1);
-      this->fMCHist->SetBinContent(treco+1, total);
+    double total = this->fMCHist->GetBinContent(treco+1) + this->BKGD_other->GetBinContent(treco+1) + this->BKGD_irrid->GetBinContent(treco+1);
+    this->fMCHist->SetBinContent(treco+1, total);
   }
 
 }
 
 
 bool MiniBooNE_NCEL_XSec_Treco_nu::isSignal(FitEvent *event){
 
   // Should put in MB SignalDef eventually
   if (event->Mode != 51 && event->Mode != 52) return false;
 
   // Numu or nue
-  if (event->PDGnu != 14 && event->PDGnu != 12) return false;
+  if (event->PDGnu() != 14 && event->PDGnu() != 12) return false;
 
   // Enu
   if (event->Enu() < EnuMin*1000.0 || event->Enu() > EnuMax*1000.0)
     return false;
 
   return true;
 };
 
+void MiniBooNE_NCEL_XSec_Treco_nu::SetFluxHistogram(std::string dataFile){
+  this->newFluxHist = PlotUtils::GetTH1DFromFile(dataFile.c_str(),
+                  (this->fName+"Real Flux Hist"), "idgaf");
 
+  this->newFluxHist->Print();
+  return;
+}
 // Read in the covariance matrix from the file specified in the constructor
 void MiniBooNE_NCEL_XSec_Treco_nu::SetCovarMatrix(std::string covarFile, int dim){
 
   // Use Utils
 
   // // Make a counter to track the line number
-  // int row = 0;
+  int row = 0;
 
-  // std::string line;
-  // std::ifstream covar(covarFile.c_str(),ifstream::in);
+  std::string line;
+  std::ifstream covar(covarFile.c_str(),ifstream::in);
 
-  // this->covar = new TMatrixDSym(dim);
+  this->covar = new TMatrixDSym(dim);
 
-  // if(covar.is_open()) LOG(DEB) << "Reading covariance matrix from file: " << covarFile << std::endl;
+  if(covar.is_open()) LOG(DEB) << "Reading covariance matrix from file: " << covarFile << std::endl;
 
-  // while(std::getline(covar >> std::ws, line, '\n')){
-  //   std::istringstream stream(line);
-  //   double entry;
-  //   int column = 0;
+  while(std::getline(covar >> std::ws, line, '\n')){
+    std::istringstream stream(line);
+    double entry;
+    int column = 0;
 
-  //   // Loop over entries and insert them into matrix
-  //   // Multiply by the errors to get the covariance, rather than the correlation matrix
-  //   while(stream >> entry){
-  //     (*this->covar)(row, column) = entry;
-  //     if (row == column) this->fDataHist->SetBinError(row+1, sqrt(entry));
-  //     column++;
-  //   }
-  //   row++;
-  // }
+     // Loop over entries and insert them into matrix
+     // Multiply by the errors to get the covariance, rather than the correlation matrix
+  while(stream >> entry){
+    (*this->covar)(row, column) = entry;
+    if (row == column) this->fDataHist->SetBinError(row+1, sqrt(entry));
+      column++;
+    }
+    row++;
+  }
 
   // // Robust matrix inversion method
-  // TDecompSVD LU = TDecompSVD(*this->covar);
-  // this->covar = new TMatrixDSym(dim, LU .Invert().GetMatrixArray(), "");
+  TDecompSVD LU = TDecompSVD(*this->covar);
+  this->covar = new TMatrixDSym(dim, LU .Invert().GetMatrixArray(), "");
 
   return;
 };
 
 // Override the usual function in the base class because this is more complicated for the NCEL sample...
-void MiniBooNE_NCEL_XSec_Treco_nu::SetDataValues(std::string inputFile){
+void MiniBooNE_NCEL_XSec_Treco_nu::SetDataValues(std::string inputFile, double* arr_treco){
 
-   std::string line;
-   std::ifstream input(inputFile.c_str(),ifstream::in);
+  std::string line;
+  std::ifstream input(inputFile.c_str(),ifstream::in);
 
-   if(input.is_open()) LOG(DEB) << "Reading data from file: " << inputFile << std::endl;
+  if(input.is_open()) LOG(DEB) << "Reading data from file: " << inputFile << std::endl;
 
-   this->fDataHist   = new TH1D((this->fName+"_data").c_str(), (this->fName+this->fPlotTitles).c_str(),
-   			      51, this->arr_treco);
-   this->BKGD_other = new TH1D((this->fName+"_BKGD_other").c_str(), (this->fName+this->fPlotTitles).c_str(),
-   			      51, arr_treco);
-   this->BKGD_irrid = new TH1D((this->fName+"_BKGD_irrid").c_str(), (this->fName+this->fPlotTitles).c_str(),
-   			      51, arr_treco);
-    To get the nDOF correct...
-   this->fNDataPointsX= 52;
+  this->fDataHist   = new TH1D((this->fName+"_data").c_str(), (this->fName+this->fPlotTitles).c_str(),
+  			      51, arr_treco);
+  this->BKGD_other = new TH1D((this->fName+"_BKGD_other").c_str(), (this->fName+this->fPlotTitles).c_str(),
+  			      51, arr_treco);
+  this->BKGD_irrid = new TH1D((this->fName+"_BKGD_irrid").c_str(), (this->fName+this->fPlotTitles).c_str(),
+  			      51, arr_treco);
+   // To get the nDOF correct...
+  this->fNDataPointsX= 52;
 
-   double entry = 0;
-   int xBin     = 0;
+  double entry = 0;
+  int xBin     = 0;
 
    //    First line is the MB data
-   std::getline(input >> std::ws, line, '\n');
-   std::istringstream stream1(line);
-
-   while(stream1 >> entry){
-     this->fDataHist->SetBinContent(xBin+1, entry);
-     xBin++;
-   }
-
-   //    Second line is "other" backgrounds
-   std::getline(input >> std::ws, line, '\n');
-   std::istringstream stream2(line);
-   entry = 0;
-   xBin  = 0;
-   while(stream2 >> entry){
-     this->BKGD_other->SetBinContent(xBin+1, entry);
-     xBin++;
-   }
+  std::getline(input >> std::ws, line, '\n');
+  std::istringstream stream1(line);
+
+  while(stream1 >> entry){
+    this->fDataHist->SetBinContent(xBin+1, entry);
+    xBin++;
+  }
+
+  //    Second line is "other" backgrounds
+  std::getline(input >> std::ws, line, '\n');
+  std::istringstream stream2(line);
+  entry = 0;
+  xBin  = 0;
+  while(stream2 >> entry){
+    this->BKGD_other->SetBinContent(xBin+1, entry);
+    xBin++;
+  }
 
    //  Third line is the irreducible background
-   std::getline(input >> std::ws, line, '\n');
-   std::istringstream stream3(line);
-   entry = 0;
-   xBin  = 0;
-   while(stream3 >> entry){
-     this->BKGD_irrid->SetBinContent(xBin+1, entry);
-     xBin++;
-   }
+  std::getline(input >> std::ws, line, '\n');
+  std::istringstream stream3(line);
+  entry = 0;
+  xBin  = 0;
+  while(stream3 >> entry){
+    this->BKGD_irrid->SetBinContent(xBin+1, entry);
+    xBin++;
+  }
 };
 
 // Read in the response matrix -- thus far, a response matrix is unique to the NCEL sample
-void MiniBooNE_NCEL_XSec_Treco_nu::SetResponseMatrix(std::string responseFile, int dim){
+void MiniBooNE_NCEL_XSec_Treco_nu::SetResponseMatrix(std::string responseFile, int dim, double* arr_treco){
   // Make a counter to track the line number
-  // int xBin = 0;
-
-  // std::string line;
-  // std::ifstream response(responseFile.c_str(),ifstream::in);
-
-  // // Response matrix: x axis is Ttrue, y axis is Treco
-  // this->response_mat = new TH2D((this->fName+"_RESPONSE_MATRIX").c_str(), (this->fName+this->fPlotTitles).c_str(),
-  // 				50, 0, 900, 51, this->arr_treco);
-
-  // if(response.is_open()) LOG(DEB) << "Reading in the response matrix from file: " << responseFile << std::endl;
-
-  // while(std::getline(response, line, '\n')){
-  //   std::istringstream stream(line);
-  //   double entry;
-  //   int yBin = 0;
-
-  //   // Loop over entries and insert them into matrix
-  //   // Multiply by the errors to get the covariance, rather than the correlation matrix
-  //   while(stream >> entry){
-  //     this->response_mat->SetBinContent(xBin+1, yBin+1, entry);
-  //     yBin++;
-  //   }
-  //   xBin++;
-  // }
+  int xBin = 0;
+
+  std::string line;
+  std::ifstream response(responseFile.c_str(),ifstream::in);
+
+   // Response matrix: x axis is Ttrue, y axis is Treco
+  this->response_mat = new TH2D((this->fName+"_RESPONSE_MATRIX").c_str(), (this->fName+this->fPlotTitles).c_str(),
+  				50, 0, 900, 51, arr_treco);
+
+  if(response.is_open()) LOG(DEB) << "Reading in the response matrix from file: " << responseFile << std::endl;
+
+  while(std::getline(response, line, '\n')){
+    std::istringstream stream(line);
+    double entry;
+    int yBin = 0;
+
+     // Loop over entries and insert them into matrix
+     // Multiply by the errors to get the covariance, rather than the correlation matrix
+    while(stream >> entry){
+      this->response_mat->SetBinContent(xBin+1, yBin+1, entry);
+      yBin++;
+    }
+    xBin++;
+  }
 };
diff --git a/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.h b/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.h
index 5885153..7ca1fec 100644
--- a/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.h
+++ b/src/MiniBooNE/MiniBooNE_NCEL_XSec_Treco_nu.h
@@ -1,56 +1,58 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIBOONE_NCEL_XSEC_TRECO_NU_H_SEEN
 #define MINIBOONE_NCEL_XSEC_RECO_NU_H_SEEN
 
 #include "Measurement1D.h"
 
 //********************************************************************
 class MiniBooNE_NCEL_XSec_Treco_nu : public Measurement1D {
 //********************************************************************
 
 public:
+  void Write(std::string arg);
+
+  MiniBooNE_NCEL_XSec_Treco_nu(nuiskey samplekey);
 
-  MiniBooNE_NCEL_XSec_Treco_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
   virtual ~MiniBooNE_NCEL_XSec_Treco_nu() {};
 
   void FillEventVariables(FitEvent *event);
 
   bool isSignal(FitEvent *event);
 
   void ScaleEvents();
 
-  void SetDataValues(std::string inputFile);
+  void SetDataValues(std::string inputFile, double* arr_treco);
 
  private:
   void SetCovarMatrix(std::string covarFile, int dim);
 
-  void SetResponseMatrix(std::string responseFile, int dim);
+  void SetResponseMatrix(std::string responseFile, int dim, double* arr_treco);
 
-  // Because the Treco binning is irregular, store an array of bin edges...
-  double arr_treco[52];
+  void SetFluxHistogram(std::string dataFile);
 
+  TH1D *newFluxHist;
   TH1D *BKGD_other;
   TH1D *BKGD_irrid;
   TH2D *response_mat;
 
 };
 
 #endif
diff --git a/src/MiniBooNE/SampleSettings.cxx b/src/MiniBooNE/SampleSettings.cxx
new file mode 100644
index 0000000..639d5fe
--- /dev/null
+++ b/src/MiniBooNE/SampleSettings.cxx
@@ -0,0 +1,99 @@
+#include "SampleSettings.h"
+
+SampleSettings::SampleSettings(){
+};
+
+SampleSettings::SampleSettings(nuiskey key){
+	fKeyValues = key;
+	if (!key.Has("type")) key.AddS("type","DEFAULT");
+}
+
+std::string SampleSettings::GetName(){
+	return GetS("name");
+}
+
+void SampleSettings::SetS(std::string name, std::string val){
+	fKeyValues.SetS(name, val);
+};
+
+
+void SampleSettings::SetXTitle(std::string name){
+	SetDefault("xtitle",name);
+};
+
+void SampleSettings::SetYTitle(std::string name){
+	SetDefault("ytitle",name);
+};
+
+void SampleSettings::SetAllowedTypes(std::string allowed, std::string defaulttype){
+	SetDefault("default_types",allowed);
+	SetDefault("allowed_types",defaulttype);
+};
+
+void SampleSettings::SetEnuRangeFromFlux(TH1D* fluxhist){
+	double enu_min = fluxhist->GetXaxis()->GetXmin();
+	double enu_max = fluxhist->GetXaxis()->GetXmax();
+	SetEnuRange(enu_min,enu_max);
+};
+
+void SampleSettings::SetEnuRange(double min, double max){
+	SetDefault("enu_min",min);
+	SetDefault("enu_max",max);
+};
+
+void SampleSettings::DefineAllowedTargets(std::string targ){
+	// fAllowedTargets = TargetUtils::ParseTargetsToIntVect(targ);
+};
+
+
+void SampleSettings::FoundFill(std::string name, std::string substr, bool& cont, bool def){
+	std::string compstring = fKeyValues.GetS(name);
+	if (compstring.find(substr) != std::string::npos){
+		cont = def;
+	}
+};
+
+
+void SampleSettings::SetTitle(std::string val){
+	SetDefault("title",val);
+};
+
+void SampleSettings::SetDataInput(std::string val){
+	SetDefault("data",val);
+};
+
+void SampleSettings::SetCovarInput(std::string val){
+	SetDefault("covar",val);
+};
+
+void SampleSettings::SetDefault(std::string name, std::string val){
+	if (!fKeyValues.Has(name)) fKeyValues.AddS(name, val);
+};
+
+void SampleSettings::SetDefault(std::string name, double val ){
+	if (!fKeyValues.Has(name)) fKeyValues.AddD(name, val);
+};
+
+void SampleSettings::SetHasExtraHistograms(bool opt){
+	fHasExtraHistograms = opt;
+};
+
+void SampleSettings::DefineAllowedSpecies(std::string species){
+	fAllowedTargets = BeamUtils::ParseSpeciesToIntVect(species);
+};
+
+std::string SampleSettings::Title(){
+	return GetS("title");
+}
+
+std::string SampleSettings::GetDataInput(){
+	return GetS("data");
+};
+
+std::string SampleSettings::PlotTitles(){
+	return ";" + GetS("xtitle") + ";" + GetS("ytitle");
+};
+
+std::string SampleSettings::GetS(std::string name){
+	return fKeyValues.GetS(name);
+}
diff --git a/src/MiniBooNE/SampleSettings.h b/src/MiniBooNE/SampleSettings.h
new file mode 100644
index 0000000..80b9fea
--- /dev/null
+++ b/src/MiniBooNE/SampleSettings.h
@@ -0,0 +1,46 @@
+#ifndef SAMPLESETTINGS_H
+#define SAMPLESETTINGS_H
+#include "NuisConfig.h"
+#include "NuisKey.h"
+#include "TH1D.h"
+#include "BeamUtils.h"
+class SampleSettings {
+public:
+	SampleSettings();
+	SampleSettings(nuiskey key);
+
+	inline std::string Name(){return GetName();};
+	std::string GetName();
+	void SetS(std::string name, std::string val);
+	void SetXTitle(std::string name);
+	void SetYTitle(std::string name);
+	void SetAllowedTypes(std::string allowed, std::string defaulttype="FIX");
+	void SetEnuRangeFromFlux(TH1D* fluxhist);
+	void SetEnuRange(double min, double max);
+	std::string Title();
+	void DefineAllowedTargets(std::string targ);
+
+	void FoundFill(std::string name, std::string substr, bool& cont, bool def);
+	void SetTitle(std::string val);
+	void SetDataInput(std::string val);
+	void SetCovarInput(std::string val);
+
+	void SetDefault(std::string name, std::string val);
+	void SetDefault(std::string name, double val);
+	void SetHasExtraHistograms(bool opt = true);
+	void DefineAllowedSpecies(std::string species);
+
+	bool Has(std::string name){return fKeyValues.Has(name);};
+
+	std::string GetDataInput();
+	std::string PlotTitles();
+	std::string GetS(std::string name);
+
+
+	std::vector<int> fAllowedTargets;
+	std::vector<int> fAllowedSpecies;
+  	nuiskey fKeyValues;
+  	bool fHasExtraHistograms;
+};
+
+#endif
diff --git a/src/FitBase/CMakeLists.txt b/src/Reweight/CMakeLists.txt
similarity index 71%
copy from src/FitBase/CMakeLists.txt
copy to src/Reweight/CMakeLists.txt
index 89f6e00..dafd285 100644
--- a/src/FitBase/CMakeLists.txt
+++ b/src/Reweight/CMakeLists.txt
@@ -1,72 +1,84 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
-ParamPull.cxx
-BaseFitEvt.cxx
-FitParticle.cxx
+GlobalDialList.cxx
 FitWeight.cxx
-Measurement1D.cxx
-EventManager.cxx
-InputHandler.cxx
-Measurement2D.cxx
-FitEvent.cxx
-JointMeas1D.cxx
-MeasurementBase.cxx
-GeneratorUtils.cxx
-StdHepEvt.cxx
-TemplateMeas1D.cxx
-InputUtils.cxx
+WeightEngineBase.cxx
+NEUTWeightEngine.cxx
+NuWroWeightEngine.cxx
+GENIEWeightEngine.cxx
+WeightUtils.cxx
+SampleNormEngine.cxx
+LikelihoodWeightEngine.cxx
+SplineWeightEngine.cxx
+NUISANCESyst.cxx
+T2KWeightEngine.cxx
+NUISANCEWeightEngine.cxx
+NUISANCEWeightCalcs.cxx
+NIWGWeightEngine.cxx
 )
 
 set(HEADERFILES
-ParamPull.h
-NuanceEvent.h
-BaseFitEvt.h    FitEvent.h     JointMeas1D.h    Measurement2D.h
-EventManager.h  FitParticle.h  FitWeight.h      MeasurementBase.h
-InputHandler.h   Measurement1D.h GeneratorUtils.h StdHepEvt.h TemplateMeas1D.h
-InputUtils.h
+GlobalDialList.h
+FitWeight.h    
+WeightEngineBase.h
+NEUTWeightEngine.h
+NuWroWeightEngine.h
+GENIEWeightEngine.h
+WeightUtils.h
+SampleNormEngine.h
+LikelihoodWeightEngine.h
+SplineWeightEngine.h
+NUISANCESyst.h
+T2KWeightEngine.h
+NUISANCEWeightEngine.h
+NUISANCEWeightCalcs.h
+NIWGWeightEngine.h
 )
 
-set(LIBNAME FitBase)
+set(LIBNAME Reweight)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
+include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/Reweight/FitWeight.cxx b/src/Reweight/FitWeight.cxx
new file mode 100644
index 0000000..0ba834a
--- /dev/null
+++ b/src/Reweight/FitWeight.cxx
@@ -0,0 +1,235 @@
+#include "FitWeight.h"
+
+void FitWeight::AddRWEngine(int type) {
+
+	switch (type) {
+	case kNEUT:
+		fAllRW[type] = new NEUTWeightEngine("neutrw");
+		break;
+
+	case kNUWRO:
+		fAllRW[type] = new NuWroWeightEngine("nuwrorw");
+		break;
+
+	case kGENIE:
+		fAllRW[type] = new GENIEWeightEngine("genierw");
+		break;
+
+	case kNORM:
+		fAllRW[type] = new SampleNormEngine("normrw");
+		break;
+
+	case kLIKEWEIGHT:
+		fAllRW[type] = new LikelihoodWeightEngine("likerw");
+		break;
+
+	case kT2K:
+		fAllRW[type] = new T2KWeightEngine("t2krw");
+		break;
+
+	case kCUSTOM:
+		fAllRW[type] = new NUISANCEWeightEngine("nuisrw");
+		break;
+
+	case kSPLINEPARAMETER:
+		fAllRW[type] = new SplineWeightEngine("splinerw");
+		break;
+
+	case kNIWG:
+		fAllRW[type] = new NIWGWeightEngine("niwgrw");
+		break;
+	}
+
+}
+
+void FitWeight::IncludeDial(std::string name, std::string type, double val) {
+	// Should register the dial here.
+	int typeenum = Reweight::ConvDialType(type);
+	IncludeDial(name, typeenum, val);
+}
+
+void FitWeight::IncludeDial(std::string name, int dialtype, double val) {
+
+	// Get the dial enum
+	int nuisenum = Reweight::ConvDial(name, dialtype);
+
+	// Setup RW Engine Pointer
+	if (fAllRW.find(dialtype) == fAllRW.end()) {
+		AddRWEngine(dialtype);
+	}
+	WeightEngineBase* rw = fAllRW[dialtype];
+
+	// Include the dial
+	rw->IncludeDial(name, val);
+
+	// Set Dial Value
+	if (val != -9999.9) {
+		rw->SetDialValue(name, val);
+	}
+
+	// Sort Maps
+	fAllEnums[name]      = nuisenum;
+	fAllValues[nuisenum] = val;
+
+	// Sort Lists
+	fNameList.push_back(name);
+	fEnumList.push_back(nuisenum);
+	fValueList.push_back(val);
+}
+
+void FitWeight::Reconfigure(bool silent) {
+	// Reconfigure all added RW engines
+	for (std::map<int, WeightEngineBase*>::iterator iter = fAllRW.begin();
+	        iter != fAllRW.end(); iter++) {
+		(*iter).second->Reconfigure(silent);
+	}
+}
+
+void FitWeight::SetDialValue(std::string name, double val) {
+	int nuisenum = fAllEnums[name];
+	SetDialValue(nuisenum, val);
+}
+
+
+// Allow for name aswell using GlobalList to determine sample name.
+void FitWeight::SetDialValue(int nuisenum, double val) {
+	// Conv dial type
+	int dialtype = int(nuisenum - (nuisenum % 1000)) / 1000;
+
+	if (fAllRW.find(dialtype) == fAllRW.end()){
+		THROW("Cannot find RW Engine for dialtype = " << dialtype);
+	}
+
+	// Get RW Engine for this dial
+	fAllRW[dialtype]->SetDialValue(nuisenum, val);
+	fAllValues[nuisenum] = val;
+
+	// Update ValueList
+	for (size_t i = 0; i < fEnumList.size(); i++) {
+		if (fEnumList[i] == nuisenum) {
+			fValueList[i] = val;
+		}
+	}
+
+}
+
+void FitWeight::SetAllDials(const double* x, int n) {
+  for (size_t i = 0; i < (UInt_t)n; i++) {
+    int rwenum = fEnumList[i];
+    SetDialValue(rwenum, x[i]);
+  }
+  Reconfigure();
+}
+
+
+double FitWeight::GetDialValue(std::string name) {
+	int nuisenum = fAllEnums[name];
+	return GetDialValue(nuisenum);
+}
+
+double FitWeight::GetDialValue(int nuisenum) {
+	return fAllValues[nuisenum];
+}
+
+int FitWeight::GetDialPos(std::string name) {
+	int rwenum = fAllEnums[name];
+	return GetDialPos(rwenum);
+}
+
+int FitWeight::GetDialPos(int nuisenum) {
+	for (size_t i = 0; i < fEnumList.size(); i++) {
+		if (fEnumList[i] == nuisenum) {
+			return i;
+		}
+	}
+	ERR(FTL) << "No Dial Found! " << std::endl;
+	throw;
+	return -1;
+}
+
+bool FitWeight::DialIncluded(std::string name) {
+	return (fAllEnums.find(name) != fAllEnums.end());
+}
+
+bool FitWeight::DialIncluded(int rwenum) {
+	return (fAllValues.find(rwenum) != fAllValues.end());
+}
+
+
+double FitWeight::CalcWeight(BaseFitEvt* evt) {
+	double rwweight = 1.0;
+	for (std::map<int, WeightEngineBase*>::iterator iter = fAllRW.begin();
+	        iter != fAllRW.end(); iter++) {
+		double w = (*iter).second->CalcWeight(evt);
+		// LOG(FIT) << "Iter " << (*iter).second->fCalcName << " = " << w << std::endl;
+		rwweight *= w;
+	}
+	return rwweight;
+}
+
+
+void FitWeight::UpdateWeightEngine(const double* x) {
+	size_t count = 0;
+	for (std::vector<int>::iterator iter = fEnumList.begin();
+	        iter != fEnumList.end(); iter++) {
+		SetDialValue( (*iter), x[count] );
+		count++;
+	}
+}
+
+void FitWeight::GetAllDials(double* x, int n) {
+	for (int i = 0; i < n; i++) {
+		x[i] = GetDialValue( fEnumList[i] );
+	}
+}
+
+bool FitWeight::NeedsEventReWeight(const double* x) {
+	bool haschange = false;
+	size_t count = 0;
+
+	// Compare old to new and decide if RW needed.
+	for (std::vector<int>::iterator iter = fEnumList.begin();
+	        iter != fEnumList.end(); iter++) {
+
+		int nuisenum = (*iter);
+		int type = (nuisenum / 1000) - (nuisenum % 1000);
+
+		// Compare old to new
+		double oldval = GetDialValue(nuisenum);
+		double newval = x[count];
+		if (oldval != newval) {
+			if (fAllRW[type]->NeedsEventReWeight()) {
+				haschange = true;
+			}
+		}
+
+		count++;
+	}
+
+	return haschange;
+}
+
+double FitWeight::GetSampleNorm(std::string name) {
+	if (name.empty()) return 1.0;
+
+	// Find norm dial
+	if (fAllEnums.find(name) != fAllEnums.end()) {
+	  if (fAllValues.find(fAllEnums[name]) != fAllValues.end()){
+	    return fAllValues[ fAllEnums[name] ];
+	  } else {
+	    return 1.0;
+	  }
+	} else {
+	  return 1.0;
+	}
+}
+
+
+void FitWeight::Print() {
+
+	LOG(REC) << "Fit Weight State: " << std::endl;
+	for (size_t i = 0; i < fNameList.size(); i++) {
+		LOG(REC) << " -> Par " << i << ". " << fNameList[i] << " " << fValueList[i] << std::endl;
+	}
+}
+
diff --git a/src/Reweight/FitWeight.h b/src/Reweight/FitWeight.h
new file mode 100644
index 0000000..20ecde0
--- /dev/null
+++ b/src/Reweight/FitWeight.h
@@ -0,0 +1,72 @@
+#ifndef FITWEIGHT2_H
+#define FITWEIGHT2_H
+
+#include "WeightUtils.h"
+#include "WeightEngineBase.h"
+#include "NEUTWeightEngine.h"
+#include "GENIEWeightEngine.h"
+#include "NuWroWeightEngine.h"
+#include "SampleNormEngine.h"
+#include "LikelihoodWeightEngine.h"
+#include "SplineWeightEngine.h"
+#include "NUISANCEWeightEngine.h"
+#include "T2KWeightEngine.h"
+#include "NIWGWeightEngine.h"
+
+#include <map>
+#include <vector>
+
+class FitWeight {
+public:
+  FitWeight(std::string name = "") {};
+
+  // Add a new RW engine given type
+  void AddRWEngine(int rwtype);
+
+  // Includes
+  void IncludeDial(std::string name, std::string type, double val = -9999.9);
+  void IncludeDial(std::string name, int type, double val = -9999.9);
+
+  // Update RW Engines
+  void Reconfigure(bool silent = false);
+
+  void SetDialValue(std::string name, double val);
+  void SetDialValue(int rwenum, double val);
+
+  double GetDialValue(std::string name);
+  double GetDialValue(int rwenum);
+  
+  int GetDialPos(std::string name);
+  int GetDialPos(int rwenum);
+
+  bool DialIncluded(std::string name);
+  bool DialIncluded(int rwenum);
+
+  double CalcWeight(BaseFitEvt* evt);
+  bool HasRWDialChanged(const double* x) { return true; };
+  bool NeedsEventReWeight(const double* x);
+
+  void SetAllDials(const double* x, int n);
+
+  double GetSampleNorm(std::string name);
+
+  void UpdateWeightEngine(const double* x);
+
+  inline std::vector<int> GetDialEnums() { return fEnumList; };
+  inline std::vector<std::string> GetDialNames() { return fNameList; };
+  inline std::vector<double> GetDialValues() { return fValueList; };
+  void GetAllDials(double* x, int n);
+
+  void Print();
+
+  std::vector<int> fEnumList;
+  std::vector<std::string> fNameList;
+  std::vector<double> fValueList;
+
+  std::map<std::string, int> fAllEnums;
+  std::map<int, double> fAllValues;
+  std::map<int, WeightEngineBase*> fAllRW;
+
+};
+
+#endif
diff --git a/src/Reweight/GENIEWeightEngine.cxx b/src/Reweight/GENIEWeightEngine.cxx
new file mode 100644
index 0000000..2a2e73f
--- /dev/null
+++ b/src/Reweight/GENIEWeightEngine.cxx
@@ -0,0 +1,178 @@
+#include "GENIEWeightEngine.h"
+
+GENIEWeightEngine::GENIEWeightEngine(std::string name) {
+#ifdef __GENIE_ENABLED__
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up GENIE RW : " << fCalcName << std::endl;
+
+	// Create RW Engine suppressing cout
+	StopTalking();
+	fGenieRW = new genie::rew::GReWeight();
+
+	// Get List of Vetos (Just for debugging)
+	std::string rw_engine_list = FitPar::Config().GetParS("FitWeight.fGenieRW_veto");
+	bool xsec_ncel = rw_engine_list.find("xsec_ncel") == std::string::npos;
+	bool xsec_ccqe = rw_engine_list.find("xsec_ccqe") == std::string::npos;
+	bool xsec_coh = rw_engine_list.find("xsec_coh") == std::string::npos;
+	bool xsec_nnres = rw_engine_list.find("xsec_nonresbkg") == std::string::npos;
+	bool xsec_nudis = rw_engine_list.find("nuclear_dis") == std::string::npos;
+	bool xsec_resdec = rw_engine_list.find("hadro_res_decay") == std::string::npos;
+	bool xsec_fzone = rw_engine_list.find("hadro_intranuke") == std::string::npos;
+	bool xsec_intra = rw_engine_list.find("hadro_fzone") == std::string::npos;
+	bool xsec_agky = rw_engine_list.find("hadro_agky") == std::string::npos;
+	bool xsec_qevec = rw_engine_list.find("xsec_ccqe_vec") == std::string::npos;
+	bool xsec_dis = rw_engine_list.find("xsec_dis") == std::string::npos;
+	bool xsec_nc = rw_engine_list.find("xsec_nc") == std::string::npos;
+	bool xsec_ccres = rw_engine_list.find("xsec_ccres") == std::string::npos;
+	bool xsec_ncres = rw_engine_list.find("xsec_ncres") == std::string::npos;
+	bool xsec_nucqe = rw_engine_list.find("nuclear_qe") == std::string::npos;
+
+	// Now actually add the RW Calcs
+	if (xsec_ncel)
+		fGenieRW->AdoptWghtCalc("xsec_ncel", new genie::rew::GReWeightNuXSecNCEL);
+	if (xsec_ccqe)
+		fGenieRW->AdoptWghtCalc("xsec_ccqe", new genie::rew::GReWeightNuXSecCCQE);
+	if (xsec_coh)
+		fGenieRW->AdoptWghtCalc("xsec_coh", new genie::rew::GReWeightNuXSecCOH);
+	if (xsec_nnres)
+		fGenieRW->AdoptWghtCalc("xsec_nonresbkg",
+		                        new genie::rew::GReWeightNonResonanceBkg);
+	if (xsec_nudis)
+		fGenieRW->AdoptWghtCalc("nuclear_dis", new genie::rew::GReWeightDISNuclMod);
+	if (xsec_resdec)
+		fGenieRW->AdoptWghtCalc("hadro_res_decay",
+		                        new genie::rew::GReWeightResonanceDecay);
+	if (xsec_fzone)
+		fGenieRW->AdoptWghtCalc("hadro_fzone", new genie::rew::GReWeightFZone);
+	if (xsec_intra)
+		fGenieRW->AdoptWghtCalc("hadro_intranuke", new genie::rew::GReWeightINuke);
+	if (xsec_agky)
+		fGenieRW->AdoptWghtCalc("hadro_agky", new genie::rew::GReWeightAGKY);
+	if (xsec_qevec)
+		fGenieRW->AdoptWghtCalc("xsec_ccqe_vec",
+		                        new genie::rew::GReWeightNuXSecCCQEvec);
+	if (xsec_dis)
+		fGenieRW->AdoptWghtCalc("xsec_dis", new genie::rew::GReWeightNuXSecDIS);
+	if (xsec_nc)
+		fGenieRW->AdoptWghtCalc("xsec_nc", new genie::rew::GReWeightNuXSecNC);
+	if (xsec_ccres)
+		fGenieRW->AdoptWghtCalc("xsec_ccres", new genie::rew::GReWeightNuXSecCCRES);
+	if (xsec_ncres)
+		fGenieRW->AdoptWghtCalc("xsec_ncres", new genie::rew::GReWeightNuXSecNCRES);
+	if (xsec_nucqe)
+		fGenieRW->AdoptWghtCalc("nuclear_qe", new genie::rew::GReWeightFGM);
+
+
+	GReWeightNuXSecCCQE * rwccqe =
+	    dynamic_cast<GReWeightNuXSecCCQE *> (fGenieRW->WghtCalc("xsec_ccqe"));
+	rwccqe->SetMode(GReWeightNuXSecCCQE::kModeMa);
+
+	// Default to include shape and normalization changes for CCRES (can be changed downstream if desired)
+	GReWeightNuXSecCCRES * rwccres =
+	    dynamic_cast<GReWeightNuXSecCCRES *> (fGenieRW->WghtCalc("xsec_ccres"));
+	rwccres->SetMode(GReWeightNuXSecCCRES::kModeMaMv);
+
+	// Default to include shape and normalization changes for NCRES (can be changed downstream if desired)
+	GReWeightNuXSecNCRES * rwncres =
+	    dynamic_cast<GReWeightNuXSecNCRES *> (fGenieRW->WghtCalc("xsec_ncres"));
+	rwncres->SetMode(GReWeightNuXSecNCRES::kModeMaMv);
+
+	// Default to include shape and normalization changes for DIS (can be changed downstream if desired)
+	GReWeightNuXSecDIS * rwdis =
+	    dynamic_cast<GReWeightNuXSecDIS *> (fGenieRW->WghtCalc("xsec_dis"));
+	rwdis->SetMode(GReWeightNuXSecDIS::kModeABCV12u);
+
+	// Final Reconfigure
+	fGenieRW->Reconfigure();
+
+	// Set Abs Twk Config
+	fIsAbsTwk = (FitPar::Config().GetParB("setabstwk"));
+
+	// allow cout again
+	StartTalking();
+
+#else
+	ERR(FTL) << "GENIE RW NOT ENABLED" << std::endl;
+#endif
+};
+
+
+void GENIEWeightEngine::IncludeDial(int nuisenum, double startval) {
+#ifdef __GENIE_ENABLED__
+
+	// Get RW Enum and name
+	int rwenum = (nuisenum % 1000);
+	genie::rew::GSyst_t rwsyst = static_cast<genie::rew::GSyst_t>(rwenum);
+	std::string name = GSyst::AsString(rwsyst);
+
+	// Fill Maps
+	fGenieNameSysts[name]     = rwsyst;
+	fGenieEnumSysts[nuisenum] = rwsyst;
+
+	// Initialize dial
+	fGenieRW->Systematics().Init( fGenieEnumSysts[nuisenum] );
+
+	// If Absolute
+	if (fIsAbsTwk) {
+		GSystUncertainty::Instance()->SetUncertainty( fGenieEnumSysts[nuisenum], 1.0, 1.0 );
+	}
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(nuisenum, startval);
+	}
+
+#endif
+};
+
+
+void GENIEWeightEngine::SetDialValue(int nuisenum, double val) {
+#ifdef __GENIE_ENABLED__
+	// Set RW engine values
+	int rwenum = (nuisenum % 1000);
+	fGenieRW->Systematics().Set(static_cast<genie::rew::GSyst_t>(rwenum), val);
+#endif
+}
+
+
+void GENIEWeightEngine::Reconfigure(bool silent) {
+#ifdef __GENIE_ENABLED__
+	// Hush now...
+	if (silent) StopTalking();
+
+	// Reconf
+	fGenieRW->Reconfigure();
+
+	// Shout again
+	if (silent) StartTalking();
+#endif
+}
+
+
+double GENIEWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+	
+#ifdef __GENIE_ENABLED__
+	// Skip Non GENIE
+	if (evt->fType != kGENIE) return 1.0;
+
+	// Make nom weight
+	rw_weight = fGenieRW->CalcWeight(*(evt->genie_event->event));
+	//	std::cout << "Returning GENIE Weight for electron scattering = " << rw_weight << std::endl;
+#endif
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/GENIEWeightEngine.h b/src/Reweight/GENIEWeightEngine.h
new file mode 100644
index 0000000..2211a68
--- /dev/null
+++ b/src/Reweight/GENIEWeightEngine.h
@@ -0,0 +1,58 @@
+#ifndef WEIGHT_ENGINE_GENIE_H
+#define WEIGHT_ENGINE_GENIE_H
+
+#include "FitLogger.h"
+
+
+#ifdef __GENIE_ENABLED__
+#include "EVGCore/EventRecord.h"
+#include "EVGCore/EventRecord.h"
+#include "GHEP/GHepRecord.h"
+#include "GSyst.h"
+#include "GSystUncertainty.h"
+#include "Ntuple/NtpMCEventRecord.h"
+#include "ReWeight/GReWeight.h"
+#include "ReWeight/GReWeightAGKY.h"
+#include "ReWeight/GReWeightDISNuclMod.h"
+#include "ReWeight/GReWeightFGM.h"
+#include "ReWeight/GReWeightFZone.h"
+#include "ReWeight/GReWeightINuke.h"
+#include "ReWeight/GReWeightNonResonanceBkg.h"
+#include "ReWeight/GReWeightNuXSecCCQE.h"
+#include "ReWeight/GReWeightNuXSecCCQEvec.h"
+#include "ReWeight/GReWeightNuXSecCCRES.h"
+#include "ReWeight/GReWeightNuXSecCOH.h"
+#include "ReWeight/GReWeightNuXSecDIS.h"
+#include "ReWeight/GReWeightNuXSecNC.h"
+#include "ReWeight/GReWeightNuXSecNCEL.h"
+#include "ReWeight/GReWeightNuXSecNCRES.h"
+#include "ReWeight/GReWeightResonanceDecay.h"
+using namespace genie;
+using namespace genie::rew;
+#endif
+
+
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "FitWeight.h"
+
+class GENIEWeightEngine : public WeightEngineBase {
+public:
+	GENIEWeightEngine(std::string name);
+	~GENIEWeightEngine() {};
+
+	void IncludeDial(int nuisenum, double startval);
+	void SetDialValue(int rwenum, double val);
+	void Reconfigure(bool silent = false);
+	double CalcWeight(BaseFitEvt* evt);
+	inline bool NeedsEventReWeight() { return true; };
+
+#ifdef __GENIE_ENABLED__
+	std::map<std::string, genie::rew::GSyst_t> fGenieNameSysts;
+	std::map<int, genie::rew::GSyst_t> fGenieEnumSysts;
+	genie::rew::GReWeight* fGenieRW;  //!< Genie RW Object
+#endif
+
+};
+
+#endif
diff --git a/src/Reweight/GlobalDialList.cxx b/src/Reweight/GlobalDialList.cxx
new file mode 100644
index 0000000..a3ef8f6
--- /dev/null
+++ b/src/Reweight/GlobalDialList.cxx
@@ -0,0 +1,56 @@
+#include "GlobalDialList.h"
+
+int GlobalDialList::EnumFromNameAndType(std::string name, int type){
+
+  // Setup Type Container
+  if (fTypeEnumCont.find(type) == fTypeEnumCont.end()){
+    std::map<std::string, int> temp;
+    temp[name] = 0;
+
+    fTypeEnumCont[type] = temp;
+  }
+
+  // Get Type Container
+  std::map<std::string, int> enumcont = fTypeEnumCont[type];
+  //  LOG(FIT) << "Getting Enum From name and type " << name << " " << type << std::endl;
+
+  // Check name is in container, if its not add it
+  if (enumcont.find(name) == enumcont.end()){
+    //    LOG(FIT) << " Name not found in Enum type " << type << std::endl;
+    int index = enumcont.size();
+    enumcont[name] = index;
+    //    LOG(FIT) << "Returning new index of " << index << std::endl;
+    fTypeEnumCont[type][name] = index;
+    return index;
+  }
+
+  return enumcont[name];
+}
+
+void GlobalDialList::RegisterDialEnum(std::string name, int type, int nuisenum){
+
+  if (std::find(fAllDialNames.begin(), fAllDialNames.end(), name) != fAllDialNames.end()){
+    return;
+  }
+
+  LOG(FIT) << "Registed Dial Enum : " << name << " " << type << " " << nuisenum << std::endl;
+  fAllDialNames.push_back(name);
+  fAllDialTypes.push_back(type);
+  fAllDialEnums.push_back(nuisenum);
+}
+
+
+
+
+/// Singleton functions
+GlobalDialList& Reweight::DialList(){
+  return GlobalDialList::Get();
+}
+
+GlobalDialList* GlobalDialList::m_diallistInstance = NULL;
+
+GlobalDialList& GlobalDialList::Get(void){
+  if (!m_diallistInstance) m_diallistInstance = new GlobalDialList;
+  return *m_diallistInstance;
+}
+
diff --git a/src/Reweight/GlobalDialList.h b/src/Reweight/GlobalDialList.h
new file mode 100644
index 0000000..c3409d9
--- /dev/null
+++ b/src/Reweight/GlobalDialList.h
@@ -0,0 +1,31 @@
+#ifndef GLOBAL_DIAL_LIST_H
+#define GLOBAL_DIAL_LIST_H
+#include "WeightUtils.h"
+
+class GlobalDialList {
+ public:
+
+  static GlobalDialList& Get(void);
+
+  /// Constructor \n
+  GlobalDialList(){};
+  virtual ~GlobalDialList(){};
+
+  int EnumFromNameAndType(std::string name, int type);
+  void RegisterDialEnum(std::string name, int type, int nuisenum);
+
+
+  std::vector<std::string> fAllDialNames;
+  std::vector<int> fAllDialTypes;
+  std::vector<int> fAllDialEnums;
+
+  std::map<int, std::map<std::string, int> > fTypeEnumCont;
+
+ protected:
+  static GlobalDialList* m_diallistInstance;
+};
+
+namespace Reweight {
+  GlobalDialList& DialList();
+}
+#endif
diff --git a/src/Reweight/LikelihoodWeightEngine.cxx b/src/Reweight/LikelihoodWeightEngine.cxx
new file mode 100644
index 0000000..4640f38
--- /dev/null
+++ b/src/Reweight/LikelihoodWeightEngine.cxx
@@ -0,0 +1,58 @@
+#include "LikelihoodWeightEngine.h"
+
+LikelihoodWeightEngine::LikelihoodWeightEngine(std::string name) {
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up Likelihood Weight RW : " << fCalcName << std::endl;
+
+	// Set Abs Twk Config
+	fIsAbsTwk = true;
+
+};
+
+
+void LikelihoodWeightEngine::IncludeDial(std::string name, double startval) {
+
+	// Get NUISANCE Enum
+	int nuisenum = Reweight::ConvDial(name, kNORM);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(1.0);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(name, startval);
+	}
+};
+
+
+void LikelihoodWeightEngine::SetDialValue(int nuisenum, double val) {
+	fValues[fEnumIndex[nuisenum]] = val;
+}
+
+void LikelihoodWeightEngine::SetDialValue(std::string name, double val){
+	fValues[fNameIndex[name]] = val;
+}
+
+void LikelihoodWeightEngine::Reconfigure(bool silent) {
+	// Empty placeholder incase we want print statements...
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/LikelihoodWeightEngine.h b/src/Reweight/LikelihoodWeightEngine.h
new file mode 100644
index 0000000..8ae8917
--- /dev/null
+++ b/src/Reweight/LikelihoodWeightEngine.h
@@ -0,0 +1,25 @@
+#ifndef LikelihoodWeightEngine_H
+#define LikelihoodWeightEngine_H
+
+#include "FitLogger.h"
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+
+// Could probably just make a general weight engine for stuff like this...
+
+class LikelihoodWeightEngine : public WeightEngineBase {
+	public:
+		LikelihoodWeightEngine(std::string name);
+		~LikelihoodWeightEngine(){};
+
+		void IncludeDial(std::string name, double startval);
+				void SetDialValue(std::string name, double val);
+
+		void SetDialValue(int rwenum, double val);
+		void Reconfigure(bool silent = false);
+		inline double CalcWeight(BaseFitEvt* evt) {return 1.0;};
+		inline bool NeedsEventReWeight(){ return false; };
+
+};
+
+#endif
diff --git a/src/Reweight/NEUTWeightEngine.cxx b/src/Reweight/NEUTWeightEngine.cxx
new file mode 100644
index 0000000..644a93b
--- /dev/null
+++ b/src/Reweight/NEUTWeightEngine.cxx
@@ -0,0 +1,155 @@
+#include "NEUTWeightEngine.h"
+
+NEUTWeightEngine::NEUTWeightEngine(std::string name) {
+#ifdef __NEUT_ENABLED__
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up NEUT RW : " << fCalcName << std::endl;
+
+	// Create RW Engine suppressing cout
+	StopTalking();
+	fNeutRW = new neut::rew::NReWeight();
+	TDirectory* olddir = gDirectory;
+
+	// get list of vetoed calc engines (just for debug really)
+	std::string rw_engine_list = FitPar::Config().GetParS("FitWeight.fNeutRW_veto");
+	bool xsec_ccqe = rw_engine_list.find("xsec_ccqe") == std::string::npos;
+	bool xsec_res = rw_engine_list.find("xsec_res") == std::string::npos;
+	bool xsec_ccres = rw_engine_list.find("xsec_ccres") == std::string::npos;
+	bool xsec_coh = rw_engine_list.find("xsec_coh") == std::string::npos;
+	bool xsec_dis = rw_engine_list.find("xsec_dis") == std::string::npos;
+	bool xsec_ncel = rw_engine_list.find("xsec_ncel") == std::string::npos;
+	bool xsec_nc = rw_engine_list.find("xsec_nc") == std::string::npos;
+	bool xsec_ncres = rw_engine_list.find("xsec_ncres") == std::string::npos;
+	bool nucl_casc = rw_engine_list.find("nucl_casc") == std::string::npos;
+	bool nucl_piless = rw_engine_list.find("nucl_piless") == std::string::npos;
+
+	// Activate each calc engine
+	if (xsec_ccqe)
+		fNeutRW->AdoptWghtCalc("xsec_ccqe", new neut::rew::NReWeightNuXSecCCQE);
+	if (xsec_res)
+		fNeutRW->AdoptWghtCalc("xsec_res", new neut::rew::NReWeightNuXSecRES);
+	if (xsec_ccres)
+		fNeutRW->AdoptWghtCalc("xsec_ccres", new neut::rew::NReWeightNuXSecCCRES);
+	if (xsec_coh)
+		fNeutRW->AdoptWghtCalc("xsec_coh", new neut::rew::NReWeightNuXSecCOH);
+	if (xsec_dis)
+		fNeutRW->AdoptWghtCalc("xsec_dis", new neut::rew::NReWeightNuXSecDIS);
+	if (xsec_ncel)
+		fNeutRW->AdoptWghtCalc("xsec_ncel", new neut::rew::NReWeightNuXSecNCEL);
+	if (xsec_nc)
+		fNeutRW->AdoptWghtCalc("xsec_nc", new neut::rew::NReWeightNuXSecNC);
+	if (xsec_ncres)
+		fNeutRW->AdoptWghtCalc("xsec_ncres", new neut::rew::NReWeightNuXSecNCRES);
+	if (nucl_casc)
+		fNeutRW->AdoptWghtCalc("nucl_casc", new neut::rew::NReWeightCasc);
+	if (nucl_piless)
+		fNeutRW->AdoptWghtCalc("nucl_piless", new neut::rew::NReWeightNuclPiless);
+	fNeutRW->Reconfigure();
+	olddir->cd();
+
+	// Set Abs Twk Config
+	fIsAbsTwk = (FitPar::Config().GetParB("setabstwk"));
+
+	// allow cout again
+	StartTalking();
+
+#else
+	THROW("NEUT RW NOT ENABLED!" );
+#endif
+
+};
+
+void NEUTWeightEngine::IncludeDial(std::string name, double startval) {
+#ifdef __NEUT_ENABLED__
+
+	// Get NEUT Syst.
+	neut::rew::NSyst_t gensyst = NSyst::FromString(name);
+	int nuisenum = Reweight::ConvDial(name, kNEUT);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(0.0);
+	fNEUTSysts.push_back(gensyst);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Initialize dial
+	fNeutRW->Systematics().Init( fNEUTSysts[index] );
+
+	// If Absolute
+	if (fIsAbsTwk) {
+		NSystUncertainty::Instance()->SetUncertainty( fNEUTSysts[index], 1.0, 1.0 );
+	}
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(nuisenum, startval);
+	}
+#endif
+}
+
+void NEUTWeightEngine::SetDialValue(int nuisenum, double val) {
+#ifdef __NEUT_ENABLED__
+	fValues[fEnumIndex[nuisenum]] = val;
+	fNeutRW->Systematics().Set(fNEUTSysts[fEnumIndex[nuisenum]], val);
+#endif
+}
+
+void NEUTWeightEngine::SetDialValue(std::string name, double val) {
+#ifdef __NEUT_ENABLED__
+	fValues[fNameIndex[name]] = val;
+	fNeutRW->Systematics().Set(fNEUTSysts[fNameIndex[name]], val);
+#endif
+}
+
+
+void NEUTWeightEngine::Reconfigure(bool silent) {
+#ifdef __NEUT_ENABLED__
+	// Hush now...
+	if (silent) StopTalking();
+
+	// Reconf
+	fNeutRW->Reconfigure();
+
+	// Shout again
+	if (silent) StartTalking();
+#endif
+}
+
+
+double NEUTWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+
+#ifdef __NEUT_ENABLED__
+	// Skip Non GENIE
+	if (evt->fType != kNEUT) return 1.0;
+
+	// Hush now
+	StopTalking();
+
+	// Fill NEUT Common blocks
+	NEUTUtils::FillNeutCommons(evt->fNeutVect);
+
+	// Call Weight calculation
+	rw_weight = fNeutRW->CalcWeight();
+
+	// Speak Now
+	StartTalking();
+#endif
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/NEUTWeightEngine.h b/src/Reweight/NEUTWeightEngine.h
new file mode 100644
index 0000000..a4ad648
--- /dev/null
+++ b/src/Reweight/NEUTWeightEngine.h
@@ -0,0 +1,53 @@
+#ifndef WEIGHT_ENGINE_NEUT_H
+#define WEIGHT_ENGINE_NEUT_H
+
+#include "FitLogger.h"
+
+#ifdef __NEUT_ENABLED__
+#include "NReWeight.h"
+#include "NReWeightCasc.h"
+#include "NReWeightNuXSecCCQE.h"
+#include "NReWeightNuXSecCCRES.h"
+#include "NReWeightNuXSecCOH.h"
+#include "NReWeightNuXSecDIS.h"
+#include "NReWeightNuXSecNC.h"
+#include "NReWeightNuXSecNCEL.h"
+#include "NReWeightNuXSecNCRES.h"
+#include "NReWeightNuXSecRES.h"
+#include "NReWeightNuclPiless.h"
+#include "NSyst.h"
+#include "NSystUncertainty.h"
+#include "neutpart.h"
+#include "neutvect.h"
+#include "NEUTInputHandler.h"
+#endif
+
+
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "FitWeight.h"
+
+class NEUTWeightEngine : public WeightEngineBase {
+public:
+	NEUTWeightEngine(std::string name);
+	~NEUTWeightEngine() {};
+
+	void IncludeDial(std::string name, double startval);
+
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int nuisenum, double val);
+
+	void Reconfigure(bool silent = false);
+
+	double CalcWeight(BaseFitEvt* evt);
+
+	inline bool NeedsEventReWeight() { return true; };
+
+
+#ifdef __NEUT_ENABLED__
+	std::vector<neut::rew::NSyst_t> fNEUTSysts;
+	neut::rew::NReWeight* fNeutRW;
+#endif
+};
+
+#endif
diff --git a/src/Reweight/NIWGWeightEngine.cxx b/src/Reweight/NIWGWeightEngine.cxx
new file mode 100644
index 0000000..bdce7ae
--- /dev/null
+++ b/src/Reweight/NIWGWeightEngine.cxx
@@ -0,0 +1,158 @@
+#include "NEUTWeightEngine.h"
+
+NIWGWeightEngine::NIWGWeightEngine(std::string name) {
+#ifdef __NIWG_ENABLED__
+#ifdef __NEUT_ENABLED__
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up NIWG RW : " << fCalcName << std::endl;
+
+	// Create RW Engine suppressing cout
+	StopTalking();
+	fNIWGRW = new niwg::rew::NIWGReWeight();
+
+	// Get List of Veto Calcs (For Debugging)
+	std::string rw_engine_list =
+	    FitPar::Config().GetParS("FitWeight.fNIWGRW_veto");
+	bool niwg_2012a = rw_engine_list.find("niwg_2012a") == std::string::npos;
+	bool niwg_2014a = rw_engine_list.find("niwg_2014a") == std::string::npos;
+	bool niwg_pimult = rw_engine_list.find("niwg_pimult") == std::string::npos;
+	bool niwg_mec = rw_engine_list.find("niwg_mec") == std::string::npos;
+	bool niwg_rpa = rw_engine_list.find("niwg_rpa") == std::string::npos;
+	bool niwg_eff_rpa = rw_engine_list.find("niwg_eff_rpa") == std::string::npos;
+	bool niwg_proton =
+	    rw_engine_list.find("niwg_protonFSIbug") == std::string::npos;
+	bool niwg_hadron =
+	    rw_engine_list.find("niwg_HadronMultSwitch") == std::string::npos;
+
+	// Add the RW Calcs
+	if (niwg_2012a)
+		fNIWGRW->AdoptWghtCalc("niwg_2012a", new niwg::rew::NIWGReWeight2012a);
+	if (niwg_2014a)
+		fNIWGRW->AdoptWghtCalc("niwg_2014a", new niwg::rew::NIWGReWeight2014a);
+	if (niwg_pimult)
+		fNIWGRW->AdoptWghtCalc("niwg_pimult", new niwg::rew::NIWGReWeightPiMult);
+	if (niwg_mec)
+		fNIWGRW->AdoptWghtCalc("niwg_mec", new niwg::rew::NIWGReWeightMEC);
+	if (niwg_rpa)
+		fNIWGRW->AdoptWghtCalc("niwg_rpa", new niwg::rew::NIWGReWeightRPA);
+	if (niwg_eff_rpa)
+		fNIWGRW->AdoptWghtCalc("niwg_eff_rpa",
+		                       new niwg::rew::NIWGReWeightEffectiveRPA);
+	if (niwg_proton)
+		fNIWGRW->AdoptWghtCalc("niwg_protonFSIbug",
+		                       new niwg::rew::NIWGReWeightProtonFSIbug);
+	if (niwg_hadron)
+		fNIWGRW->AdoptWghtCalc("niwg_HadronMultSwitch",
+		                       new niwg::rew::NIWGReWeightHadronMultSwitch);
+
+	fNIWGRW->Reconfigure();
+
+	// Set Abs Twk Config
+	fIsAbsTwk = (FitPar::Config().GetParB("setabstwk"));
+
+	// allow cout again
+	StartTalking();
+#else
+	ERR(FTL) << "NIWG RW Enabled but NEUT RW is not!" << std::endl;
+#endif
+#else
+	ERR(FTL) << "NIWG RW NOT ENABLED!" << std::endl;
+#endif
+
+};
+
+void NIWGWeightEngine::IncludeDial(std::string name, double startval) {
+#ifdef __NIWG_ENABLED__
+
+	// Get NEUT Syst.
+	niwg::rew::NIWGSyst_t gensyst = niwg::rew::NIWGSyst::FromString(name);
+	int nuisenum = Reweight::ConvDial(name, kNIWG);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(0.0);
+	fNIWGSysts.push_back(gensyst);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Initialize dial
+	fNIWGRW->Systematics().Init( fNIWGSysts[index] );
+
+	// If Absolute
+	if (fIsAbsTwk) {
+		niwg::rew::NIWGSystUncertainty::Instance()->SetUncertainty( fNIWGSysts[index], 1.0, 1.0 );
+	}
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(nuisenum, startval);
+	}
+#endif
+}
+
+void NIWGWeightEngine::SetDialValue(int nuisenum, double val) {
+#ifdef __NIWG_ENABLED__
+	fValues[fEnumIndex[nuisenum]] = val;
+	fNIWGRW->Systematics().Set(fNIWGSysts[fEnumIndex[nuisenum]], val);
+#endif
+}
+
+void NIWGWeightEngine::SetDialValue(std::string name, double val) {
+#ifdef __NIWG_ENABLED__
+	fValues[fNameIndex[name]] = val;
+	fNIWGRW->Systematics().Set(fNIWGSysts[fNameIndex[name]], val);
+#endif
+}
+
+
+void NIWGWeightEngine::Reconfigure(bool silent) {
+#ifdef __NIWG_ENABLED__
+	// Hush now...
+	if (silent) StopTalking();
+
+	// Reconf
+	fNIWGRW->Reconfigure();
+
+	// Shout again
+	if (silent) StartTalking();
+#endif
+}
+
+
+double NIWGWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+
+#ifdef __NEUT_ENABLED__
+#ifdef __NIWG_ENABLED__
+
+	// Skip Non GENIE
+	if (evt->fType != kNEUT) return 1.0;
+
+	// Hush now
+	StopTalking();
+
+	niwg::rew::NIWGEvent* niwg_event = GeneratorUtils::GetNIWGEvent(evt->fNeutVect);
+	rw_weight *= fNIWGRW->CalcWeight(*niwg_event);
+	delete niwg_event;
+
+	// Speak Now
+	StartTalking();
+
+#endif
+#endif
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/NIWGWeightEngine.h b/src/Reweight/NIWGWeightEngine.h
new file mode 100644
index 0000000..8703b34
--- /dev/null
+++ b/src/Reweight/NIWGWeightEngine.h
@@ -0,0 +1,52 @@
+#ifndef WEIGHT_ENGINE_NIWG_H
+#define WEIGHT_ENGINE_NIWG_H
+
+#ifdef __NIWG_ENABLED__
+#include "NIWGReWeight.h"
+#include "NIWGReWeight1piAngle.h"
+#include "NIWGReWeight2010a.h"
+#include "NIWGReWeight2012a.h"
+#include "NIWGReWeight2014a.h"
+#include "NIWGReWeightDeltaMass.h"
+#include "NIWGReWeightEffectiveRPA.h"
+#include "NIWGReWeightHadronMultSwitch.h"
+#include "NIWGReWeightMEC.h"
+#include "NIWGReWeightPiMult.h"
+#include "NIWGReWeightProtonFSIbug.h"
+#include "NIWGReWeightRPA.h"
+#include "NIWGReWeightSpectralFunc.h"
+#include "NIWGReWeightSplineEnu.h"
+#include "NIWGSyst.h"
+#include "NIWGSystUncertainty.h"
+#endif
+
+#include "FitLogger.h"
+
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "FitWeight.h"
+
+class NIWGWeightEngine : public WeightEngineBase {
+public:
+	NIWGWeightEngine(std::string name);
+	~NIWGWeightEngine() {};
+
+	void IncludeDial(std::string name, double startval);
+
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int nuisenum, double val);
+
+	void Reconfigure(bool silent = false);
+
+	double CalcWeight(BaseFitEvt* evt);
+
+	inline bool NeedsEventReWeight() { return true; };
+
+
+#ifdef __NIWG_ENABLED__
+	std::vector<niwg::rew::NIWGSyst_t> fNIWGSysts;
+	niwg::rew::NIWGReWeight* fNIWGRW;
+#endif
+};
+
+#endif
diff --git a/src/Reweight/NUISANCESyst.cxx b/src/Reweight/NUISANCESyst.cxx
new file mode 100644
index 0000000..c279f67
--- /dev/null
+++ b/src/Reweight/NUISANCESyst.cxx
@@ -0,0 +1,51 @@
+#include "NUISANCESyst.h"
+
+int Reweight::ConvertNUISANCEDial(std::string type) {
+
+	for (int i = kUnkownNUISANCEDial + 1; i < kNUISANCEDial_LAST; i++) {
+		if (!type.compare(ConvNUISANCEDial(i).c_str())) {
+			return i;
+		}
+	}
+	return kUnkownNUISANCEDial;
+};
+
+std::string Reweight::ConvNUISANCEDial(int type) {
+
+	switch (type) {
+	case kGaussianCorr_CCQE_norm:             { return "GaussianCorr_CCQE_norm";  }
+	case kGaussianCorr_CCQE_tilt:             { return "GaussianCorr_CCQE_tilt";   }
+	case kGaussianCorr_CCQE_Pq0:              { return "GaussianCorr_CCQE_Pq0";   }
+	case kGaussianCorr_CCQE_Wq0:              { return "GaussianCorr_CCQE_Wq0";   }
+	case kGaussianCorr_CCQE_Pq3:              { return "GaussianCorr_CCQE_Pq3";   }
+	case kGaussianCorr_CCQE_Wq3:              { return "GaussianCorr_CCQE_Wq3";   }
+	case kGaussianCorr_2p2h_norm:             { return "GaussianCorr_2p2h_norm";  }
+	case kGaussianCorr_2p2h_tilt:             { return "GaussianCorr_2p2h_tilt";   }
+	case kGaussianCorr_2p2h_Pq0:              { return "GaussianCorr_2p2h_Pq0";   }
+	case kGaussianCorr_2p2h_Wq0:              { return "GaussianCorr_2p2h_Wq0";   }
+	case kGaussianCorr_2p2h_Pq3:              { return "GaussianCorr_2p2h_Pq3";   }
+	case kGaussianCorr_2p2h_Wq3:              { return "GaussianCorr_2p2h_Wq3";   }
+	case kGaussianCorr_2p2h_PPandNN_norm:     { return "GaussianCorr_2p2h_PPandNN_norm";  }
+	case kGaussianCorr_2p2h_PPandNN_tilt:     { return "GaussianCorr_2p2h_PPandNN_tilt";   }
+	case kGaussianCorr_2p2h_PPandNN_Pq0:      { return "GaussianCorr_2p2h_PPandNN_Pq0";   }
+	case kGaussianCorr_2p2h_PPandNN_Wq0:      { return "GaussianCorr_2p2h_PPandNN_Wq0";   }
+	case kGaussianCorr_2p2h_PPandNN_Pq3:      { return "GaussianCorr_2p2h_PPandNN_Pq3";   }
+	case kGaussianCorr_2p2h_PPandNN_Wq3:      { return "GaussianCorr_2p2h_PPandNN_Wq3";   }
+	case kGaussianCorr_2p2h_NP_norm:          { return "GaussianCorr_2p2h_NP_norm";  }
+	case kGaussianCorr_2p2h_NP_tilt:          { return "GaussianCorr_2p2h_NP_tilt";   }
+	case kGaussianCorr_2p2h_NP_Pq0:           { return "GaussianCorr_2p2h_NP_Pq0";   }
+	case kGaussianCorr_2p2h_NP_Wq0:           { return "GaussianCorr_2p2h_NP_Wq0";   }
+	case kGaussianCorr_2p2h_NP_Pq3:           { return "GaussianCorr_2p2h_NP_Pq3";   }
+	case kGaussianCorr_2p2h_NP_Wq3:           { return "GaussianCorr_2p2h_NP_Wq3";   }
+	case kGaussianCorr_CC1pi_norm:            { return "GaussianCorr_CC1pi_norm";  }
+	case kGaussianCorr_CC1pi_tilt:            { return "GaussianCorr_CC1pi_tilt";   }
+	case kGaussianCorr_CC1pi_Pq0:             { return "GaussianCorr_CC1pi_Pq0";   }
+	case kGaussianCorr_CC1pi_Wq0:             { return "GaussianCorr_CC1pi_Wq0";   }
+	case kGaussianCorr_CC1pi_Pq3:             { return "GaussianCorr_CC1pi_Pq3";   }
+	case kGaussianCorr_CC1pi_Wq3:             { return "GaussianCorr_CC1pi_Wq3";   }
+	case kGaussianCorr_AllowSuppression:      { return "GaussianCorr_AllowSuppression";   }
+
+	default: return "unknown_nuisance_dial";
+	}
+
+};
diff --git a/src/Reweight/NUISANCESyst.h b/src/Reweight/NUISANCESyst.h
new file mode 100644
index 0000000..6315e23
--- /dev/null
+++ b/src/Reweight/NUISANCESyst.h
@@ -0,0 +1,48 @@
+#ifndef NUISANCESyst_H
+#define NUISANCESyst_H
+#include "GeneralUtils.h"
+
+namespace Reweight {
+
+enum NUISANCESyst {
+	kUnkownNUISANCEDial = 0,
+	kGaussianCorr_CCQE_norm,
+	kGaussianCorr_CCQE_tilt,
+	kGaussianCorr_CCQE_Pq0,
+	kGaussianCorr_CCQE_Wq0,
+	kGaussianCorr_CCQE_Pq3,
+	kGaussianCorr_CCQE_Wq3,
+	kGaussianCorr_2p2h_norm,
+	kGaussianCorr_2p2h_tilt,
+	kGaussianCorr_2p2h_Pq0,
+	kGaussianCorr_2p2h_Wq0,
+	kGaussianCorr_2p2h_Pq3,
+	kGaussianCorr_2p2h_Wq3,
+	kGaussianCorr_2p2h_PPandNN_norm,
+	kGaussianCorr_2p2h_PPandNN_tilt,
+	kGaussianCorr_2p2h_PPandNN_Pq0,
+	kGaussianCorr_2p2h_PPandNN_Wq0,
+	kGaussianCorr_2p2h_PPandNN_Pq3,
+	kGaussianCorr_2p2h_PPandNN_Wq3,
+	kGaussianCorr_2p2h_NP_norm,
+	kGaussianCorr_2p2h_NP_tilt,
+	kGaussianCorr_2p2h_NP_Pq0,
+	kGaussianCorr_2p2h_NP_Wq0,
+	kGaussianCorr_2p2h_NP_Pq3,
+	kGaussianCorr_2p2h_NP_Wq3,
+	kGaussianCorr_CC1pi_norm,
+	kGaussianCorr_CC1pi_tilt,
+	kGaussianCorr_CC1pi_Pq0,
+	kGaussianCorr_CC1pi_Wq0,
+	kGaussianCorr_CC1pi_Pq3,
+	kGaussianCorr_CC1pi_Wq3,
+	kGaussianCorr_AllowSuppression,
+
+	kNUISANCEDial_LAST
+};
+
+int ConvertNUISANCEDial(std::string type);
+std::string ConvNUISANCEDial(int type);
+
+};
+#endif
diff --git a/src/Reweight/NUISANCEWeightCalcs.cxx b/src/Reweight/NUISANCEWeightCalcs.cxx
new file mode 100644
index 0000000..d3f36e9
--- /dev/null
+++ b/src/Reweight/NUISANCEWeightCalcs.cxx
@@ -0,0 +1,276 @@
+#include "NUISANCEWeightCalcs.h"
+
+GaussianModeCorr::GaussianModeCorr() {
+
+	// Init
+	fApply_CCQE = false;
+	fGausVal_CCQE[kPosNorm] = 0.0;
+	fGausVal_CCQE[kPosTilt] = 0.0;
+	fGausVal_CCQE[kPosPq0]  = 1.0;
+	fGausVal_CCQE[kPosWq0]  = 1.0;
+	fGausVal_CCQE[kPosPq3]  = 1.0;
+	fGausVal_CCQE[kPosWq3]  = 1.0;
+
+	fApply_2p2h = false;
+	fGausVal_2p2h[kPosNorm] = 0.0;
+	fGausVal_2p2h[kPosTilt]    = 0.0;
+	fGausVal_2p2h[kPosPq0]  = 1.0;
+	fGausVal_2p2h[kPosWq0]  = 1.0;
+	fGausVal_2p2h[kPosPq3]  = 1.0;
+	fGausVal_2p2h[kPosWq3]  = 1.0;
+
+	fApply_2p2h_PPandNN = false;
+	fGausVal_2p2h_PPandNN[kPosNorm] = 0.0;
+	fGausVal_2p2h_PPandNN[kPosTilt] = 0.0;
+	fGausVal_2p2h_PPandNN[kPosPq0]  = 1.0;
+	fGausVal_2p2h_PPandNN[kPosWq0]  = 1.0;
+	fGausVal_2p2h_PPandNN[kPosPq3]  = 1.0;
+	fGausVal_2p2h_PPandNN[kPosWq3]  = 1.0;
+
+	fApply_2p2h_NP = false;
+	fGausVal_2p2h_NP[kPosNorm] = 0.0;
+	fGausVal_2p2h_NP[kPosTilt] = 0.0;
+	fGausVal_2p2h_NP[kPosPq0]  = 1.0;
+	fGausVal_2p2h_NP[kPosWq0]  = 1.0;
+	fGausVal_2p2h_NP[kPosPq3]  = 1.0;
+	fGausVal_2p2h_NP[kPosWq3]  = 1.0;
+
+	fApply_CC1pi = false;
+	fGausVal_CC1pi[kPosNorm] = 0.0;
+	fGausVal_CC1pi[kPosTilt] = 0.0;
+	fGausVal_CC1pi[kPosPq0]  = 1.0;
+	fGausVal_CC1pi[kPosWq0]  = 1.0;
+	fGausVal_CC1pi[kPosPq3]  = 1.0;
+	fGausVal_CC1pi[kPosWq3]  = 1.0;
+
+	fDebugStatements = FitPar::Config().GetParB("GaussianModeCorr_DEBUG");
+
+}
+
+double GaussianModeCorr::CalcWeight(BaseFitEvt* evt) {
+
+	FitEvent* fevt = static_cast<FitEvent*>(evt);
+	double rw_weight = 1.0;
+
+	// Get Neutrino
+	FitParticle* pnu = fevt->PartInfo(0);
+	int pdgnu = pnu->fPID;
+
+	FitParticle* plep = fevt->GetHMFSParticle(abs(pdgnu) - 1);
+	if (!plep) return 1.0;
+
+	TLorentzVector q = pnu->fP - plep->fP;
+
+	// Extra q0,q3
+	double q0 = fabs(q.E()) / 1.E3;
+	double q3 = fabs(q.Vect().Mag()) / 1.E3;
+
+	int initialstate = -1; // Undef
+	if (abs(fevt->Mode) == 2) {
+
+		int npr = 0;
+		int nne = 0;
+
+		for (UInt_t j = 0; j < fevt->Npart(); j++) {
+			if ((fevt->PartInfo(j))->fIsAlive) continue;
+
+			if (fevt->PartInfo(j)->fPID == 2212) npr++;
+			else if (fevt->PartInfo(j)->fPID == 2112) nne++;
+		}
+		// std::cout << "PN State = " << npr << " " << nne << std::endl;
+
+		if (fevt->Mode == 2 and npr == 1 and nne == 1) {
+			initialstate = 2;
+
+		} else if (fevt->Mode == 2 and ((npr == 0 and nne == 2) or (npr == 2 and nne == 0)))  {
+			initialstate = 1;
+		}
+	}
+
+// std::cout << "Got q0 q3 = " << q0 << " " << q3 << std::endl;
+
+// Apply weighting
+	if (fApply_CCQE and abs(fevt->Mode) == 1) {
+		if (fDebugStatements) std::cout << "Getting CCQE Weight" << std::endl;
+		rw_weight *= GetGausWeight(q0, q3, fGausVal_CCQE);
+	}
+
+	if (fApply_2p2h and abs(fevt->Mode) == 2) {
+		if (fDebugStatements) std::cout << "Getting 2p2h Weight" << std::endl;
+		rw_weight *= GetGausWeight(q0, q3, fGausVal_2p2h);
+	}
+
+	if (fApply_2p2h_PPandNN and abs(fevt->Mode) == 2 and initialstate == 1) {
+		if (fDebugStatements) std::cout << "Getting 2p2h PPandNN Weight" << std::endl;
+		rw_weight *= GetGausWeight(q0, q3, fGausVal_2p2h_PPandNN);
+	}
+
+	if (fApply_2p2h_NP and abs(fevt->Mode) == 2 and initialstate == 2) {
+		if (fDebugStatements) std::cout << "Getting 2p2h NP Weight" << std::endl;
+		rw_weight *= GetGausWeight(q0, q3, fGausVal_2p2h_NP);
+	}
+
+	if (fApply_CC1pi and abs(fevt->Mode) >= 11 and abs(fevt->Mode) <= 13) {
+		if (fDebugStatements) std::cout << "Getting CC1pi Weight" << std::endl;
+		rw_weight *= GetGausWeight(q0, q3, fGausVal_CC1pi);
+	}
+
+
+	// if (fDebugStatements) std::cout << "Returning Weight " << rw_weight << std::endl;
+	return rw_weight;
+}
+
+double GaussianModeCorr::GetGausWeight(double q0, double q3, double vals[]) {
+
+	// // CCQE Without Suppression
+	// double Norm = 4.82788679036;
+	// double Tilt = 2.3501416116;
+	// double Pq0  = 0.363964889702;
+	// double Wq0  = 0.133976806938;
+	// double Pq3  = 0.431769740224;
+	// double Wq3  = 0.207666663434;
+
+	// // Also add for CCQE at the end
+	// return (w > 1.0) ? w : 1.0;
+
+	// // 2p2h with suppression
+	// double Norm = 15.967;
+	// double Tilt = -0.455655;
+	// double Pq0  = 0.214598;
+	// double Wq0  = 0.0291061;
+	// double Pq3  = 0.480194;
+	// double Wq3  = 0.134588;
+
+	double Norm = vals[kPosNorm];
+	double Tilt = vals[kPosTilt];
+	double Pq0  = vals[kPosPq0];
+	double Wq0  = vals[kPosWq0];
+	double Pq3  = vals[kPosPq3];
+	double Wq3  = vals[kPosWq3];
+
+	double a = cos(Tilt) * cos(Tilt) / (2 * Wq0 * Wq0);
+	a += sin(Tilt) * sin(Tilt) / (2 * Wq3 * Wq3);
+
+	double b = - sin(2 * Tilt) / (4 * Wq0 * Wq0);
+	b += sin(2 * Tilt) / (4 * Wq3 * Wq3);
+
+	double c = sin(Tilt) * sin(Tilt) / (2 * Wq0 * Wq0);
+	c += cos(Tilt) * cos(Tilt) / (2 * Wq3 * Wq3);
+
+	double w = Norm;
+	w *= exp(-a  * (q0 - Pq0) * (q0 - Pq0));
+	w *= exp(+2.0 * b * (q0 - Pq0) * (q3 - Pq3));
+	w *= exp(-c  * (q3 - Pq3) * (q3 - Pq3));
+
+	if (fDebugStatements) {
+
+		std::cout << "Applied Tilt " << Tilt << " " << cos(Tilt) << " " << sin(Tilt) << std::endl;
+		std::cout << "abc = " << a << " " << b << " " << c << std::endl;
+		std::cout << "Returning " << Norm << " " << Pq0 << " " << Wq0 << " " << Pq3 << " " << Wq3 << " " << w << std::endl;
+
+	}
+
+
+	return w;
+}
+
+
+void GaussianModeCorr::SetDialValue(std::string name, double val) {
+	SetDialValue(Reweight::ConvDial(name, kCUSTOM), val);
+}
+
+void GaussianModeCorr::SetDialValue(int rwenum, double val) {
+
+	int curenum = rwenum % 1000;
+
+	// Check Handled
+	if (!IsHandled(curenum)) return;
+
+
+	// CCQE Setting
+	for (int i = kGaussianCorr_CCQE_norm; i <= kGaussianCorr_CCQE_Wq3; i++) {
+		if (i == curenum) {
+			int index = i - kGaussianCorr_CCQE_norm;
+			fGausVal_CCQE[index] = val;
+			fApply_CCQE = true;
+		}
+	}
+
+	// 2p2h Setting
+	for (int i = kGaussianCorr_2p2h_norm; i <= kGaussianCorr_2p2h_Wq3; i++) {
+		if (i == curenum) {
+			int index = i - kGaussianCorr_2p2h_norm;
+			fGausVal_2p2h[index] = val;
+			fApply_2p2h = true;
+		}
+	}
+
+	// 2p2h_PPandNN Setting
+	for (int i = kGaussianCorr_2p2h_PPandNN_norm; i <= kGaussianCorr_2p2h_PPandNN_Wq3; i++) {
+		if (i == curenum) {
+			int index = i - kGaussianCorr_2p2h_PPandNN_norm;
+			fGausVal_2p2h_PPandNN[index] = val;
+			fApply_2p2h_PPandNN = true;
+		}
+	}
+
+	// 2p2h_NP Setting
+	for (int i = kGaussianCorr_2p2h_NP_norm; i <= kGaussianCorr_2p2h_NP_Wq3; i++) {
+		if (i == curenum) {
+			int index = i - kGaussianCorr_2p2h_NP_norm;
+			fGausVal_2p2h_NP[index] = val;
+			fApply_2p2h_NP = true;
+		}
+	}
+
+	// CC1pi Setting
+	for (int i = kGaussianCorr_CC1pi_norm; i <= kGaussianCorr_CC1pi_Wq3; i++) {
+		if (i == curenum) {
+			int index = i - kGaussianCorr_CC1pi_norm;
+			fGausVal_CC1pi[index] = val;
+			fApply_CC1pi = true;
+		}
+	}
+
+}
+
+bool GaussianModeCorr::IsHandled(int rwenum) {
+
+	int curenum = rwenum % 1000;
+	switch (curenum) {
+	case kGaussianCorr_CCQE_norm:
+	case kGaussianCorr_CCQE_tilt:
+	case kGaussianCorr_CCQE_Pq0:
+	case kGaussianCorr_CCQE_Wq0:
+	case kGaussianCorr_CCQE_Pq3:
+	case kGaussianCorr_CCQE_Wq3:
+	case kGaussianCorr_2p2h_norm:
+	case kGaussianCorr_2p2h_tilt:
+	case kGaussianCorr_2p2h_Pq0:
+	case kGaussianCorr_2p2h_Wq0:
+	case kGaussianCorr_2p2h_Pq3:
+	case kGaussianCorr_2p2h_Wq3:
+	case kGaussianCorr_2p2h_PPandNN_norm:
+	case kGaussianCorr_2p2h_PPandNN_tilt:
+	case kGaussianCorr_2p2h_PPandNN_Pq0:
+	case kGaussianCorr_2p2h_PPandNN_Wq0:
+	case kGaussianCorr_2p2h_PPandNN_Pq3:
+	case kGaussianCorr_2p2h_PPandNN_Wq3:
+	case kGaussianCorr_2p2h_NP_norm:
+	case kGaussianCorr_2p2h_NP_tilt:
+	case kGaussianCorr_2p2h_NP_Pq0:
+	case kGaussianCorr_2p2h_NP_Wq0:
+	case kGaussianCorr_2p2h_NP_Pq3:
+	case kGaussianCorr_2p2h_NP_Wq3:
+	case kGaussianCorr_CC1pi_norm:
+	case kGaussianCorr_CC1pi_tilt:
+	case kGaussianCorr_CC1pi_Pq0:
+	case kGaussianCorr_CC1pi_Wq0:
+	case kGaussianCorr_CC1pi_Pq3:
+	case kGaussianCorr_CC1pi_Wq3:
+
+		return true;
+	default:
+		return false;
+	}
+}
diff --git a/src/Reweight/NUISANCEWeightCalcs.h b/src/Reweight/NUISANCEWeightCalcs.h
new file mode 100644
index 0000000..4d66e4a
--- /dev/null
+++ b/src/Reweight/NUISANCEWeightCalcs.h
@@ -0,0 +1,85 @@
+#ifndef NUISANCE_WEIGHT_CALCS
+#define NUISANCE_WEIGHT_CALCS
+
+#include "FitEvent.h"
+#include "GeneralUtils.h"
+#include "BaseFitEvt.h"
+#include "WeightUtils.h"
+#include "NUISANCESyst.h"
+#include "FitParameters.h"
+
+using namespace Reweight;
+
+ class NUISANCEWeightCalc {
+public:
+	NUISANCEWeightCalc() {};
+	virtual ~NUISANCEWeightCalc() {};
+
+	virtual double CalcWeight(BaseFitEvt* evt){return 1.0;};
+	virtual void SetDialValue(std::string name, double val){};
+	virtual void SetDialValue(int rwenum, double val){};
+	virtual bool IsHandled(int rwenum){return false;};
+
+	virtual void Print(){};
+
+	std::map<std::string, int> fDialNameIndex;
+	std::map<int, int> fDialEnumIndex;
+	std::vector<double> fDialValues;
+
+	std::string fName;
+};
+
+
+class GaussianModeCorr : public NUISANCEWeightCalc {
+public:
+
+	GaussianModeCorr();
+	~GaussianModeCorr(){};
+
+	double CalcWeight(BaseFitEvt* evt);
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int rwenum, double val);
+	bool IsHandled(int rwenum);
+	double GetGausWeight(double q0, double q3, double vals[]);
+
+	// 5 pars describe the Gaussain
+	// 0 norm.
+	// 1 q0 pos
+	// 2 q0 width
+	// 3 q3 pos
+	// 4 q3 width
+	static const int kPosNorm = 0;
+	static const int kPosTilt = 1;
+	static const int kPosPq0  = 2;
+	static const int kPosWq0  = 3;
+	static const int kPosPq3  = 4;
+	static const int kPosWq3  = 5;
+
+	bool fApply_CCQE;
+	double fGausVal_CCQE[6];
+
+	bool fApply_2p2h;
+	double fGausVal_2p2h[6];
+
+	bool fApply_2p2h_PPandNN;
+	double fGausVal_2p2h_PPandNN[6];
+
+	bool fApply_2p2h_NP;
+	double fGausVal_2p2h_NP[6];
+
+	bool fApply_CC1pi;
+	double fGausVal_CC1pi[6];
+
+	bool fAllowSuppression;
+
+	bool fDebugStatements;
+
+
+
+
+
+
+};
+
+
+#endif
diff --git a/src/Reweight/NUISANCEWeightEngine.cxx b/src/Reweight/NUISANCEWeightEngine.cxx
new file mode 100644
index 0000000..1a45507
--- /dev/null
+++ b/src/Reweight/NUISANCEWeightEngine.cxx
@@ -0,0 +1,106 @@
+#include "NUISANCEWeightEngine.h"
+#include "NUISANCEWeightCalcs.h"
+
+NUISANCEWeightEngine::NUISANCEWeightEngine(std::string name) {
+
+	// Setup the NUISANCE Reweight engine
+	fCalcName = name;
+	LOG(FIT) << "Setting up NUISANCE Custom RW : " << fCalcName << std::endl;
+
+	// Load in all Weight Calculations
+	fWeightCalculators.push_back( new GaussianModeCorr() );
+
+	// Set Abs Twk Config
+	fIsAbsTwk = true;
+
+};
+
+
+void NUISANCEWeightEngine::IncludeDial(std::string name, double startval) {
+
+	// Get NUISANCE Enum
+	int nuisenum = Reweight::ConvDial(name, kCUSTOM);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(1.0);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(name, startval);
+	}
+};
+
+
+void NUISANCEWeightEngine::SetDialValue(int nuisenum, double val) {
+	fValues[fEnumIndex[nuisenum]] = val;
+}
+
+void NUISANCEWeightEngine::SetDialValue(std::string name, double val) {
+	fValues[fNameIndex[name]] = val;
+}
+
+void NUISANCEWeightEngine::Reconfigure(bool silent) {
+
+	// Loop over all names
+	for (std::map<int, size_t>::iterator enumiter = fEnumIndex.begin();
+	        enumiter != fEnumIndex.end(); enumiter++) {
+
+		for (std::vector<NUISANCEWeightCalc*>::iterator calciter = fWeightCalculators.begin();
+		        calciter != fWeightCalculators.end(); calciter++) {
+
+			NUISANCEWeightCalc* nuiscalc = static_cast<NUISANCEWeightCalc*>(*calciter);
+			if (nuiscalc->IsHandled(enumiter->first)) {
+				nuiscalc->SetDialValue(enumiter->first, fValues[enumiter->second]);
+			}
+		}
+	}
+}
+
+
+
+double NUISANCEWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+
+	// Cast as usable class
+	for (std::vector<NUISANCEWeightCalc*>::iterator iter = fWeightCalculators.begin();
+	        iter != fWeightCalculators.end(); iter++) {
+		NUISANCEWeightCalc* nuiscalc = static_cast<NUISANCEWeightCalc*>(*iter);
+
+		rw_weight *= nuiscalc->CalcWeight(evt);
+	}
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/NUISANCEWeightEngine.h b/src/Reweight/NUISANCEWeightEngine.h
new file mode 100644
index 0000000..bd19b60
--- /dev/null
+++ b/src/Reweight/NUISANCEWeightEngine.h
@@ -0,0 +1,33 @@
+#ifndef WEIGHT_ENGINE_NUISANCE_H
+#define WEIGHT_ENGINE_NUISANCE_H
+
+#include "FitLogger.h"
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "FitWeight.h"
+#include "NUISANCESyst.h"
+#include "NUISANCEWeightCalcs.h"
+
+class NUISANCEWeightEngine : public WeightEngineBase {
+public:
+	NUISANCEWeightEngine(std::string name);
+	~NUISANCEWeightEngine() {};
+
+	void IncludeDial(std::string name, double startval);
+
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int nuisenum, double val);
+
+	void Reconfigure(bool silent = false);
+
+	double CalcWeight(BaseFitEvt* evt);
+
+	inline bool NeedsEventReWeight() { return true; };
+
+	std::vector<NUISANCEWeightCalc*> fWeightCalculators;
+};
+
+
+
+
+#endif
diff --git a/src/Reweight/NuWroWeightEngine.cxx b/src/Reweight/NuWroWeightEngine.cxx
new file mode 100644
index 0000000..baab616
--- /dev/null
+++ b/src/Reweight/NuWroWeightEngine.cxx
@@ -0,0 +1,126 @@
+#include "NuWroWeightEngine.h"
+
+NuWroWeightEngine::NuWroWeightEngine(std::string name) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up NuWro RW : " << fCalcName << std::endl;
+
+	// Create RW Engine suppressing cout
+	StopTalking();
+
+	// Create the engine
+	fNuwroRW = new nuwro::rew::NuwroReWeight();
+
+	// Get List of Veto Calcs (For Debugging)
+	std::string rw_engine_list =
+	    FitPar::Config().GetParS("FitWeight.fNuwroRW_veto");
+	bool xsec_qel = rw_engine_list.find("nuwro_QEL") == std::string::npos;
+	bool xsec_flag = rw_engine_list.find("nuwro_FlagNorm") == std::string::npos;
+	bool xsec_res = rw_engine_list.find("nuwro_RES") == std::string::npos;
+
+	// Add the RW Calcs
+	if (xsec_qel)
+		fNuwroRW->AdoptWghtCalc("nuwro_QEL", new nuwro::rew::NuwroReWeight_QEL);
+	if (xsec_flag)
+		fNuwroRW->AdoptWghtCalc("nuwro_FlagNorm",
+		                        new nuwro::rew::NuwroReWeight_FlagNorm);
+	if (xsec_res)  fNuwroRW->AdoptWghtCalc( "nuwro_RES",  new
+		                                        nuwro::rew::NuwroReWeight_SPP );
+
+	// Set Abs Twk Config
+	fIsAbsTwk = (FitPar::Config().GetParB("setabstwk"));
+
+	// allow cout again
+	StartTalking();
+#else
+	ERR(FTL) << "NUWRO RW NOT ENABLED! " << std::endl;
+#endif
+};
+
+
+void NuWroWeightEngine::IncludeDial(std::string name, double startval) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+
+	// Get RW Enum and name
+	nuwro::rew::NuwroSyst_t gensyst = nuwro::rew::NuwroSyst::FromString(name);
+	int nuisenum = Reweight::ConvDial(name, kNUWRO);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(0.0);
+	fNUWROSysts.push_back(gensyst);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Initialise Dial
+	fNuwroRW->Systematics().Add( fNUWROSysts[index] );
+
+	// If Absolute
+	if (fIsAbsTwk) {
+		nuwro::rew::NuwroSystUncertainty::Instance()->SetUncertainty( fNUWROSysts[index], 1.0, 1.0 );
+	}
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(name, startval);
+	}
+#endif
+};
+
+
+void NuWroWeightEngine::SetDialValue(int nuisenum, double val) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+	fValues[fEnumIndex[nuisenum]] = val;
+	fNuwroRW->Systematics().SetSystVal(fNUWROSysts[fEnumIndex[nuisenum]], val);
+#endif
+}
+
+void NuWroWeightEngine::SetDialValue(std::string name, double val) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+	fValues[fNameIndex[name]] = val;
+	fNuwroRW->Systematics().SetSystVal(fNUWROSysts[fNameIndex[name]], val);
+#endif
+}
+
+
+void NuWroWeightEngine::Reconfigure(bool silent) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+	// Hush now...
+	if (silent) StopTalking();
+
+	// Reconf
+	fNuwroRW->Reconfigure();
+
+	// Shout again
+	if (silent) StartTalking();
+#endif
+}
+
+
+double NuWroWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+	// Skip Non GENIE
+	if (evt->fType != kNUWRO) return 1.0;
+
+	// Call Weight calculation
+	rw_weight = fNuwroRW->CalcWeight(evt->fNuwroEvent);
+#endif
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/NuWroWeightEngine.h b/src/Reweight/NuWroWeightEngine.h
new file mode 100644
index 0000000..ce69dc2
--- /dev/null
+++ b/src/Reweight/NuWroWeightEngine.h
@@ -0,0 +1,40 @@
+#ifndef WEIGHT_ENGINE_NUWRO_H
+#define WEIGHT_ENGINE_NUWRO_H
+
+#include "FitLogger.h"
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "WeightUtils.h"
+
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+#include "NuwroReWeight.h"
+#include "event1.h"
+#include "NuwroReWeight_FlagNorm.h"
+#include "NuwroReWeight_QEL.h"
+#include "NuwroReWeight_SPP.h"
+#include "NuwroSyst.h"
+#include "NuwroSystUncertainty.h"
+#endif
+
+class NuWroWeightEngine : public WeightEngineBase {
+public:
+	NuWroWeightEngine(std::string name);
+	~NuWroWeightEngine() {};
+
+	void IncludeDial(std::string name, double startval);
+
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int rwenum, double val);
+
+	void Reconfigure(bool silent = false);
+	double CalcWeight(BaseFitEvt* evt);
+
+	inline bool NeedsEventReWeight() { return true; };
+
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+	std::vector<nuwro::rew::NuwroSyst_t> fNUWROSysts;
+	nuwro::rew::NuwroReWeight* fNuwroRW;
+#endif
+};
+
+#endif
diff --git a/src/Reweight/SampleNormEngine.cxx b/src/Reweight/SampleNormEngine.cxx
new file mode 100644
index 0000000..13d2acc
--- /dev/null
+++ b/src/Reweight/SampleNormEngine.cxx
@@ -0,0 +1,58 @@
+#include "SampleNormEngine.h"
+
+SampleNormEngine::SampleNormEngine(std::string name) {
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up Sample Norm RW : " << fCalcName << std::endl;
+
+	// Set Abs Twk Config
+	fIsAbsTwk = true;
+
+};
+
+
+void SampleNormEngine::IncludeDial(std::string name, double startval) {
+
+	// Get NUISANCE Enum
+	int nuisenum = Reweight::ConvDial(name, kNORM);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(1.0);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(name, startval);
+	}
+};
+
+
+void SampleNormEngine::SetDialValue(int nuisenum, double val) {
+	fValues[fEnumIndex[nuisenum]] = val;
+}
+
+void SampleNormEngine::SetDialValue(std::string name, double val){
+	fValues[fNameIndex[name]] = val;
+}
+
+void SampleNormEngine::Reconfigure(bool silent) {
+	// Empty placeholder incase we want print statements...
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/SampleNormEngine.h b/src/Reweight/SampleNormEngine.h
new file mode 100644
index 0000000..c341a71
--- /dev/null
+++ b/src/Reweight/SampleNormEngine.h
@@ -0,0 +1,22 @@
+#ifndef SampleNormEngine_H
+#define SampleNormEngine_H
+
+#include "FitLogger.h"
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+
+class SampleNormEngine : public WeightEngineBase {
+	public:
+		SampleNormEngine(std::string name);
+		~SampleNormEngine(){};
+
+		void IncludeDial(std::string name, double startval);
+		void SetDialValue(int rwenum, double val);
+		void SetDialValue(std::string name, double val);
+		
+		void Reconfigure(bool silent = false);
+		inline double CalcWeight(BaseFitEvt* evt) {return 1.0;};
+		inline bool NeedsEventReWeight(){ return false; };
+};
+
+#endif
diff --git a/src/Reweight/SplineWeightEngine.cxx b/src/Reweight/SplineWeightEngine.cxx
new file mode 100644
index 0000000..a2ec628
--- /dev/null
+++ b/src/Reweight/SplineWeightEngine.cxx
@@ -0,0 +1,79 @@
+#include "SplineWeightEngine.h"
+
+SplineWeightEngine::SplineWeightEngine(std::string name) {
+
+  // Setup the Reweight engien
+  fCalcName = name;
+  LOG(FIT) << "Setting up Spline RW : " << fCalcName << std::endl;
+  
+  // Set Abs Twk Config
+  fIsAbsTwk = true;
+	
+};
+
+
+void SplineWeightEngine::IncludeDial(std::string name, double startval) {
+
+  // Get NUISANCE Enum
+  int nuisenum = Reweight::ConvDial(name, kSPLINEPARAMETER);
+  
+  // Fill Maps
+  int index = fValues.size();
+  fValues.push_back(0.0);
+  
+  fEnumIndex[nuisenum] = index;
+  fNameIndex[name] = index;
+  
+  //	std::cout << "Inlcuded Spline Dial " << name << " " << nuisenum << " " << startval << " " << index << std::endl;
+  
+  // Set Value if given
+  if (startval != -999.9) {
+    SetDialValue(name, startval);
+  }
+}
+
+
+void SplineWeightEngine::SetDialValue(int nuisenum, double val) {
+  //  LOG(FIT) << "Enum Val " << nuisenum << std::endl;
+  //  LOG(FIT) << fEnumIndex.size() << std::endl;
+  //  LOG(FIT) << "Set Dial Value to " << nuisenum << " " << fEnumIndex[nuisenum] << " " << val << std::endl;
+  fValues[fEnumIndex[nuisenum]] = val;
+}
+
+void SplineWeightEngine::SetDialValue(std::string name, double val){
+  fValues[fNameIndex[name]] = val;
+}
+
+
+void SplineWeightEngine::Reconfigure(bool silent) {
+  for (std::map<std::string, size_t>::iterator iter = fNameIndex.begin(); 
+       iter != fNameIndex.end(); iter++){
+    // LOG(FIT) << "Reconfiguring Spline " << iter->first << " to be " << fValues[ iter->second ] << " Inside SPL RW" << std::endl;
+    fSplineValueMap[ iter->first ] = fValues[ iter->second ];
+  }
+}
+
+
+double SplineWeightEngine::CalcWeight(BaseFitEvt* evt) {
+
+  if (!evt->fSplineRead) return 1.0;
+  
+  if (evt->fSplineRead->NeedsReconfigure()) {
+    evt->fSplineRead->Reconfigure(fSplineValueMap);
+  }
+  
+  double rw_weight = evt->fSplineRead->CalcWeight( evt->fSplineCoeff );
+  if (rw_weight < 0.0) rw_weight = 0.0;
+
+  return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/SplineWeightEngine.h b/src/Reweight/SplineWeightEngine.h
new file mode 100644
index 0000000..974f9eb
--- /dev/null
+++ b/src/Reweight/SplineWeightEngine.h
@@ -0,0 +1,24 @@
+#ifndef SplineWeightEngine_H
+#define SplineWeightEngine_H
+
+#include "FitLogger.h"
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "SplineReader.h"
+
+class SplineWeightEngine : public WeightEngineBase {
+	public:
+		SplineWeightEngine(std::string name);
+		~SplineWeightEngine(){};
+
+		void IncludeDial(std::string name,  double startval);
+		void SetDialValue(std::string name, double val);
+		void SetDialValue(int rwenum, double val);
+		void Reconfigure(bool silent = false);
+		inline double CalcWeight(BaseFitEvt* evt);
+		inline bool NeedsEventReWeight(){ return true; };
+
+		std::map< std::string, double > fSplineValueMap;
+};
+
+#endif
diff --git a/src/Reweight/T2KWeightEngine.cxx b/src/Reweight/T2KWeightEngine.cxx
new file mode 100644
index 0000000..8d1c761
--- /dev/null
+++ b/src/Reweight/T2KWeightEngine.cxx
@@ -0,0 +1,126 @@
+#include "T2KWeightEngine.h"
+
+T2KWeightEngine::T2KWeightEngine(std::string name) {
+#ifdef __T2KREW_ENABLED__
+
+	// Setup the NEUT Reweight engien
+	fCalcName = name;
+	LOG(FIT) << "Setting up T2K RW : " << fCalcName << std::endl;
+
+	// Create RW Engine suppressing cout
+	StopTalking();
+
+	// Create Main RW Engine
+	fT2KRW = new t2krew::T2KReWeight();
+
+	// Setup Sub RW Engines (Only activated for neut and niwg)
+	fT2KNeutRW = new t2krew::T2KNeutReWeight();
+	fT2KNIWGRW = new t2krew::T2KNIWGReWeight();
+
+	fT2KRW->AdoptWghtEngine("fNeutRW", fT2KNeutRW);
+	fT2KRW->AdoptWghtEngine("fNIWGRW", fT2KNIWGRW);
+
+	fT2KRW->Reconfigure();
+
+	// allow cout again
+	StartTalking();
+
+	// Set Abs Twk Config
+	fIsAbsTwk = (FitPar::Config().GetParB("setabstwk"));
+	
+#else	
+	ERR(FTL) << "T2K RW NOT ENABLED" << std::endl;
+	throw;
+#endif
+};
+
+void T2KWeightEngine::IncludeDial(std::string name, double startval) {
+#ifdef __T2KREW_ENABLED__
+	// Get NEUT Syst.
+	t2krew::T2KSyst_t gensyst = t2krew::T2KSyst::FromString(name);
+	int nuisenum = Reweight::ConvDial(name, kT2K);
+
+	// Fill Maps
+	int index = fValues.size();
+	fValues.push_back(0.0);
+	fT2KSysts.push_back(gensyst);
+
+	fEnumIndex[nuisenum] = index;
+	fNameIndex[name] = index;
+
+	// Initialize dial
+	fT2KRW->Systematics().Include(gensyst);
+
+	// If Absolute
+	if (fIsAbsTwk) {
+		fT2KRW->Systematics().SetAbsTwk(gensyst);
+	}
+
+	// Set Value if given
+	if (startval != -999.9) {
+		SetDialValue(nuisenum, startval);
+	}
+#endif
+}
+
+void T2KWeightEngine::SetDialValue(int nuisenum, double val) {
+#ifdef __T2KREW_ENABLED__
+	fValues[fEnumIndex[nuisenum]] = val;
+	fT2KRW->Systematics().SetTwkDial(fT2KSysts[fEnumIndex[nuisenum]], val);
+#endif
+}
+
+void T2KWeightEngine::SetDialValue(std::string name, double val) {
+#ifdef __T2KREW_ENABLED__
+	fValues[fNameIndex[name]] = val;
+	fT2KRW->Systematics().SetTwkDial(fT2KSysts[fNameIndex[name]], val);
+#endif
+}
+
+
+void T2KWeightEngine::Reconfigure(bool silent) {
+#ifdef __T2KREW_ENABLED__
+	// Hush now...
+	if (silent) StopTalking();
+
+	// Reconf
+	StopTalking();
+	fT2KRW->Reconfigure();
+	StartTalking();
+
+	// Shout again
+	if (silent) StartTalking();
+#endif
+}
+
+
+double T2KWeightEngine::CalcWeight(BaseFitEvt* evt) {
+	double rw_weight = 1.0;
+
+#ifdef __T2KREW_ENABLED__
+	// Skip Non GENIE
+	if (evt->fType != kNEUT) return 1.0;
+
+	// Hush now
+	StopTalking();
+
+	// Get Weight For NEUT
+	rw_weight = fT2KRW->CalcWeight(evt->fNeutVect);
+
+	// Speak Now
+	StartTalking();
+#endif
+
+	// Return rw_weight
+	return rw_weight;
+}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Reweight/T2KWeightEngine.h b/src/Reweight/T2KWeightEngine.h
new file mode 100644
index 0000000..8c7ac67
--- /dev/null
+++ b/src/Reweight/T2KWeightEngine.h
@@ -0,0 +1,44 @@
+#ifndef WEIGHT_ENGINE_T2K_H
+#define WEIGHT_ENGINE_T2K_H
+
+#include "FitLogger.h"
+
+#ifdef __T2KREW_ENABLED__
+#include "T2KGenieReWeight.h"
+#include "T2KNIWGReWeight.h"
+#include "T2KNIWGUtils.h"
+#include "T2KNeutReWeight.h"
+#include "T2KNeutUtils.h"
+#include "T2KReWeight.h"
+using namespace t2krew;
+#endif
+
+#include "GeneratorUtils.h"
+#include "WeightEngineBase.h"
+#include "FitWeight.h"
+
+class T2KWeightEngine : public WeightEngineBase {
+public:
+	T2KWeightEngine(std::string name);
+	~T2KWeightEngine() {};
+
+	void IncludeDial(std::string name, double startval);
+
+	void SetDialValue(std::string name, double val);
+	void SetDialValue(int nuisenum, double val);
+
+	void Reconfigure(bool silent = false);
+
+	double CalcWeight(BaseFitEvt* evt);
+
+	inline bool NeedsEventReWeight() { return true; };
+	
+#ifdef __T2KREW_ENABLED__
+	std::vector<t2krew::T2KSyst_t> fT2KSysts;
+	t2krew::T2KReWeight* fT2KRW;  //!< T2K RW Object
+	t2krew::T2KNeutReWeight* fT2KNeutRW;
+	t2krew::T2KNIWGReWeight* fT2KNIWGRW;
+#endif
+};
+
+#endif
diff --git a/src/Reweight/WeightEngineBase.cxx b/src/Reweight/WeightEngineBase.cxx
new file mode 100644
index 0000000..038a896
--- /dev/null
+++ b/src/Reweight/WeightEngineBase.cxx
@@ -0,0 +1,25 @@
+#include "WeightEngineBase.h"
+
+bool WeightEngineBase::IsDialIncluded(std::string name) {
+	return (fNameIndex.find(name) != fNameIndex.end());
+}
+
+bool WeightEngineBase::IsDialIncluded(int nuisenum) {
+	return (fEnumIndex.find(nuisenum) != fEnumIndex.end());
+}
+
+double WeightEngineBase::GetDialValue(std::string name) {
+	if (!IsDialIncluded(name)) {
+		ERR(FTL) << "Dial " << name
+		         << " not included in " << fCalcName << std::endl;
+	}
+	return fValues[fNameIndex[name]];
+}
+
+double WeightEngineBase::GetDialValue(int nuisenum) {
+	if (!IsDialIncluded(nuisenum)) {
+		ERR(FTL) << "Dial Enum " << nuisenum
+		         << " not included in " << fCalcName << std::endl;
+	}
+	return fValues[fEnumIndex[nuisenum]];
+}
diff --git a/src/Reweight/WeightEngineBase.h b/src/Reweight/WeightEngineBase.h
new file mode 100644
index 0000000..c8adf71
--- /dev/null
+++ b/src/Reweight/WeightEngineBase.h
@@ -0,0 +1,59 @@
+#ifndef WEIGHTENGINE_BASE_H
+#define WEIGHTENGINE_BASE_H
+
+#include "BaseFitEvt.h"
+#include "FitLogger.h"
+#include "FitUtils.h"
+
+#include <math.h>
+#include <stdlib.h>
+#include <time.h>
+#include <deque>
+#include <iomanip>
+#include <iostream>
+#include <map>
+#include <numeric>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include "GeneratorUtils.h"
+#include "TCanvas.h"
+#include "TGraph2D.h"
+#include "WeightUtils.h"
+
+class WeightEngineBase {
+
+public:
+
+	WeightEngineBase(){};
+	virtual ~WeightEngineBase(){};
+
+	// Functions requiring Override
+	virtual void IncludeDial(std::string name, double startval){};
+
+	virtual void SetDialValue(int nuisenum, double val){};
+	virtual void SetDialValue(std::string name, double val){};
+
+	virtual bool IsDialIncluded(std::string name);
+	virtual bool IsDialIncluded(int nuisenum);
+
+	virtual double GetDialValue(std::string name);
+	virtual double GetDialValue(int nuisenum);
+
+	virtual void Reconfigure(bool silent){};
+	
+	virtual double CalcWeight(BaseFitEvt* evt){ return 1.0; };
+	virtual bool NeedsEventReWeight() = 0;
+
+	bool fHasChanged;
+	bool fIsAbsTwk;
+
+	std::vector<double> fValues;
+	std::map<int, size_t> fEnumIndex;
+	std::map<std::string, size_t> fNameIndex;
+	std::string fCalcName;
+};
+
+
+#endif
diff --git a/src/Reweight/WeightUtils.cxx b/src/Reweight/WeightUtils.cxx
new file mode 100644
index 0000000..81d4fb3
--- /dev/null
+++ b/src/Reweight/WeightUtils.cxx
@@ -0,0 +1,487 @@
+#include "WeightUtils.h"
+
+//********************************************************************
+TF1 FitBase::GetRWConvFunction(std::string type, std::string name) {
+//********************************************************************
+
+  std::string dialfunc = "x";
+  std::string parType = type;
+  double low = -10000.0;
+  double high = 10000.0;
+  if (parType.find("parameter") == std::string::npos) parType += "_parameter";
+
+  string line;
+  ifstream card(
+    (GeneralUtils::GetTopLevelDir() + "/parameters/dial_conversion.card").c_str(),
+    ifstream::in);
+
+  while (std::getline(card >> std::ws, line, '\n')) {
+
+    std::vector<std::string> inputlist = GeneralUtils::ParseToStr(line, " ");
+
+    // Check the line length
+    if (inputlist.size() < 4) continue;
+
+    // Check whether this is a comment
+    if (inputlist[0].c_str()[0] == '#') continue;
+
+    // Check whether this is the correct parameter type
+    if (inputlist[0].compare(parType) != 0) continue;
+
+    // Check the parameter name
+    if (inputlist[1].compare(name) != 0) continue;
+
+    // inputlist[2] should be the units... ignore for now
+
+    dialfunc = inputlist[3];
+
+    // High and low are optional, check whether they exist
+    if (inputlist.size() > 4) low  = GeneralUtils::StrToDbl(inputlist[4]);
+    if (inputlist.size() > 5) high = GeneralUtils::StrToDbl(inputlist[5]);
+
+  }
+
+  TF1 convfunc = TF1((name + "_convfunc").c_str(), dialfunc.c_str(), low, high);
+  return convfunc;
+}
+
+//********************************************************************
+std::string FitBase::GetRWUnits(std::string type, std::string name) {
+  //********************************************************************
+
+  std::string unit = "sig.";
+  std::string parType = type;
+
+  if (parType.find("parameter") == std::string::npos) {
+    parType += "_parameter";
+  }
+
+  std::string line;
+  std::ifstream card((GeneralUtils::GetTopLevelDir() + "/parameters/dial_conversion.card").c_str(), ifstream::in);
+
+  while (std::getline(card >> std::ws, line, '\n')) {
+
+    std::vector<std::string> inputlist = GeneralUtils::ParseToStr(line, " ");
+
+    // Check the line length
+    if (inputlist.size() < 3) continue;
+
+    // Check whether this is a comment
+    if (inputlist[0].c_str()[0] == '#') continue;
+
+    // Check whether this is the correct parameter type
+    if (inputlist[0].compare(parType) != 0) continue;
+
+    // Check the parameter name
+    if (inputlist[1].compare(name) != 0) continue;
+
+    unit = inputlist[2];
+    break;
+  }
+
+  return unit;
+}
+
+//********************************************************************
+double FitBase::RWAbsToSigma(std::string type, std::string name, double val) {
+  //********************************************************************
+  TF1 f1 = GetRWConvFunction(type, name);
+  double conv_val = f1.GetX(val);
+  if (fabs(conv_val) < 1E-10) conv_val = 0.0;
+  return conv_val;
+}
+
+//********************************************************************
+double FitBase::RWSigmaToAbs(std::string type, std::string name, double val) {
+  //********************************************************************
+  TF1 f1 = GetRWConvFunction(type, name);
+  double conv_val = f1.Eval(val);
+  return conv_val;
+}
+
+//********************************************************************
+double FitBase::RWFracToSigma(std::string type, std::string name, double val) {
+  //********************************************************************
+  TF1 f1 = GetRWConvFunction(type, name);
+  double conv_val = f1.GetX((val * f1.Eval(0.0)));
+  if (fabs(conv_val) < 1E-10) conv_val = 0.0;
+  return conv_val;
+}
+
+//********************************************************************
+double FitBase::RWSigmaToFrac(std::string type, std::string name, double val) {
+  //********************************************************************
+  TF1 f1 = GetRWConvFunction(type, name);
+  double conv_val = f1.Eval(val) / f1.Eval(0.0);
+  return conv_val;
+}
+
+
+
+int FitBase::ConvDialType(std::string type) {
+
+  if      (!type.compare("neut_parameter")) return kNEUT;
+  else if (!type.compare("niwg_parameter")) return kNIWG;
+  else if (!type.compare("nuwro_parameter")) return kNUWRO;
+  else if (!type.compare("t2k_parameter")) return kT2K;
+  else if (!type.compare("genie_parameter")) return kGENIE;
+  else if (!type.compare("custom_parameter")) return kCUSTOM;
+  else if (!type.compare("norm_parameter")) return kNORM;
+  else if (!type.compare("modenorm_parameter")) return kMODENORM;
+  else if (!type.compare("likeweight_parameter")) return kLIKEWEIGHT;
+  else if (!type.compare("spline_parameter")) return kSPLINEPARAMETER;
+  else return kUNKNOWN;
+
+}
+
+std::string FitBase::ConvDialType(int type) {
+
+  switch (type) {
+  case kNEUT:  { return "neut_parameter";  }
+  case kNIWG:  { return "niwg_parameter";  }
+  case kNUWRO: { return "nuwro_parameter"; }
+  case kT2K:   { return "t2k_parameter";   }
+  case kGENIE: { return "genie_parameter"; }
+  case kNORM:  { return "norm_parameter";  }
+  case kCUSTOM: {return "custom_parameter"; }
+  case kMODENORM: { return "modenorm_parameter"; }
+  case kLIKEWEIGHT: { return "likeweight_parameter"; }
+  case kSPLINEPARAMETER: {return "spline_parameter";}
+  default: return "unknown_parameter";
+  }
+
+}
+
+int FitBase::GetDialEnum(std::string type, std::string name) {
+  return FitBase::GetDialEnum( FitBase::ConvDialType(type), name );
+}
+
+
+
+int FitBase::GetDialEnum(int type, std::string name) {
+
+  int offset = type * 1000;
+  int this_enum = -1; //Not Found
+
+  std::cout << "Getting dial enum " << type << " " << name << std::endl;
+  // Select Types
+  switch (type) {
+
+  // NEUT DIAL TYPE
+  case kNEUT: {
+#ifdef __NEUT_ENABLED__
+    int neut_enum = (int)neut::rew::NSyst::FromString(name);
+    if (neut_enum != 0) { this_enum = neut_enum + offset; }
+#else
+    this_enum = -2; //Not enabled
+#endif
+    break;
+  }
+
+  // NIWG DIAL TYPE
+  case kNIWG: {
+#ifdef __NIWG_ENABLED__
+    int niwg_enum = (int)niwg::rew::NIWGSyst::FromString(name);
+    if (niwg_enum != 0) { this_enum = niwg_enum + offset; }
+#else
+    this_enum = -2;
+#endif
+    break;
+  }
+
+  // NUWRO DIAL TYPE
+  case kNUWRO: {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+    int nuwro_enum = (int)nuwro::rew::NuwroSyst::FromString(name);
+    if (nuwro_enum > 0) { this_enum = nuwro_enum + offset; }
+#else
+    this_enum = -2;
+#endif
+  }
+
+  // GENIE DIAL TYPE
+  case kGENIE: {
+#ifdef __GENIE_ENABLED__
+    int genie_enum = (int)genie::rew::GSyst::FromString(name);
+    if (genie_enum > 0) { this_enum = genie_enum + offset; }
+#else
+    this_enum = -2;
+#endif
+    break;
+  }
+
+  case kCUSTOM: {
+    int custom_enum = 0;  // PLACEHOLDER
+    this_enum = custom_enum + offset;
+    break;
+  }
+
+  // T2K DIAL TYPE
+  case kT2K: {
+#ifdef __T2KREW_ENABLED__
+    int t2k_enum = (int)t2krew::T2KSyst::FromString(name);
+    if (t2k_enum > 0) { this_enum = t2k_enum + offset; }
+#else
+    this_enum = -2;
+#endif
+    break;
+  }
+
+  case kNORM: {
+    if (gNormEnums.find(name) == gNormEnums.end()) {
+      gNormEnums[name] = gNormEnums.size() + 1 + offset;
+    }
+    this_enum = gNormEnums[name];
+    break;
+  }
+
+  case kMODENORM: {
+    size_t us_pos = name.find_first_of('_');
+    std::string numstr = name.substr(us_pos + 1);
+    int mode_num = std::atoi(numstr.c_str());
+    LOG(FTL) << "Getting mode num " << mode_num << std::endl;
+    if (!mode_num) {
+      ERR(FTL) << "Attempting to parse dial name: \"" << name
+               << "\" as a mode norm dial but failed." << std::endl;
+      throw;
+    }
+    this_enum = 60 + mode_num + offset;
+    break;
+  }
+
+  case kLIKEWEIGHT: {
+    if (gLikeWeightEnums.find(name) == gLikeWeightEnums.end()) {
+      gLikeWeightEnums[name] = gLikeWeightEnums.size() + 1 + offset;
+    }
+    this_enum = gLikeWeightEnums[name];
+    break;
+  }
+
+  case kSPLINEPARAMETER: {
+    if (gSplineParameterEnums.find(name) == gSplineParameterEnums.end()) {
+      gSplineParameterEnums[name] = gSplineParameterEnums.size() + 1 + offset;
+    }
+    this_enum = gSplineParameterEnums[name];
+  }
+
+  }
+
+  // If Not Enabled
+  if (this_enum == -2) {
+    ERR(FTL) << "RW Engine not supported for " << FitBase::ConvDialType(type) << std::endl;
+    ERR(FTL) << "Check dial " << name << std::endl;
+  }
+
+  // If Not Found
+  if (this_enum == -1) {
+    ERR(FTL) << "Dial " << name << " not found." << std::endl;
+  }
+
+  return this_enum;
+}
+
+
+
+
+
+
+
+
+
+int Reweight::ConvDialType(std::string type) {
+
+  if      (!type.compare("neut_parameter")) return kNEUT;
+  else if (!type.compare("niwg_parameter")) return kNIWG;
+  else if (!type.compare("nuwro_parameter")) return kNUWRO;
+  else if (!type.compare("t2k_parameter")) return kT2K;
+  else if (!type.compare("genie_parameter")) return kGENIE;
+  else if (!type.compare("norm_parameter")) return kNORM;
+  else if (!type.compare("modenorm_parameter")) return kMODENORM;
+  else if (!type.compare("custom_parameter")) return kCUSTOM;
+  else if (!type.compare("likeweight_parameter")) return kLIKEWEIGHT;
+  else if (!type.compare("spline_parameter")) return kSPLINEPARAMETER;
+  else return kUNKNOWN;
+
+}
+
+std::string Reweight::ConvDialType(int type) {
+
+  switch (type) {
+  case kNEUT:  { return "neut_parameter";  }
+  case kNIWG:  { return "niwg_parameter";  }
+  case kNUWRO: { return "nuwro_parameter"; }
+  case kT2K:   { return "t2k_parameter";   }
+  case kGENIE: { return "genie_parameter"; }
+  case kNORM:  { return "norm_parameter";  }
+  case kCUSTOM: {return "custom_parameter"; }
+
+  case kMODENORM: { return "modenorm_parameter"; }
+  case kLIKEWEIGHT: { return "likeweight_parameter"; }
+  case kSPLINEPARAMETER: {return "spline_parameter";}
+  default: return "unknown_parameter";
+  }
+
+}
+
+
+
+
+
+
+
+int Reweight::NEUTEnumFromName(std::string name) {
+#ifdef __NEUT_ENABLED__
+  int neutenum = (int)neut::rew::NSyst::FromString(name);
+  return (neutenum > 0) ? neutenum : kNoDialFound;
+#else
+  return kGeneratorNotBuilt;
+#endif
+}
+
+int Reweight::NIWGEnumFromName(std::string name) {
+#ifdef __NIWG_ENABLED__
+  int niwgenum = (int)niwg::rew::NIWGSyst::FromString(name);
+  return (niwgenum != 0) ? niwgenum : kNoDialFound;
+#else
+  return kGeneratorNotBuilt;
+#endif
+}
+
+int Reweight::NUWROEnumFromName(std::string name) {
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+  int nuwroenum = (int)nuwro::rew::NuwroSyst::FromString(name);
+  return (nuwroenum > 0) ? nuwroenum : kNoDialFound;
+#else
+  return kGeneratorNotBuilt;
+#endif
+}
+
+int Reweight::GENIEEnumFromName(std::string name) {
+#ifdef __GENIE_ENABLED__
+  int genieenum = (int)genie::rew::GSyst::FromString(name);
+  return (genieenum > 0) ? genieenum : kNoDialFound;
+#else
+  return kGeneratorNotBuilt;
+#endif
+}
+
+int Reweight::T2KEnumFromName(std::string name) {
+#ifdef __T2KREW_ENABLED__
+  int t2kenum = (int)t2krew::T2KSyst::FromString(name);
+  return (t2kenum > 0) ? t2kenum : kNoDialFound;
+#else
+  return kGeneratorNotBuilt;
+#endif
+}
+
+int Reweight::NUISANCEEnumFromName(std::string name, int type) {
+  int nuisenum = Reweight::DialList().EnumFromNameAndType(name, type);
+  return nuisenum;
+}
+
+int Reweight::CustomEnumFromName(std::string name) {
+  int custenum = Reweight::ConvertNUISANCEDial(name);
+  return custenum;
+}
+
+int Reweight::ConvDial(std::string name, std::string type, bool exceptions) {
+  return Reweight::ConvDial( name, Reweight::ConvDialType(type), exceptions );
+}
+
+int Reweight::ConvDial(std::string name, int type, bool exceptions) {
+
+  // Produce offset seperating each type.
+  int offset   = type * 1000;
+  int genenum = kNoDialFound;
+
+  switch (type) {
+
+  case kNEUT:
+    genenum = NEUTEnumFromName(name);
+    break;
+
+  case kNIWG:
+    genenum = NIWGEnumFromName(name);
+    break;
+
+  case kNUWRO:
+    genenum = NUWROEnumFromName(name);
+    break;
+
+  case kGENIE:
+    genenum = GENIEEnumFromName(name);
+    break;
+
+  case kT2K:
+    genenum = T2KEnumFromName(name);
+    break;
+
+  case kCUSTOM:
+    genenum = CustomEnumFromName(name);
+    break;
+
+  case kNORM:
+  case kMODENORM:
+  case kLIKEWEIGHT:
+  case kSPLINEPARAMETER:
+  case kNEWSPLINE:
+    genenum = NUISANCEEnumFromName(name, type);
+    break;
+
+  default:
+    genenum = kNoTypeFound;
+    break;
+
+  }
+
+  // Throw if required.
+  if (exceptions) {
+    // If Not Enabled
+    if (genenum == kGeneratorNotBuilt) {
+      ERR(FTL) << "RW Engine not supported for " << FitBase::ConvDialType(type) << std::endl;
+      ERR(FTL) << "Check dial " << name << std::endl;
+      throw;
+    }
+
+    // If no type enabled
+    if (genenum == kNoTypeFound) {
+      ERR(FTL) << "Type mismatch inside ConvDialEnum" << std::endl;
+      throw;
+    }
+
+    // If Not Found
+    if (genenum == kNoDialFound) {
+      ERR(FTL) << "Dial " << name << " not found." << std::endl;
+      throw;
+    }
+  }
+
+  // Add offset if no issue
+  int nuisenum = genenum;
+  if (genenum != kGeneratorNotBuilt and
+      genenum != kNoTypeFound and
+      genenum != kNoDialFound) {
+    nuisenum += offset;
+  }
+
+  // Now register dial
+  // std::cout << "Returning " << nuisenum << std::endl;
+  Reweight::DialList().RegisterDialEnum(name, type, nuisenum);
+
+  return nuisenum;
+}
+
+
+std::string Reweight::ConvDial(int nuisenum) {
+  //GlobalDialList* temp;
+  for (size_t i = 0; i < Reweight::DialList().fAllDialEnums.size(); i++) {
+    if (Reweight::DialList().fAllDialEnums[i] == nuisenum) {
+      return Reweight::DialList().fAllDialNames[i];
+    }
+  }
+
+  LOG(FIT) << "Cannot find dial with enum = " << nuisenum << std::endl;
+  return "";
+}
+
+
diff --git a/src/Reweight/WeightUtils.h b/src/Reweight/WeightUtils.h
new file mode 100644
index 0000000..352c230
--- /dev/null
+++ b/src/Reweight/WeightUtils.h
@@ -0,0 +1,143 @@
+#ifndef WEIGHTUTILS_H
+#define WEIGHTUTILS_H
+
+#include "FitLogger.h"
+#include "FitParameters.h"
+#include "FitEvent.h"
+#include "TF1.h"
+
+#ifdef __T2KREW_ENABLED__
+#include "T2KGenieReWeight.h"
+#include "T2KNIWGReWeight.h"
+#include "T2KNIWGUtils.h"
+#include "T2KNeutReWeight.h"
+#include "T2KNeutUtils.h"
+#include "T2KReWeight.h"
+using namespace t2krew;
+#endif
+
+#ifdef __NIWG_ENABLED__
+#include "NIWGReWeight.h"
+#include "NIWGReWeight1piAngle.h"
+#include "NIWGReWeight2010a.h"
+#include "NIWGReWeight2012a.h"
+#include "NIWGReWeight2014a.h"
+#include "NIWGReWeightDeltaMass.h"
+#include "NIWGReWeightEffectiveRPA.h"
+#include "NIWGReWeightHadronMultSwitch.h"
+#include "NIWGReWeightMEC.h"
+#include "NIWGReWeightPiMult.h"
+#include "NIWGReWeightProtonFSIbug.h"
+#include "NIWGReWeightRPA.h"
+#include "NIWGReWeightSpectralFunc.h"
+#include "NIWGReWeightSplineEnu.h"
+#include "NIWGSyst.h"
+#include "NIWGSystUncertainty.h"
+#endif
+
+#ifdef __NEUT_ENABLED__
+#include "NReWeight.h"
+#include "NReWeightCasc.h"
+#include "NReWeightNuXSecCCQE.h"
+#include "NReWeightNuXSecCCRES.h"
+#include "NReWeightNuXSecCOH.h"
+#include "NReWeightNuXSecDIS.h"
+#include "NReWeightNuXSecNC.h"
+#include "NReWeightNuXSecNCEL.h"
+#include "NReWeightNuXSecNCRES.h"
+#include "NReWeightNuXSecRES.h"
+#include "NReWeightNuclPiless.h"
+#include "NSyst.h"
+#include "NSystUncertainty.h"
+#include "neutpart.h"
+#include "neutvect.h"
+#endif
+
+#ifdef __NUWRO_ENABLED__
+#include "event1.h"
+#endif
+
+#ifdef __NUWRO_REWEIGHT_ENABLED__
+#include "NuwroReWeight.h"
+#include "NuwroReWeight_FlagNorm.h"
+#include "NuwroReWeight_QEL.h"
+#include "NuwroReWeight_SPP.h"
+#include "NuwroSyst.h"
+#include "NuwroSystUncertainty.h"
+#endif
+
+#ifdef __GENIE_ENABLED__
+#include "EVGCore/EventRecord.h"
+#include "EVGCore/EventRecord.h"
+#include "GHEP/GHepRecord.h"
+#include "GSyst.h"
+#include "GSystUncertainty.h"
+#include "Ntuple/NtpMCEventRecord.h"
+#include "ReWeight/GReWeight.h"
+#include "ReWeight/GReWeightAGKY.h"
+#include "ReWeight/GReWeightDISNuclMod.h"
+#include "ReWeight/GReWeightFGM.h"
+#include "ReWeight/GReWeightFZone.h"
+#include "ReWeight/GReWeightINuke.h"
+#include "ReWeight/GReWeightNonResonanceBkg.h"
+#include "ReWeight/GReWeightNuXSecCCQE.h"
+#include "ReWeight/GReWeightNuXSecCCQEvec.h"
+#include "ReWeight/GReWeightNuXSecCCRES.h"
+#include "ReWeight/GReWeightNuXSecCOH.h"
+#include "ReWeight/GReWeightNuXSecDIS.h"
+#include "ReWeight/GReWeightNuXSecNC.h"
+#include "ReWeight/GReWeightNuXSecNCEL.h"
+#include "ReWeight/GReWeightNuXSecNCRES.h"
+#include "ReWeight/GReWeightResonanceDecay.h"
+using namespace genie;
+using namespace genie::rew;
+#endif
+#include "NUISANCESyst.h"
+#include "GlobalDialList.h"
+
+namespace FitBase {
+
+TF1 GetRWConvFunction(std::string type, std::string name);
+std::string GetRWUnits(std::string type, std::string name);
+
+double RWSigmaToFrac(std::string type, std::string name, double val);
+double RWSigmaToAbs(std::string type, std::string name, double val);
+double RWAbsToSigma(std::string type, std::string name, double val);
+double RWFracToSigma(std::string type, std::string name, double val);
+
+ int ConvDialType(std::string type);
+ std::string ConvDialType(int type);
+ int GetDialEnum(std::string type, std::string name);
+ int GetDialEnum(int type, std::string name);
+ static std::map<std::string, int> gNormEnums;
+ static std::map<std::string, int> gLikeWeightEnums;
+ static std::map<std::string, int> gSplineParameterEnums;
+}
+
+
+namespace Reweight {
+
+	int ConvDial(std::string name, std::string type, bool exceptions=false);
+	int ConvDial(std::string name, int type, bool exceptions=false);
+	std::string ConvDial(int nuisenum);
+
+    int ConvDialType(std::string type);
+    std::string ConvDialType(int type);
+
+	int NEUTEnumFromName(std::string name);
+	int NIWGEnumFromName(std::string name);
+	int NUWROEnumFromName(std::string name);
+	int T2KEnumFromName(std::string name);
+	int GENIEEnumFromName(std::string name);
+	int CustomEnumFromName(std::string name); 
+	
+	int NUISANCEEnumFromName(std::string name, int type);
+
+	static const int kNoDialFound       = -1;
+	static const int kNoTypeFound       = -2;
+	static const int kGeneratorNotBuilt = -3;
+}
+
+
+
+#endif
diff --git a/src/Routines/._CMakeLists.txt~ b/src/Routines/._CMakeLists.txt~
new file mode 100644
index 0000000..89a44f4
Binary files /dev/null and b/src/Routines/._CMakeLists.txt~ differ
diff --git a/src/Routines/CMakeLists.txt b/src/Routines/CMakeLists.txt
index c742d40..342cc29 100644
--- a/src/Routines/CMakeLists.txt
+++ b/src/Routines/CMakeLists.txt
@@ -1,68 +1,71 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 ComparisonRoutines.cxx
 SystematicRoutines.cxx
 SplineRoutines.cxx
 )
 
 if(USE_MINIMIZER)
   set(IMPLFILES ${IMPLFILES};MinimizerRoutines.cxx)
 endif()
 
 set(HEADERFILES
 ComparisonRoutines.h
 SystematicRoutines.h
 SplineRoutines.h
 )
 
 if(USE_MINIMIZER)
   set(HEADERFILES ${HEADERFILES};MinimizerRoutines.h)
 endif()
 
 set(LIBNAME Routines)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 include_directories(${EXP_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/FCN)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/MCStudies)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/Routines/ComparisonRoutines.cxx b/src/Routines/ComparisonRoutines.cxx
index 386cd7d..b0e3b21 100755
--- a/src/Routines/ComparisonRoutines.cxx
+++ b/src/Routines/ComparisonRoutines.cxx
@@ -1,718 +1,531 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#include "StatusMessage.h"
-
 #include "ComparisonRoutines.h"
 
 /*
   Constructor/Destructor
 */
 //************************
 void ComparisonRoutines::Init() {
-  //************************
-
-  fInputFile = "";
-  fInputRootFile = NULL;
+//************************
 
   fOutputFile = "";
   fOutputRootFile = NULL;
 
   fStrategy = "Compare";
+
   fRoutines.clear();
 
   fCardFile = "";
 
   fFakeDataInput = "";
 
   fSampleFCN = NULL;
 
   fAllowedRoutines = ("Compare");
+  
 };
 
 //*************************************
-ComparisonRoutines::~ComparisonRoutines(){
-    //*************************************
+ComparisonRoutines::~ComparisonRoutines() {
+//*************************************
 };
 
+
+
 /*
   Input Functions
 */
 //*************************************
 ComparisonRoutines::ComparisonRoutines(int argc, char* argv[]) {
-  //*************************************
+//*************************************
 
-  // Set everything to defaults
+  // Initialise Defaults
   Init();
-  std::vector<std::string> configs_cmd;
-  std::string maxevents_flag = "";
-  int verbosity_flag = 0;
-  int error_flag = 0;
-
-  // If No Arguments print commands
-  for (int i = 1; i < argc; ++i) {
-    if (i + 1 != argc) {
-      // Cardfile
-      if (!std::strcmp(argv[i], "-c")) {
-        fCardFile = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-o")) {
-        fOutputFile = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-f")) {
-        fStrategy = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-q")) {
-        configs_cmd.push_back(argv[i + 1]);
-        ++i;
-      } else if (!std::strcmp(argv[i], "-n")) {
-        maxevents_flag = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-v")) {
-        verbosity_flag -= 1;
-      } else if (!std::strcmp(argv[i], "+v")) {
-        verbosity_flag += 1;
-      } else if (!std::strcmp(argv[i], "-e")) {
-        error_flag -= 1;
-      } else if (!std::strcmp(argv[i], "+e")) {
-        error_flag += 1;
-      } else {
-        ERR(FTL) << "ERROR: unknown command line option given! - '" << argv[i]
-                 << " " << argv[i + 1] << "'" << std::endl;
-        throw;
-      }
-    }
-  }
-
-  if (fCardFile.empty()) {
-    ERR(FTL) << "ERROR: card file not specified." << std::endl;
-    ERR(FTL) << "Run with '-h' to see options." << std::endl;
+  nuisconfig configuration = Config::Get();
+
+  // Default containers
+  std::string cardfile = "";
+  std::string maxevents = "-1";
+  int errorcount = 0;
+  int verbocount = 0;
+  std::vector<std::string> xmlcmds;
+  std::vector<std::string> configargs;
+
+  // Make easier to handle arguments.
+  std::vector<std::string> args = GeneralUtils::LoadCharToVectStr(argc, argv);
+  ParserUtils::ParseArgument(args, "-c", fCardFile, true);
+  ParserUtils::ParseArgument(args, "-o", fOutputFile, false, false);
+  ParserUtils::ParseArgument(args, "-n", maxevents, false, false);
+  ParserUtils::ParseArgument(args, "-f", fStrategy, false, false);
+  ParserUtils::ParseArgument(args, "-d", fFakeDataInput, false, false);
+  ParserUtils::ParseArgument(args, "-i", xmlcmds);
+  ParserUtils::ParseArgument(args, "-q", configargs);
+  ParserUtils::ParseCounter(args, "e", errorcount);
+  ParserUtils::ParseCounter(args, "v", verbocount);
+  ParserUtils::CheckBadArguments(args);
+
+  // Add extra defaults if none given
+  if (fCardFile.empty() and xmlcmds.empty()) {
+    ERR(FTL) << "No input supplied!" << std::endl;
     throw;
   }
 
-  if (fOutputFile.empty()) {
-    ERR(WRN) << "WARNING: output file not specified." << std::endl;
-    ERR(WRN) << "Using " << fCardFile << ".root" << std::endl;
+  if (fOutputFile.empty() and !fCardFile.empty()) {
     fOutputFile = fCardFile + ".root";
-  }
+    ERR(WRN) << "No output supplied so saving it to: " << fOutputFile << std::endl;
 
-  if (fCardFile == fOutputFile) {
-    ERR(WRN) << "WARNING: output file and card file are the same file, "
-                "writing: "
-             << fCardFile << ".root" << std::endl;
-    fOutputFile = fCardFile + ".root";
+  } else if (fOutputFile.empty()) {
+    ERR(FTL) << "No output file or cardfile supplied!" << std::endl;
+    throw;
   }
 
-  // Fill fit routines and check they are good
-  fRoutines = GeneralUtils::ParseToStr(fStrategy, ",");
-  for (UInt_t i = 0; i < fRoutines.size(); i++) {
-    if (fAllowedRoutines.find(fRoutines[i]) == std::string::npos) {
-      ERR(FTL) << "Unknown fit routine given! "
-               << "Must be provided as a comma seperated list." << std::endl;
-      ERR(FTL) << "Allowed Routines: " << fAllowedRoutines << std::endl;
-      throw;
-    }
+  // Configuration Setup =============================
+
+  // Check no comp key is available
+  nuiskey fCompKey;
+  if (Config::Get().GetNodes("nuiscomp").empty()) {
+    fCompKey = Config::Get().CreateNode("nuiscomp");
+  } else {
+    fCompKey = Config::Get().GetNodes("nuiscomp")[0];
   }
 
-  // CONFIG
-  // ---------------------------
-  std::string par_dir = GeneralUtils::GetTopLevelDir() + "/parameters/";
-  FitPar::Config().ReadParamFile(par_dir + "config.list.dat");
-  FitPar::Config().ReadParamFile(fCardFile);
+  if (!fCardFile.empty())   fCompKey.AddS("cardfile", fCardFile);
+  if (!fOutputFile.empty()) fCompKey.AddS("outputfile", fOutputFile);
+  if (!fStrategy.empty())   fCompKey.AddS("strategy", fStrategy);
 
-  for (UInt_t iter = 0; iter < configs_cmd.size(); iter++) {
-    FitPar::Config().ForceParam(configs_cmd[iter]);
-  }
+  // Load XML Cardfile
+  configuration.LoadConfig( fCompKey.GetS("cardfile"), "");
 
-  if (!maxevents_flag.empty()) {
-    FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
+  // Add CMD XML Structs
+  for (size_t i = 0; i < xmlcmds.size(); i++) {
+    configuration.AddXMLLine(xmlcmds[i]);
   }
 
-  if (verbosity_flag != 0) {
-    int curverb = FitPar::Config().GetParI("VERBOSITY");
-    FitPar::Config().SetParI("VERBOSITY", curverb + verbosity_flag);
+  // Add Config Args
+  for (size_t i = 0; i < configargs.size(); i++) {
+    configuration.OverrideConfig(configargs[i]);
   }
-
-  if (error_flag != 0) {
-    int curwarn = FitPar::Config().GetParI("ERROR");
-    FitPar::Config().SetParI("ERROR", curwarn + error_flag);
+  if (maxevents.compare("-1")){
+    configuration.OverrideConfig("MAXEVENTS=" + maxevents);
   }
 
-  LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
-  ERR_VERB(FitPar::Config().GetParI("ERROR"));
+  // Finish configuration XML
+  configuration.FinaliseConfig(fCompKey.GetS("outputfile") + ".xml");
 
-  // CARD
-  // ---------------------------
-  // Parse Card Options
-  ReadCard(fCardFile);
+  // Add Error Verbo Lines
+  verbocount += Config::Get().GetParI("VERBOSITY");
+  errorcount += Config::Get().GetParI("ERROR");
+  bool trace = Config::Get().GetParB("TRACE");
+  std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+  std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+  SETVERBOSITY(verbocount);
+  SETTRACE(trace);
 
-  // Outputs
-  // ---------------------------
-  // Save Configs to output file
-  fOutputRootFile = new TFile(fOutputFile.c_str(), "RECREATE");
-  FitPar::Config().Write();
+  // Comparison Setup ========================================
+
+  // Proper Setup
+  fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
+  SetupComparisonsFromXML();
 
-  // Starting Setup
-  // ---------------------------
   SetupRWEngine();
   SetupFCN();
 
   return;
 };
 
 //*************************************
-void ComparisonRoutines::ReadCard(std::string cardfile) {
-  //*************************************
+void ComparisonRoutines::SetupComparisonsFromXML() {
+//*************************************
 
-  // Read cardlines into vector
-  std::vector<std::string> cardlines =
-      GeneralUtils::ParseFileToStr(cardfile, "\n");
-  FitPar::Config().cardLines = cardlines;
-
-  // Read Samples first (norm params can be overridden)
-  int linecount = 0;
-  for (std::vector<std::string>::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;
-
-    // Read Valid Samples
-    int samstatus = ReadSamples(line);
-
-    // Show line if bad to help user
-    if (samstatus == kErrorStatus) {
-      ERR(FTL) << "Bad Input in cardfile " << fCardFile << " at line "
-               << linecount << "!" << endl;
-      ERR(FTL) << line << endl;
-      throw;
-    }
-  }
+  LOG(FIT) << "Setting up nuiscomp" << std::endl;
 
-  // Read Parameters second
-  linecount = 0;
-  for (std::vector<std::string>::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;
-
-    // Try Parameter Reads
-    int parstatus = ReadParameters(line);
-    int fakstatus = ReadFakeDataPars(line);
-
-    // Show line if bad to help user
-    if (parstatus == kErrorStatus || fakstatus == kErrorStatus) {
-      ERR(FTL) << "Bad Parameter Input in cardfile " << fCardFile << " at line "
-               << linecount << "!" << endl;
-      ERR(FTL) << line << endl;
-      throw;
-    }
+  // Setup Parameters ------------------------------------------
+  std::vector<nuiskey> parkeys = Config::QueryKeys("parameter");
+  if (!parkeys.empty()) {
+    LOG(FIT) << "Number of parameters :  " << parkeys.size() << std::endl;
   }
 
-  return;
-};
+  for (size_t i = 0; i < parkeys.size(); i++) {
+    nuiskey key = parkeys.at(i);
 
-//*****************************************
-int ComparisonRoutines::ReadParameters(std::string parstring) {
-  //******************************************
-
-  std::string inputspec =
-      "RW Dial Inputs Syntax \n"
-      "free input w/ limits: TYPE  NAME  START  MIN  MAX  STEP  [STATE] \n"
-      "fix  input: TYPE  NAME  VALUE  [STATE] \n"
-      "free input w/o limits: TYPE  NAME  START  FREE,[STATE] \n"
-      "Allowed Types: \n"
-      "neut_parameter,niwg_parameter,t2k_parameter,"
-      "nuwro_parameter,gibuu_parameter";
-
-  // Check sample input
-  if (parstring.find("parameter") == std::string::npos) return kGoodStatus;
-
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
-
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' ||
-      strvct[0].find("parameter") == std::string::npos) {
-    return kGoodStatus;
-  }
+    // Check for type,name,nom
+    if (!key.Has("type")) {
+      ERR(FTL) << "No type given for parameter " << i << std::endl;
+      ERR(FTL) << "type='PARAMETER_TYPE'" << std::endl;
+      throw;
+    } else if (!key.Has("name")) {
+      ERR(FTL) << "No name given for parameter " << i << std::endl;
+      ERR(FTL) << "name='SAMPLE_NAME'" << std::endl;
+      throw;
+    } else if (!key.Has("nominal")) {
+      ERR(FTL) << "No nominal given for parameter " << i << std::endl;
+      ERR(FTL) << "nominal='NOMINAL_VALUE'" << std::endl;
+      throw;
+    }
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "Input rw dials need to provide at least 3 inputs."
-             << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // 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;
+    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){
+      ERR(FTL) << "Incomplete limit set given for parameter : " << parname << std::endl;
+      ERR(FTL) << "Requires: low='LOWER_LIMIT' high='UPPER_LIMIT' step='STEP_SIZE' " << std::endl;
+      throw;
+    }
 
-  // Setup default inputs
-  std::string partype = strvct[0];
-  std::string parname = strvct[1];
-  double parval = GeneralUtils::StrToDbl(strvct[2]);
-  std::string state = "FIX";  //[DEFAULT]
-
-  // Check Type
-  if (FitBase::ConvDialType(partype) == kUNKNOWN) {
-    ERR(FTL) << "Unknown parameter type! " << partype << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Extra limits
+    if (key.Has("low")) {
+
+      parlow  = key.GetD("low");
+      parhigh = key.GetD("high");
+      parstep = key.GetD("step");
+
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parlow << " < p < " << parhigh
+               << " : " << parstate << std::endl;
+    } else {
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parstate << std::endl;
+    }
 
-  // Check Parameter Name
-  if (FitBase::GetDialEnum(partype, parname) == -1) {
-    ERR(FTL) << "Bad RW parameter name! " << partype << " " << parname << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // 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 );
+    }
 
-  // Option Extra (No Limits)
-  if (strvct.size() == 4) {
-    state = strvct[3];
-  }
+    // Push into vectors
+    fParams.push_back(parname);
 
-  // Run Parameter Conversion if needed
-  if (state.find("ABS") != std::string::npos) {
-    parval = FitBase::RWAbsToSigma(partype, parname, parval);
-  } else if (state.find("FRAC") != std::string::npos) {
-    parval = FitBase::RWFracToSigma(partype, parname, parval);
-  }
+    fTypeVals[parname]  = FitBase::ConvDialType(partype);;
+    fCurVals[parname]   = parnom;
+    fStateVals[parname] = parstate;
 
-  // Check no repeat params
-  if (std::find(fParams.begin(), fParams.end(), parname) != fParams.end()) {
-    ERR(FTL) << "Duplicate parameter names given for " << parname << endl;
-    throw;
   }
 
-  // Setup Containers
-  fParams.push_back(parname);
-
-  fTypeVals[parname] = FitBase::ConvDialType(partype);
-  fCurVals[parname] = parval;
-  fStateVals[parname] = state;
-
-  // Print the parameter
-  LOG(MIN) << "Read Parameter " << parname << " " << parval << " " << state
-           << std::endl;
-
-  // Tell reader its all good
-  return kGoodStatus;
-}
-
-//*******************************************
-int ComparisonRoutines::ReadFakeDataPars(std::string parstring) {
-  //******************************************
-
-  std::string inputspec =
-      "Fake Data Dial Inputs Syntax \n"
-      "fake value: fake_parameter  NAME  VALUE  \n"
-      "Name should match dialnames given in actual dial specification.";
-
-  // Check sample input
-  if (parstring.find("fake_parameter") == std::string::npos) return kGoodStatus;
-
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
-
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' || strvct[0] == "fake_parameter") {
-    return kGoodStatus;
+  // Setup Samples ----------------------------------------------
+  std::vector<nuiskey> samplekeys =  Config::QueryKeys("sample");
+  if (!samplekeys.empty()) {
+    LOG(FIT) << "Number of samples : " << samplekeys.size() << std::endl;
   }
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "Fake dials need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+  for (size_t i = 0; i < samplekeys.size(); i++) {
+    nuiskey key = samplekeys.at(i);
 
-  // Read Inputs
-  std::string parname = strvct[1];
-  double parval = GeneralUtils::StrToDbl(strvct[2]);
+    // Get Sample Options
+    std::string samplename = key.GetS("name");
+    std::string samplefile = key.GetS("input");
 
-  // Setup Container
-  fFakeVals[parname] = parval;
+    std::string sampletype =
+      key.Has("type") ? key.GetS("type") : "DEFAULT";
 
-  // Print the fake parameter
-  LOG(MIN) << "Read Fake Parameter " << parname << " " << parval << std::endl;
+    double samplenorm =
+      key.Has("norm") ? key.GetD("norm") : 1.0;
 
-  // Tell reader its all good
-  return kGoodStatus;
-}
+    // Print out
+    LOG(FIT) << "Read Sample " << i << ". : "
+             << samplename << " (" << sampletype << ") [Norm=" << samplenorm<<"]"<< std::endl
+             << "                                -> input='" << samplefile  << "'" << std::endl;
 
-//******************************************
-int ComparisonRoutines::ReadSamples(std::string samstring) {
-  //******************************************
+    // If FREE add to parameters otherwise continue
+    if (sampletype.find("FREE") == std::string::npos) {
+      continue;
+    }
 
-  const static std::string inputspec =
-      "\tsample <sample_name> <input_type>:inputfile.root [OPTS] "
-      "[norm]\nsample_name: Name "
-      "of sample to include. e.g. MiniBooNE_CCQE_XSec_1DQ2_nu\ninput_type: The "
-      "input event format. e.g. NEUT, GENIE, EVSPLN, ...\nOPTS: Additional, "
-      "optional sample options.\nnorm: Additional, optional sample "
-      "normalisation factor.";
+    // Form norm dial from samplename + sampletype + "_norm";
+    std::string normname = samplename + sampletype + "_norm";
 
-  // Check sample input
-  if (samstring.find("sample") == std::string::npos) return kGoodStatus;
+    // Check normname not already present
+    if (fTypeVals.find("normname") != fTypeVals.end()) {
+      continue;
+    }
 
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(samstring, " ");
+    // Add new norm dial to list if its passed above checks
+    fParams.push_back(normname);
 
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' || strvct[0] != "sample") {
-    return kGoodStatus;
-  }
+    fTypeVals[normname] = kNORM;
+    fStateVals[normname] = sampletype;
+    fCurVals[normname] = samplenorm;
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "Sample need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
   }
 
-  // Setup default inputs
-  std::string samname = strvct[1];
-  std::string samfile = strvct[2];
-
-  if (samfile == "FIX") {
-    ERR(FTL) << "Input filename was \"FIX\", this line is probably malformed "
-                "in the input card file. Line:\'"
-             << samstring << "\'" << std::endl;
-    ERR(FTL) << "Expect sample lines to look like:\n\t" << inputspec
-             << std::endl;
-
-    throw;
+  // Setup Fake Parameters -----------------------------
+  std::vector<nuiskey> fakekeys = Config::QueryKeys("fakeparameter");
+  if (!fakekeys.empty()) {
+    LOG(FIT) << "Number of fake parameters : " << fakekeys.size() << std::endl;
   }
 
-  std::string samtype = "DEFAULT";
-  double samnorm = 1.0;
-
-  // Optional Type
-  if (strvct.size() > 3) {
-    samtype = strvct[3];
-    // Append the sample type to the normalsiation name
-    //    samname += "_"+samtype;
-    // Also get rid of the / and replace it with underscore because it might not be supported character
-    //    while (samname.find("/") != std::string::npos) {
-    //      samname.replace(samname.find("/"), 1, std::string("_"));
-    //    }
-  }
+  for (size_t i = 0; i < fakekeys.size(); i++) {
+    nuiskey key = fakekeys.at(i);
 
-  // Optional Norm
-  if (strvct.size() > 4) samnorm = GeneralUtils::StrToDbl(strvct[4]);
+    // Check for type,name,nom
+    if (!key.Has("name")) {
+      ERR(FTL) << "No name given for fakeparameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("nominal")) {
+      ERR(FTL) << "No nominal given for fakeparameter " << i << std::endl;
+      throw;
+    }
 
-  // Add Sample Names as Norm Dials
-  std::string normname = samname + "_norm";
+    // Get Inputs
+    std::string parname = key.GetS("name");
+    double parnom  = key.GetD("nominal");
 
-  // Now match and check there are no repeated parameter names
-  if (std::find(fParams.begin(), fParams.end(), normname) != fParams.end()) {
-    ERR(FTL) << "Duplicate samples given for " << samname << endl;
-    throw;
+    // Push into vectors
+    fFakeVals[parname] = parnom;
   }
-
-  fParams.push_back(normname);
-
-  fTypeVals[normname] = kNORM;
-  fStateVals[normname] = samtype;
-  fCurVals[normname] = samnorm;
-
-  // Print read in
-  LOG(MIN) << "Read sample " << samname << " " << samfile << " " << samtype
-           << " " << samnorm << endl;
-
-  // Tell reader its all good
-  return kGoodStatus;
 }
 
-/*
-  Setup Functions
-*/
 //*************************************
 void ComparisonRoutines::SetupRWEngine() {
-  //*************************************
+//*************************************
 
+  LOG(FIT) << "Setting up FitWeight Engine" << std::endl;
   for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string name = fParams[i];
     FitBase::GetRW()->IncludeDial(name, fTypeVals.at(name));
   }
 
   return;
 }
 
 //*************************************
 void ComparisonRoutines::SetupFCN() {
   //*************************************
 
-  LOG(FIT) << "Making the jointFCN" << std::endl;
+  LOG(FIT) << "Building the SampleFCN" << std::endl;
   if (fSampleFCN) delete fSampleFCN;
-  fSampleFCN = new JointFCN(fCardFile, fOutputRootFile);
+  FitPar::Config().out = fOutputRootFile;
+  fOutputRootFile->cd();
+  fSampleFCN = new JointFCN(fOutputRootFile);
   SetFakeData();
 
   return;
 }
 
 //*************************************
 void ComparisonRoutines::SetFakeData() {
-  //*************************************
+//*************************************
 
   if (fFakeDataInput.empty()) return;
 
   if (fFakeDataInput.compare("MC") == 0) {
     LOG(FIT) << "Setting fake data from MC starting prediction." << std::endl;
     UpdateRWEngine(fFakeVals);
 
     FitBase::GetRW()->Reconfigure();
     fSampleFCN->ReconfigureAllEvents();
     fSampleFCN->SetFakeData("MC");
 
     UpdateRWEngine(fCurVals);
 
     LOG(FIT) << "Set all data to fake MC predictions." << std::endl;
   } else {
+    LOG(FIT) << "Setting fake data from: " << fFakeDataInput << std::endl;
     fSampleFCN->SetFakeData(fFakeDataInput);
   }
 
   return;
 }
 
 /*
   Fitting Functions
 */
 //*************************************
 void ComparisonRoutines::UpdateRWEngine(
-    std::map<std::string, double>& updateVals) {
+  std::map<std::string, double>& updateVals) {
   //*************************************
 
   for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string name = fParams[i];
 
     if (updateVals.find(name) == updateVals.end()) continue;
     FitBase::GetRW()->SetDialValue(name, updateVals.at(name));
   }
 
   FitBase::GetRW()->Reconfigure();
   return;
 }
 
 //*************************************
 void ComparisonRoutines::Run() {
-  //*************************************
+//*************************************
+
+  LOG(FIT) << "Running ComparisonRoutines : " << fStrategy << std::endl;
+
+  if (FitPar::Config().GetParB("save_nominal")) {
+    SaveNominal();
+  }
+
+  // Parse given routines
+  fRoutines = GeneralUtils::ParseToStr(fStrategy, ",");
+  if (fRoutines.empty()) {
+    ERR(FTL) << "Trying to run ComparisonRoutines with no routines given!" << std::endl;
+    throw;
+  }
 
   for (UInt_t i = 0; i < fRoutines.size(); i++) {
     std::string routine = fRoutines.at(i);
-    // int fitstate = kFitUnfinished;
 
-    LOG(FIT) << "Running Routine: " << routine << std::endl;
-    if (routine == "Compare") {
+    LOG(FIT) << "Routine: " << routine << std::endl;
+    if (!routine.compare("Compare")) {
       UpdateRWEngine(fCurVals);
       GenerateComparison();
       PrintState();
+      SaveCurrentState();
     }
   }
 
+
+
   return;
 }
 
 //*************************************
 void ComparisonRoutines::GenerateComparison() {
   //*************************************
-
+  LOG(FIT) << "Generating Comparison." << std::endl;
   // Main Event Loop from event Manager
-  bool using_evtmanager = FitPar::Config().GetParB("EventManager");
-
-  if (using_evtmanager and false) {
-    LOG(FIT) << "Using Comparison Routines Event Manager" << endl;
-
-    std::list<MeasurementBase*> samchain = fSampleFCN->GetSampleList();
-    std::list<MeasurementBase*>::const_iterator iterSam = samchain.begin();
-
-    std::map<int, InputHandler*> fInputs = FitBase::EvtManager().GetInputs();
-    std::map<int, InputHandler*>::const_iterator iterInp = fInputs.begin();
-
-    int timestart = time(NULL);
-
-    for (; iterInp != fInputs.end(); iterInp++) {
-      int input_id = (iterInp->first);
-      InputHandler* cur_input = (iterInp->second);
-      FitEvent* cust_event = cur_input->GetEventPointer();
-      int fNEvents = cur_input->GetNEvents();
-      int countwidth = (fNEvents / 10);
-
-      // MAIN EVENT LOOP
-      for (int i = 0; i < fNEvents; i++) {
-        // Get Event from input list
-        cust_event = FitBase::EvtManager().GetEvent(input_id, i);
-
-        // Get Weight
-        double Weight = (FitBase::GetRW()->CalcWeight(cust_event) *
-                         cust_event->InputWeight);
-
-        // Skip if dodgy weight
-        if (fabs(cust_event->Mode) > 60 || cust_event->Mode == 0 ||
-            Weight > 200.0 || Weight <= 0.0)
-          continue;
-
-        // Loop over samples and fill histograms
-        iterSam = samchain.begin();
-        for (; iterSam != samchain.end(); iterSam++) {
-          MeasurementBase* exp = (*iterSam);
-          if (exp->GetInputID() != input_id) continue;
-
-          exp->FillEventVariables(cust_event);
-          exp->SetMode(cust_event->Mode);
-          exp->SetSignal(cust_event);
-          exp->SetWeight(Weight);
-          exp->FillHistograms();
-        }
-
-        // Print Out
-        if (LOG_LEVEL(REC) and i % countwidth == 0)
-          LOG(REC) << "Reconfigured " << i << " total events. W=" << Weight
-                   << std::endl;
-      }
-    }
-
-    // Convert Binned events
-    iterSam = samchain.begin();
-    for (; iterSam != samchain.end(); iterSam++) {
-      MeasurementBase* exp = (*iterSam);
-      exp->ConvertEventRates();
-    }
+  fSampleFCN->ReconfigureAllEvents();
+  return;
 
-    LOG(FIT) << "Time Taken = " << time(NULL) - timestart << std::endl;
-    LOG(FIT) << "Finished reconfiguring all events" << std::endl;
-  } else {
-    fSampleFCN->ReconfigureAllEvents();
-  }
 }
 
 //*************************************
 void ComparisonRoutines::PrintState() {
   //*************************************
   LOG(FIT) << "------------" << std::endl;
 
   // Count max size
   int maxcount = 0;
   for (UInt_t i = 0; i < fParams.size(); i++) {
     maxcount = max(int(fParams[i].size()), maxcount);
   }
 
   // Header
   LOG(FIT) << " #    " << left << setw(maxcount) << "Parameter "
            << " = " << setw(10) << "Value"
            << " +- " << setw(10) << "Error"
            << " " << setw(8) << "(Units)"
            << " " << setw(10) << "Conv. Val"
            << " +- " << setw(10) << "Conv. Err"
            << " " << setw(8) << "(Units)" << std::endl;
 
   // Parameters
   for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams.at(i);
 
     std::string typestr = FitBase::ConvDialType(fTypeVals[syst]);
     std::string curunits = "(sig.)";
     double curval = fCurVals[syst];
     double curerr = 0.0;
 
     if (fStateVals[syst].find("ABS") != std::string::npos) {
       curval = FitBase::RWSigmaToAbs(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
                 FitBase::RWSigmaToAbs(typestr, syst, 0.0));
       curunits = "(Abs.)";
     } else if (fStateVals[syst].find("FRAC") != std::string::npos) {
       curval = FitBase::RWSigmaToFrac(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToFrac(typestr, syst, curerr) -
                 FitBase::RWSigmaToFrac(typestr, syst, 0.0));
       curunits = "(Frac)";
     }
 
     std::string convunits = "(" + FitBase::GetRWUnits(typestr, syst) + ")";
     double convval = FitBase::RWSigmaToAbs(typestr, syst, curval);
     double converr = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
                       FitBase::RWSigmaToAbs(typestr, syst, 0.0));
 
     std::ostringstream curparstring;
 
     curparstring << " " << setw(3) << left << i << ". " << setw(maxcount)
                  << syst << " = " << setw(10) << curval << " +- " << setw(10)
                  << curerr << " " << setw(8) << curunits << " " << setw(10)
                  << convval << " +- " << setw(10) << converr << " " << setw(8)
                  << convunits;
 
-    LOG(FIT) << curparstring.str() << endl;
+    LOG(FIT) << curparstring.str() << std::endl;
   }
 
   LOG(FIT) << "------------" << std::endl;
   double like = fSampleFCN->GetLikelihood();
-  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << endl;
+  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << std::endl;
   LOG(FIT) << "------------" << std::endl;
 }
 
 /*
   Write Functions
 */
 //*************************************
 void ComparisonRoutines::SaveCurrentState(std::string subdir) {
-  //*************************************
+//*************************************
 
   LOG(FIT) << "Saving current full FCN predictions" << std::endl;
 
   // Setup DIRS
   TDirectory* curdir = gDirectory;
   if (!subdir.empty()) {
     TDirectory* newdir = (TDirectory*)gDirectory->mkdir(subdir.c_str());
     newdir->cd();
   }
 
   fSampleFCN->Write();
 
   // Change back to current DIR
   curdir->cd();
 
   return;
 }
 
 //*************************************
 void ComparisonRoutines::SaveNominal() {
   //*************************************
 
   fOutputRootFile->cd();
 
   LOG(FIT) << "Saving Nominal Predictions (be cautious with this)" << std::endl;
   FitBase::GetRW()->Reconfigure();
   GenerateComparison();
   SaveCurrentState("nominal");
 };
 
-/*
-  MISC Functions
-*/
-//*************************************
-int ComparisonRoutines::GetStatus() {
-  //*************************************
 
-  return 0;
-}
diff --git a/src/Routines/ComparisonRoutines.h b/src/Routines/ComparisonRoutines.h
index e42714a..701481c 100755
--- a/src/Routines/ComparisonRoutines.h
+++ b/src/Routines/ComparisonRoutines.h
@@ -1,184 +1,168 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef COMPARISON_ROUTINES_H
 #define COMPARISON_ROUTINES_H
-
-/*!
- *  \addtogroup Minimizer
- *  @{
- */
+/*! \addtogroup Routines @{ */
 
 #include "TH1.h"
 #include "TF1.h"
 #include "TMatrixD.h"
 #include "TVectorD.h"
 #include "TSystem.h"
 #include "TFile.h"
 #include "TProfile.h"
 
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 #include "FitEvent.h"
 #include "JointFCN.h"
 #include "FitParameters.h"
 #include "GeneralUtils.h"
-
+#include "NuisConfig.h"
+#include "NuisKey.h"
 #include "FitLogger.h"
+#include "ParserUtils.h"
 
 enum minstate {
   kErrorStatus = -1,
   kGoodStatus,
   kFitError,
   kNoChange,
   kFitFinished,
   kFitUnfinished,
   kStateChange,
 };
 
 //*************************************
-//! Collects all possible fit routines into a single class to avoid repeated code
-class ComparisonRoutines{
+/// Collects all possible fit routines into a single class to avoid repeated code
+class ComparisonRoutines {
 //*************************************
 
 public:
 
   /*
     Constructor/Destructor
   */
 
-  //! Constructor reads in arguments given at the command line for the fit here.
+  /// Constructor reads in arguments given at the command line for the fit here.
   ComparisonRoutines(int argc, char* argv[]);
     
-  //! Default destructor
+  /// Default destructor
   ~ComparisonRoutines();
 
-  //! Reset everything to default/NULL
+  /// Reset everything to default/NULL
   void Init();
   
   /*
     Input Functions
   */
 
-  //! Sorts out configuration and verbosity right at the very start.
-  //! Calls readCard to set everything else up.
-  void InitialSetup();
-
-  //! Loops through each line of the card file and passes it to other read functions
-  void ReadCard(std::string cardfile);
-
-  //! Check for parameter string in the line and assign the correct type.
-  //! Fills maps for each of the parameters
-  int ReadParameters(std::string parstring);
-
-  //! Reads in fake parameters and assigns them (Requires the parameter to be included as a normal parameter as well)
-  int ReadFakeDataPars(std::string parstring);
-
-  //! Read in the samples so we can set up the free normalisation dials if required
-  int ReadSamples(std::string sampleString);
+  /// Queries configuration keys to setup Parameters/Samples/FakeParameters
+  void SetupComparisonsFromXML();
 
   /*
     Setup Functions
   */
 
-  //! Setup the configuration given the arguments passed at the commandline and card file
-  void SetupConfig();
-
-  //! Setups up our custom RW engine with all the parameters passed in the card file
+  /// Setups up our custom RW engine with all the parameters passed in the card file
   void SetupRWEngine();
 
-  //! Setups up the jointFCN.
+  /// Setups up the jointFCN.
   void SetupFCN();
 
-  //! Set the current data histograms in each sample to the fake data.
+  /// Set the current data histograms in each sample to the fake data.
   void SetFakeData();
 
   /*
     Fitting Functions
   */
 
-  //! Main function to actually start iterating over the different required fit routines
+  /// Main function to actually start iterating over the different required fit routines
   void Run();
 
-  //! Creates a comparison from FCN
+  /// Creates a comparison from FCN
   void GenerateComparison();
   
-  //! Given a new map change the values that the RW engine is currently set to
+  /// Given a new map change the values that the RW engine is currently set to
   void UpdateRWEngine(std::map<std::string,double>& updateVals);
 
-  //! Print current value
+  /// Print current value
   void PrintState();
   
   /*
     Write Functions
   */
 
-  //! Save the sample plots for current MC
-  //! dir if not empty forces plots to be saved in a subdirectory of outputfile
+  /// Save the sample plots for current MC
+  /// dir if not empty forces plots to be saved in a subdirectory of outputfile
   void SaveCurrentState(std::string subdir="");
 
-  //! Save starting predictions into a seperate folder
+  /// Save starting predictions into a seperate folder
   void SaveNominal();
 
   /*
     MISC Functions
   */
 
-  //! Get previous fit status from a file
+  /// Get previous fit status from a file
   Int_t GetStatus();
 
 protected:
 
   //! Our Custom ReWeight Object
   FitWeight* rw;
 
-  std::string fOutputFile;
-  std::string fInputFile;
+  std::string fOutputFile; ///< Output file name
+  // std::string fInputFile;  ///< Input file name
 
-  TFile* fInputRootFile;
-  TFile* fOutputRootFile;
+  // TFile* fInputRootFile;   ///< 
+  TFile* fOutputRootFile; ///< Output ROOT TFile
 
-  JointFCN* fSampleFCN;
+  JointFCN* fSampleFCN; ///< Joint Samples Container that handles reconfigures.
 
-  std::string fCardFile;
+  std::string fCardFile; ///< Input card/XML file.
 
-  std::string fStrategy;
-  std::vector<std::string> fRoutines;
-  std::string fAllowedRoutines;
+  std::string fStrategy; ///< Comparison routine selection.
+  std::vector<std::string> fRoutines; ///< Split vector of comparison routine selection.
+  std::string fAllowedRoutines; ///< Hard coded list of allowed routines.
   
-  std::string fFakeDataInput;
+  /// Fake data flag. Can be 'MC' to use 'fake_parameter'
+  /// or 'path_to_file.root' to use previous NUISANCE MC predictions.
+  std::string fFakeDataInput; 
 
   // Input Dial Vals
-  //! Vector of dial names
-  std::vector<std::string> fParams;
-  std::map<std::string, std::string> fStateVals;
-  std::map<std::string, double>      fCurVals;
-  std::map<std::string, int>         fTypeVals;
-
-  //! Vector of fake parameter names
-  std::map<std::string,double> fFakeVals;
+  std::vector<std::string> fParams; ///< Vector of dial names.
+  std::map<std::string, std::string> fStateVals; ///< Map of dial states
+  std::map<std::string, double>      fCurVals; ///< Map of dial values
+  std::map<std::string, int>         fTypeVals; ///< Map of dial type enums.
+
+  // Fake Dial Vals
+  std::map<std::string,double> fFakeVals; ///< Map of fake data settings.
+
+  // Configuration
+  nuiskey fCompKey; ///< Configuration Key for this Comparison Instance
 
 };
 
 /*! @} */
 #endif
diff --git a/src/Routines/MinimizerRoutines.cxx b/src/Routines/MinimizerRoutines.cxx
index 7af2480..61cd91b 100755
--- a/src/Routines/MinimizerRoutines.cxx
+++ b/src/Routines/MinimizerRoutines.cxx
@@ -1,1594 +1,1450 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
-#include "StatusMessage.h"
-
 #include "MinimizerRoutines.h"
 
 /*
   Constructor/Destructor
 */
 //************************
-void MinimizerRoutines::Init(){
+void MinimizerRoutines::Init() {
 //************************
 
   fInputFile = "";
   fInputRootFile = NULL;
 
   fOutputFile = "";
   fOutputRootFile = NULL;
 
   fCovar      = NULL;
   fCovFree  = NULL;
   fCorrel     = NULL;
   fCorFree = NULL;
   fDecomp     = NULL;
   fDecFree = NULL;
 
   fStrategy = "Migrad,FixAtLimBreak,Migrad";
   fRoutines.clear();
 
   fCardFile = "";
 
   fFakeDataInput = "";
 
   fSampleFCN    = NULL;
 
   fMinimizer    = NULL;
   fMinimizerFCN = NULL;
   fCallFunctor  = NULL;
 
   fAllowedRoutines = ("Migrad,Simplex,Combined,"
-		      "Brute,Fumili,ConjugateFR,"
-		      "ConjugatePR,BFGS,BFGS2,"
-		      "SteepDesc,GSLSimAn,FixAtLim,FixAtLimBreak"
-		      "Chi2Scan1D,Chi2Scan2D,Contours,ErrorBands");
+                      "Brute,Fumili,ConjugateFR,"
+                      "ConjugatePR,BFGS,BFGS2,"
+                      "SteepDesc,GSLSimAn,FixAtLim,FixAtLimBreak"
+                      "Chi2Scan1D,Chi2Scan2D,Contours,ErrorBands");
 };
 
 //*************************************
-MinimizerRoutines::~MinimizerRoutines(){
+MinimizerRoutines::~MinimizerRoutines() {
 //*************************************
 };
 
 /*
   Input Functions
 */
 //*************************************
-MinimizerRoutines::MinimizerRoutines(int argc, char* argv[]){
+MinimizerRoutines::MinimizerRoutines(int argc, char* argv[]) {
 //*************************************
 
-  // Set everything to defaults
+  // Initialise Defaults
   Init();
-  std::vector<std::string> configs_cmd;
-  std::string maxevents_flag = "";
-  int verbosity_flag = 0;
-  int error_flag = 0;
-
-  // If No Arguments print commands
-  for (int i = 1; i< argc; ++i){
-    if (i+1 != argc){
-
-      // Cardfile
-      if (!std::strcmp(argv[i], "-c"))      { fCardFile=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-o")) { fOutputFile=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-f")) { fStrategy=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-d")) { fFakeDataInput=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-q")) { configs_cmd.push_back(argv[i+1]); ++i;}
-      else if (!std::strcmp(argv[i], "-n")) { maxevents_flag=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-v")) { verbosity_flag -= 1; }
-      else if (!std::strcmp(argv[i], "+v")) { verbosity_flag += 1; }
-      else if (!std::strcmp(argv[i], "-e")) { error_flag -= 1; }
-      else if (!std::strcmp(argv[i], "+e")) { error_flag += 1; }
-      else {
-	ERR(FTL) << "ERROR: unknown command line option given! - '"
-		  <<argv[i]<<" "<<argv[i+1]<<"'"<< std::endl;
-	throw;
-      }
-    }
+  nuisconfig configuration = Config::Get();
+
+  // Default containers
+  std::string cardfile = "";
+  std::string maxevents = "-1";
+  int errorcount = 0;
+  int verbocount = 0;
+  std::vector<std::string> xmlcmds;
+  std::vector<std::string> configargs;
+
+  // Make easier to handle arguments.
+  std::vector<std::string> args = GeneralUtils::LoadCharToVectStr(argc, argv);
+  ParserUtils::ParseArgument(args, "-c", fCardFile, true);
+  ParserUtils::ParseArgument(args, "-o", fOutputFile, false, false);
+  ParserUtils::ParseArgument(args, "-n", maxevents, false, false);
+  ParserUtils::ParseArgument(args, "-f", fStrategy, false, false);
+  ParserUtils::ParseArgument(args, "-d", fFakeDataInput, false, false);
+  ParserUtils::ParseArgument(args, "-i", xmlcmds);
+  ParserUtils::ParseArgument(args, "-q", configargs);
+  ParserUtils::ParseCounter(args, "e", errorcount);
+  ParserUtils::ParseCounter(args, "v", verbocount);
+  ParserUtils::CheckBadArguments(args);
+
+  // Add extra defaults if none given
+  if (fCardFile.empty() and xmlcmds.empty()) {
+    ERR(FTL) << "No input supplied!" << std::endl;
+    throw;
   }
 
-  if (fOutputFile.empty()) {
-    ERR(WRN) << "WARNING: output file not specified." << std::endl;
-    ERR(WRN) << "Using " << fCardFile << ".root" << std::endl;
+  if (fOutputFile.empty() and !fCardFile.empty()) {
     fOutputFile = fCardFile + ".root";
-  }
+    ERR(WRN) << "No output supplied so saving it to: " << fOutputFile << std::endl;
 
-  if (fCardFile == fOutputFile) {
-    ERR(WRN) << "WARNING: output file and card file are the same file, "
-                "writing: "
-             << fCardFile << ".root" << std::endl;
-    fOutputFile = fCardFile + ".root";
+  } else if (fOutputFile.empty()) {
+    ERR(FTL) << "No output file or cardfile supplied!" << std::endl;
+    throw;
   }
 
-  if(fCardFile == fOutputFile){
-    std::cerr << "WARNING: output file and card file are the same file, "
-      "writing: " << fCardFile << ".root" << std::endl;
-    fOutputFile = fCardFile + ".root";
-  }
+  // Configuration Setup =============================
 
-  // Fill fit routines and check they are good
-  fRoutines = GeneralUtils::ParseToStr(fStrategy,",");
-  for (UInt_t i = 0; i < fRoutines.size(); i++){
-    if (fAllowedRoutines.find(fRoutines[i]) == std::string::npos){
-      ERR(FTL) << "Unknown fit routine given! "
-	       << "Must be provided as a comma seperated list." << std::endl;
-      ERR(FTL) << "Allowed Routines: " << fAllowedRoutines << std::endl;
-      throw;
-    }
+  // Check no comp key is available
+  nuiskey fCompKey;
+  if (Config::Get().GetNodes("nuiscomp").empty()) {
+    fCompKey = Config::Get().CreateNode("nuiscomp");
+  } else {
+    fCompKey = Config::Get().GetNodes("nuiscomp")[0];
   }
 
-  // CONFIG
-  // ---------------------------
-  std::string par_dir =  GeneralUtils::GetTopLevelDir()+"/parameters/";
-  FitPar::Config().ReadParamFile( par_dir + "config.list.dat" );
-  FitPar::Config().ReadParamFile( fCardFile );
+  if (!fCardFile.empty())   fCompKey.AddS("cardfile", fCardFile);
+  if (!fOutputFile.empty()) fCompKey.AddS("outputfile", fOutputFile);
+  if (!fStrategy.empty())   fCompKey.AddS("strategy", fStrategy);
 
-  for (UInt_t iter = 0; iter < configs_cmd.size(); iter++){
-    FitPar::Config().ForceParam(configs_cmd[iter]);
-  }
+  // Load XML Cardfile
+  configuration.LoadConfig( fCompKey.GetS("cardfile"), "");
 
-  if (!maxevents_flag.empty()){
-    FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
+  // Add CMD XML Structs
+  for (size_t i = 0; i < xmlcmds.size(); i++) {
+    configuration.AddXMLLine(xmlcmds[i]);
   }
 
-  if (verbosity_flag != 0){
-    int curverb = FitPar::Config().GetParI("VERBOSITY");
-    FitPar::Config().SetParI("VERBOSITY", curverb + verbosity_flag);
+  // Add Config Args
+  for (size_t i = 0; i < configargs.size(); i++) {
+    configuration.OverrideConfig(configargs[i]);
   }
-
-  if (error_flag != 0){
-    int curwarn = FitPar::Config().GetParI("ERROR");
-    FitPar::Config().SetParI("ERROR", curwarn + error_flag);
+  if (maxevents.compare("-1")){
+    configuration.OverrideConfig("MAXEVENTS=" + maxevents);
   }
 
-  LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
-  ERR_VERB(FitPar::Config().GetParI("ERROR"));
+  // Finish configuration XML
+  configuration.FinaliseConfig(fCompKey.GetS("outputfile") + ".xml");
 
-  // CARD
-  // ---------------------------
-  // Parse Card Options
-  ReadCard(fCardFile);
+  // Add Error Verbo Lines
+  verbocount += Config::Get().GetParI("VERBOSITY");
+  errorcount += Config::Get().GetParI("ERROR");
+  std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+  std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+  // FitPar::log_verb = verbocount;
+  SETVERBOSITY(verbocount);
+  // ERR_VERB(errorcount);
 
-  // Outputs
-  // ---------------------------
-  // Save Configs to output file
-  fOutputRootFile = new TFile(fOutputFile.c_str(),"RECREATE");
-  FitPar::Config().Write();
+  // Minimizer Setup ========================================
+  fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
+  SetupMinimizerFromXML();
 
-  // Starting Setup
-  // ---------------------------
   SetupCovariance();
   SetupRWEngine();
   SetupFCN();
 
   return;
 };
 
 //*************************************
-void MinimizerRoutines::ReadCard(std::string cardfile){
+void MinimizerRoutines::SetupMinimizerFromXML() {
 //*************************************
 
-  // Read cardlines into vector
-  std::vector<std::string> cardlines = GeneralUtils::ParseFileToStr(cardfile,"\n");
-  FitPar::Config().cardLines = cardlines;
-
-  // Read Samples first (norm params can be overridden)
-  int linecount = 0;
-  for (std::vector<std::string>::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;
-
-    // Read Valid Samples
-    int samstatus = ReadSamples(line);
-
-    // Show line if bad to help user
-    if (samstatus == kErrorStatus) {
-      ERR(FTL) << "Bad Input in cardfile " << fCardFile
-	       << " at line " << linecount << "!" << endl;
-      ERR(FTL) << line << endl;
-      throw;
-    }
-  }
-
-  // Read Parameters second
-  linecount = 0;
-  for (std::vector<std::string>::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;
-
-    // Try Parameter Reads
-    int parstatus = ReadParameters(line);
-    int fakstatus = ReadFakeDataPars(line);
-
-    // Show line if bad to help user
-    if (parstatus == kErrorStatus ||
-	fakstatus == kErrorStatus ){
-      ERR(FTL) << "Bad Parameter Input in cardfile " << fCardFile
-	       << " at line " << linecount << "!" << endl;
-      ERR(FTL) << line << endl;
-      throw;
-    }
-  }
-
-  return;
-};
-
-//*****************************************
-int MinimizerRoutines::ReadParameters(std::string parstring){
-//******************************************
+  LOG(FIT) << "Setting up nuismin" << std::endl;
 
-  std::string inputspec = "RW Dial Inputs Syntax \n"
-    "free input w/ limits: TYPE  NAME  START  MIN  MAX  STEP  [STATE] \n"
-    "fix  input: TYPE  NAME  VALUE  [STATE] \n"
-    "free input w/o limits: TYPE  NAME  START  FREE,[STATE] \n"
-    "Allowed Types: \n"
-    "neut_parameter,niwg_parameter,t2k_parameter,"
-    "nuwro_parameter,gibuu_parameter";
-
-  // Check sample input
-  if (parstring.find("parameter") == std::string::npos) {
-    return kGoodStatus;
+  // Setup Parameters ------------------------------------------
+  std::vector<nuiskey> parkeys = Config::QueryKeys("parameter");
+  if (!parkeys.empty()) {
+    LOG(FIT) << "Number of parameters :  " << parkeys.size() << std::endl;
   }
 
-  // If we find fake_parameter
-  if (parstring.find("fake_parameter") != std::string::npos) {
-    return kGoodStatus;
-  }
-
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
+  for (size_t i = 0; i < parkeys.size(); i++) {
+    nuiskey key = parkeys.at(i);
 
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' ||
-      strvct[0].find("parameter") == std::string::npos){
-    return kGoodStatus;
-  }
+    // Check for type,name,nom
+    if (!key.Has("type")) {
+      ERR(FTL) << "No type given for parameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("name")) {
+      ERR(FTL) << "No name given for parameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("nominal")) {
+      ERR(FTL) << "No nominal given for parameter " << i << std::endl;
+      throw;
+    }
 
-  // Check length
-  if (strvct.size() < 3){
-    ERR(FTL) << "Input rw dials need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // 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;
+    std::string parstate = key.GetS("state");
+
+    // Extra limits
+    if (key.Has("low")) {
+      parlow  = key.GetD("low");
+      parhigh = key.GetD("high");
+      parstep = key.GetD("step");
+
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parlow << " < p < " << parhigh
+               << " : " << parstate << std::endl;
+    } else {
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parstate << std::endl;
+    }
 
-  // Setup default inputs
-  std::string partype = strvct[0];
-  std::string parname = strvct[1];
-  double parval  = GeneralUtils::StrToDbl(strvct[2]);
-  double minval  = parval - 1.0;
-  double maxval  = parval + 1.0;
-  double stepval = 1.0;
-  std::string state = "FIX"; //[DEFAULT]
-
-  // Check Type
-  if (FitBase::ConvDialType(partype) == kUNKNOWN){
-    ERR(FTL) << "Unknown parameter type! " << partype << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Run Parameter Conversion if needed
+    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 );
+    }
 
-  // Check Parameter Name
-  if (FitBase::GetDialEnum(partype, parname) == -1){
-    ERR(FTL) << "Bad RW parameter name! " << partype << " " << parname << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Push into vectors
+    fParams.push_back(parname);
 
-  // Option Extra (No Limits)
-  if (strvct.size() == 4){
-    state = strvct[3];
-  }
+    fTypeVals[parname]  = FitBase::ConvDialType(partype);;
+    fStartVals[parname] = parnom;
+    fCurVals[parname]   = parnom;
 
-  // Check for weirder inputs
-  if (strvct.size() > 4 && strvct.size() < 6){
-    ERR(FTL) << "Provided incomplete limits for " << parname << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    fErrorVals[parname] = 0.0;
 
-  // Option Extra (With limits and steps)
-  if (strvct.size() >= 6){
-    minval  = GeneralUtils::StrToDbl(strvct[3]);
-    maxval  = GeneralUtils::StrToDbl(strvct[4]);
-    stepval = GeneralUtils::StrToDbl(strvct[5]);
-  }
+    fStateVals[parname]    = parstate;
+    bool fixstate = parstate.find("FIX") != std::string::npos;
+    fFixVals[parname]      = fixstate;
+    fStartFixVals[parname] = fFixVals[parname];
 
-  // Option Extra (dial state after limits)
-  if (strvct.size() == 7){
-    state = strvct[6];
-  }
+    fMinVals[parname]  = parlow;
+    fMaxVals[parname]  = parhigh;
+    fStepVals[parname] = parstep;
 
-  // Run Parameter Conversion if needed
-  if (state.find("ABS") != std::string::npos){
-    parval  = FitBase::RWAbsToSigma( partype, parname, parval  );
-    minval  = FitBase::RWAbsToSigma( partype, parname, minval  );
-    maxval  = FitBase::RWAbsToSigma( partype, parname, maxval  );
-    stepval = FitBase::RWAbsToSigma( partype, parname, stepval );
-  } else if (state.find("FRAC") != std::string::npos){
-    parval  = FitBase::RWFracToSigma( partype, parname, parval  );
-    minval  = FitBase::RWFracToSigma( partype, parname, minval  );
-    maxval  = FitBase::RWFracToSigma( partype, parname, maxval  );
-    stepval = FitBase::RWFracToSigma( partype, parname, stepval );
   }
 
-  // Check no repeat params
-  if (std::find(fParams.begin(), fParams.end(), parname) != fParams.end()){
-    ERR(FTL) << "Duplicate parameter names given for " << parname << endl;
-    throw;
+  // Setup Samples ----------------------------------------------
+  std::vector<nuiskey> samplekeys =  Config::QueryKeys("sample");
+  if (!samplekeys.empty()) {
+    LOG(FIT) << "Number of samples : " << samplekeys.size() << std::endl;
   }
 
-  // Setup Containers
-  fParams.push_back(parname);
-
-  fTypeVals[parname]  = FitBase::ConvDialType(partype);
-
-  fStartVals[parname] = parval;
-  fCurVals[parname]   = fStartVals[parname];
-
-  fErrorVals[parname] = 0.0;
+  for (size_t i = 0; i < samplekeys.size(); i++) {
+    nuiskey key = samplekeys.at(i);
 
-  fStateVals[parname] = state;
+    // Get Sample Options
+    std::string samplename = key.GetS("name");
+    std::string samplefile = key.GetS("input");
 
-  bool fixstate = state.find("FIX") != std::string::npos;
-  fFixVals[parname]      = fixstate;
-  fStartFixVals[parname] = fFixVals[parname];
+    std::string sampletype =
+      key.Has("type") ? key.GetS("type") : "DEFAULT";
 
-  fMinVals[parname]  = minval;
-  fMaxVals[parname]  = maxval;
-  fStepVals[parname] = stepval;
-
-  // Print the parameter
-  LOG(MIN) << "Read Parameter " << parname << " " << parval << " "
-	   << minval << " " << maxval << " "
-	   << stepval << " " << state << std::endl;
-
-  // Tell reader its all good
-  return kGoodStatus;
-}
-
-//*******************************************
-int MinimizerRoutines::ReadFakeDataPars(std::string parstring){
-//******************************************
+    double samplenorm =
+      key.Has("norm") ? key.GetD("norm") : 1.0;
 
-  std::string inputspec = "Fake Data Dial Inputs Syntax \n"
-    "fake value: fake_parameter  NAME  VALUE  \n"
-    "Name should match dialnames given in actual dial specification.";
+    // Print out
+    LOG(FIT) << "Read sample info " << i << " : "
+             << samplename << std::endl
+             << "\t\t input -> " << samplefile  << std::endl
+             << "\t\t state -> " << sampletype << std::endl
+             << "\t\t norm  -> " << samplenorm << std::endl;
 
-  // Check sample input
-  if (parstring.find("fake_parameter") == std::string::npos)
-    return kGoodStatus;
-
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
-
-  // Skip if comment somewhere later in line
-  if (strvct[0].c_str()[0] == '#') {
-    return kGoodStatus;
-  }
+    // If FREE add to parameters otherwise continue
+    if (sampletype.find("FREE") == std::string::npos) {
+      continue;
+    }
 
-  // Check length
-  if (strvct.size() < 3){
-    ERR(FTL) << "Fake dials need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Form norm dial from samplename + sampletype + "_norm";
+    std::string normname = samplename + sampletype + "_norm";
 
-  // Read Inputs
-  std::string parname = strvct[1];
-  double      parval  = GeneralUtils::StrToDbl(strvct[2]);
+    // Check normname not already present
+    if (fTypeVals.find(normname) != fTypeVals.end()) {
+      continue;
+    }
 
-  // Setup Container
-  fFakeVals[parname] = parval;
+    // Add new norm dial to list if its passed above checks
+    fParams.push_back(normname);
 
-  // Print the fake parameter
-  LOG(MIN) << "Read Fake Parameter " << parname << " " << parval << std::endl;
+    fTypeVals[normname] = kNORM;
+    fStateVals[normname] = sampletype;
+    fCurVals[normname] = samplenorm;
 
-  // Tell reader its all good
-  return kGoodStatus;
-}
+    fErrorVals[normname] = 0.0;
 
-//******************************************
-int MinimizerRoutines::ReadSamples(std::string samstring){
-//******************************************
-  const static std::string inputspec =
-      "\tsample <sample_name> <input_type>:inputfile.root [OPTS] "
-      "[norm]\nsample_name: Name "
-      "of sample to include. e.g. MiniBooNE_CCQE_XSec_1DQ2_nu\ninput_type: The "
-      "input event format. e.g. NEUT, GENIE, EVSPLN, ...\nOPTS: Additional, "
-      "optional sample options.\nnorm: Additional, optional sample "
-      "normalisation factor.";
-
-  // Check sample input
-  if (samstring.find("sample") == std::string::npos)
-    return kGoodStatus;
-
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(samstring, " ");
-
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' ||
-      strvct[0] != "sample"){
-    return kGoodStatus;
-  }
+    fMinVals[normname]  = 0.1;
+    fMaxVals[normname]  = 10.0;
+    fStepVals[normname] = 0.5;
 
-  // Check length
-  if (strvct.size() < 3){
-    ERR(FTL) << "Sample need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
+    bool state = sampletype.find("FREE") == std::string::npos;
+    fFixVals[normname]      = state;
+    fStartFixVals[normname] = state;
   }
 
-  // Setup default inputs
-  std::string samname = strvct[1];
-  std::string samfile = strvct[2];
-
-  if (samfile == "FIX") {
-    ERR(FTL) << "Input filename was \"FIX\", this line is probably malformed "
-                "in the input card file. Line:\'"
-             << samstring << "\'" << std::endl;
-    ERR(FTL) << "Expect sample lines to look like:\n\t" << inputspec
-             << std::endl;
-
-    throw;
+  // Setup Fake Parameters -----------------------------
+  std::vector<nuiskey> fakekeys = Config::QueryKeys("fakeparameter");
+  if (!fakekeys.empty()) {
+    LOG(FIT) << "Number of fake parameters : " << fakekeys.size() << std::endl;
   }
 
-  std::string samtype = "DEFAULT";
-  double      samnorm = 1.0;
-
-  // Optional Type
-  if (strvct.size() > 3){
-    samtype = strvct[3];
-    //    samname += "_"+samtype;
-    // Also get rid of the / and replace it with underscore because it might not be supported character
-    //    while (samname.find("/") != std::string::npos) {
-    //      samname.replace(samname.find("/"), 1, std::string("_"));
-    //    }
-  }
+  for (size_t i = 0; i < fakekeys.size(); i++) {
+    nuiskey key = fakekeys.at(i);
 
-  // Optional Norm
-  if (strvct.size() > 4) samnorm = GeneralUtils::StrToDbl(strvct[4]);
+    // Check for type,name,nom
+    if (!key.Has("name")) {
+      ERR(FTL) << "No name given for fakeparameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("nom")) {
+      ERR(FTL) << "No nominal given for fakeparameter " << i << std::endl;
+      throw;
+    }
 
-  // Add Sample Names as Norm Dials
-  std::string normname = samname + "_norm";
+    // Get Inputs
+    std::string parname = key.GetS("name");
+    double parnom  = key.GetD("nom");
 
-  // Check no repeat params
-  if (std::find(fParams.begin(), fParams.end(), normname) != fParams.end()){
-    ERR(FTL) << "Duplicate samples given for " << samname << endl;
-    throw;
+    // Push into vectors
+    fFakeVals[parname] = parnom;
   }
 
-  fParams.push_back(normname);
-
-  fTypeVals[normname]  = kNORM;
-  fStartVals[normname] = samnorm;
-  fCurVals[normname]   = fStartVals[normname];
-  fErrorVals[normname] = 0.0;
-
-  fMinVals[normname]  = 0.1;
-  fMaxVals[normname]  = 10.0;
-  fStepVals[normname] = 0.5;
-
-  bool state = samtype.find("FREE") == std::string::npos;
-  fFixVals[normname]      = state;
-  fStartFixVals[normname] = state;
 
-  // Print read in
-  LOG(MIN) << "Read sample " << samname << " "
-	   << samfile << " " << samtype << " "
-	   << samnorm << endl;
-
-  // Tell reader its all good
-  return kGoodStatus;
 }
 
+
 /*
   Setup Functions
 */
 //*************************************
-void MinimizerRoutines::SetupRWEngine(){
+void MinimizerRoutines::SetupRWEngine() {
 //*************************************
 
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string name = fParams[i];
     FitBase::GetRW() -> IncludeDial(name, fTypeVals.at(name) );
   }
   UpdateRWEngine(fStartVals);
 
   return;
 }
 
 //*************************************
-void MinimizerRoutines::SetupFCN(){
+void MinimizerRoutines::SetupFCN() {
 //*************************************
 
-  LOG(FIT)<<"Making the jointFCN"<<std::endl;
+  LOG(FIT) << "Making the jointFCN" << std::endl;
   if (fSampleFCN) delete fSampleFCN;
-  fSampleFCN = new JointFCN(fCardFile, fOutputRootFile);
+  // fSampleFCN = new JointFCN(fCardFile, fOutputRootFile);
+  fSampleFCN = new JointFCN(fOutputRootFile);
+  
   SetFakeData();
 
   fMinimizerFCN = new MinimizerFCN( fSampleFCN );
   fCallFunctor  = new ROOT::Math::Functor( *fMinimizerFCN, fParams.size() );
 
   fSampleFCN->CreateIterationTree( "fit_iterations", FitBase::GetRW() );
 
   return;
 }
 
 
 //******************************************
-void MinimizerRoutines::SetupFitter(std::string routine){
+void MinimizerRoutines::SetupFitter(std::string routine) {
 //******************************************
 
   // Make the fitter
   std::string fitclass = "";
   std::string fittype  = "";
 
   // Get correct types
-  if      (!routine.compare("Migrad"))      { fitclass = "Minuit2"; fittype = "Migrad";
-  } else if (!routine.compare("Simplex"))     { fitclass = "Minuit2"; fittype = "Simplex";
-  } else if (!routine.compare("Combined"))    { fitclass = "Minuit2"; fittype = "Combined";
-  } else if (!routine.compare("Brute"))       { fitclass = "Minuit2"; fittype = "Scan";
-  } else if (!routine.compare("Fumili"))      { fitclass = "Minuit2"; fittype = "Fumili";
-  } else if (!routine.compare("ConjugateFR")) { fitclass = "GSLMultiMin"; fittype = "ConjugateFR";
-  } else if (!routine.compare("ConjugatePR")) { fitclass = "GSLMultiMin"; fittype = "ConjugatePR";
-  } else if (!routine.compare("BFGS"))        { fitclass = "GSLMultiMin"; fittype = "BFGS";
-  } else if (!routine.compare("BFGS2"))       { fitclass = "GSLMultiMin"; fittype = "BFGS2";
-  } else if (!routine.compare("SteepDesc"))   { fitclass = "GSLMultiMin"; fittype = "SteepestDescent";
+  if      (!routine.compare("Migrad"))      {
+    fitclass = "Minuit2"; fittype = "Migrad";
+  } else if (!routine.compare("Simplex"))     {
+    fitclass = "Minuit2"; fittype = "Simplex";
+  } else if (!routine.compare("Combined"))    {
+    fitclass = "Minuit2"; fittype = "Combined";
+  } else if (!routine.compare("Brute"))       {
+    fitclass = "Minuit2"; fittype = "Scan";
+  } else if (!routine.compare("Fumili"))      {
+    fitclass = "Minuit2"; fittype = "Fumili";
+  } else if (!routine.compare("ConjugateFR")) {
+    fitclass = "GSLMultiMin"; fittype = "ConjugateFR";
+  } else if (!routine.compare("ConjugatePR")) {
+    fitclass = "GSLMultiMin"; fittype = "ConjugatePR";
+  } else if (!routine.compare("BFGS"))        {
+    fitclass = "GSLMultiMin"; fittype = "BFGS";
+  } else if (!routine.compare("BFGS2"))       {
+    fitclass = "GSLMultiMin"; fittype = "BFGS2";
+  } else if (!routine.compare("SteepDesc"))   {
+    fitclass = "GSLMultiMin"; fittype = "SteepestDescent";
     //  } else if (!routine.compare("GSLMulti"))    { fitclass = "GSLMultiFit"; fittype = "";         // Doesn't work out of the box
   } else if (!routine.compare("GSLSimAn"))    { fitclass = "GSLSimAn"; fittype = "";   }
 
   // make minimizer
   if (fMinimizer) delete fMinimizer;
   fMinimizer = ROOT::Math::Factory::CreateMinimizer(fitclass, fittype);
 
   fMinimizer->SetMaxFunctionCalls(FitPar::Config().GetParI("minimizer.maxcalls"));
 
-  if (!routine.compare("Brute")){
-    fMinimizer->SetMaxFunctionCalls(fParams.size() * fParams.size()*4);
-    fMinimizer->SetMaxIterations(fParams.size() * fParams.size()*4);
+  if (!routine.compare("Brute")) {
+    fMinimizer->SetMaxFunctionCalls(fParams.size() * fParams.size() * 4);
+    fMinimizer->SetMaxIterations(fParams.size() * fParams.size() * 4);
   }
 
   fMinimizer->SetMaxIterations(FitPar::Config().GetParI("minimizer.maxiterations"));
   fMinimizer->SetTolerance(FitPar::Config().GetParD("minimizer.tolerance"));
   fMinimizer->SetStrategy(FitPar::Config().GetParI("minimizer.strategy"));
   fMinimizer->SetFunction(*fCallFunctor);
 
   int ipar = 0;
   //Add Fit Parameters
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams.at(i);
 
     bool fixed = true;
     double vstart, vstep, vlow, vhigh;
     vstart = vstep = vlow = vhigh = 0.0;
 
     if (fCurVals.find(syst) != fCurVals.end()  ) vstart = fCurVals.at(syst);
     if (fMinVals.find(syst)  != fMinVals.end() ) vlow   = fMinVals.at(syst);
     if (fMaxVals.find(syst)  != fMaxVals.end() ) vhigh  = fMaxVals.at(syst);
     if (fStepVals.find(syst) != fStepVals.end()) vstep  = fStepVals.at(syst);
     if (fFixVals.find(syst)  != fFixVals.end() ) fixed  = fFixVals.at(syst);
 
     // fix for errors
     if (vhigh == vlow) vhigh += 1.0;
 
     fMinimizer->SetVariable(ipar, syst, vstart, vstep);
-    fMinimizer->SetVariableLimits(ipar,vlow,vhigh);
+    fMinimizer->SetVariableLimits(ipar, vlow, vhigh);
 
     if (fixed) {
 
       fMinimizer->FixVariable(ipar);
-      LOG(FIT) << "Fixed Param: "<<syst<<std::endl;
+      LOG(FIT) << "Fixed Param: " << syst << std::endl;
 
     } else {
 
-      LOG(FIT) << "Free  Param: "<<syst
-	       <<" Start:"<<vstart
-	       <<" Range:"<<vlow<<" to "<<vhigh
-	       <<" Step:"<<vstep<<std::endl;
+      LOG(FIT) << "Free  Param: " << syst
+               << " Start:" << vstart
+               << " Range:" << vlow << " to " << vhigh
+               << " Step:" << vstep << std::endl;
     }
 
     ipar++;
   }
 
-  LOG(FIT) << "Setup Minimizer: "<<fMinimizer->NDim()<<"(NDim) "<<fMinimizer->NFree()<<"(NFree)"<<std::endl;
+  LOG(FIT) << "Setup Minimizer: " << fMinimizer->NDim() << "(NDim) " << fMinimizer->NFree() << "(NFree)" << std::endl;
 
   return;
 }
 
 //*************************************
 // Set fake data from user input
-void MinimizerRoutines::SetFakeData(){
+void MinimizerRoutines::SetFakeData() {
 //*************************************
 
   // If the fake data input field (-d) isn't provided, return to caller
   if (fFakeDataInput.empty()) return;
 
   // If user specifies -d MC we set the data to the MC
   // User can also specify fake data parameters to reweight by doing "fake_parameter" in input card file
   // "fake_parameter" gets read in ReadCard function (reads to fFakeVals)
   if (fFakeDataInput.compare("MC") == 0) {
 
     LOG(FIT) << "Setting fake data from MC starting prediction." << std::endl;
     // fFakeVals get read in in ReadCard
     UpdateRWEngine(fFakeVals);
 
     // Reconfigure the reweight engine
     FitBase::GetRW()->Reconfigure();
     // Reconfigure all the samples to the new reweight
     fSampleFCN->ReconfigureAllEvents();
     // Feed on and set the fake-data in each measurement class
     fSampleFCN->SetFakeData("MC");
 
-    // Changed the reweight engine values back to the current values 
+    // Changed the reweight engine values back to the current values
     // So we start the fit at a different value than what we set the fake-data to
     UpdateRWEngine(fCurVals);
 
-    LOG(FIT)<<"Set all data to fake MC predictions."<<std::endl;
+    LOG(FIT) << "Set all data to fake MC predictions." << std::endl;
   } else {
     fSampleFCN->SetFakeData(fFakeDataInput);
   }
 
   return;
 }
 
 /*
   Fitting Functions
 */
 //*************************************
-void MinimizerRoutines::UpdateRWEngine(std::map<std::string,double>& updateVals){
+void MinimizerRoutines::UpdateRWEngine(std::map<std::string, double>& updateVals) {
 //*************************************
 
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string name = fParams[i];
 
     if (updateVals.find(name) == updateVals.end()) continue;
-    FitBase::GetRW()->SetDialValue(name,updateVals.at(name));
+    FitBase::GetRW()->SetDialValue(name, updateVals.at(name));
   }
 
   FitBase::GetRW()->Reconfigure();
   return;
 }
 
 //*************************************
-void MinimizerRoutines::Run(){
+void MinimizerRoutines::Run() {
 //*************************************
 
-  for (UInt_t i = 0; i < fRoutines.size(); i++){
+  LOG(FIT) << "Running MinimizerRoutines : " << fStrategy << std::endl;
+  if (FitPar::Config().GetParB("save_nominal")) {
+    SaveNominal();
+  }
+
+  // Parse given routines
+  fRoutines = GeneralUtils::ParseToStr(fStrategy,",");
+  if (fRoutines.empty()){
+    ERR(FTL) << "Trying to run MinimizerRoutines with no routines given!" << std::endl;
+    throw;
+  }
+
+  for (UInt_t i = 0; i < fRoutines.size(); i++) {
 
     std::string routine = fRoutines.at(i);
     int fitstate = kFitUnfinished;
-    LOG(FIT)<<"Running Routine: "<<routine<<std::endl;
+    LOG(FIT) << "Running Routine: " << routine << std::endl;
 
     // Try Routines
     if (routine.find("LowStat") != std::string::npos) LowStatRoutine(routine);
     else if (routine == "FixAtLim")  FixAtLimit();
     else if (routine == "FixAtLimBreak") fitstate = FixAtLimit();
     else if (routine.find("ErrorBands") != std::string::npos) GenerateErrorBands();
     else if (!routine.compare("Chi2Scan1D")) Create1DScans();
     else if (!routine.compare("Chi2Scan2D")) Chi2Scan2D();
     else fitstate = RunFitRoutine(routine);
 
     // If ending early break here
-    if (fitstate == kFitFinished || fitstate == kNoChange){
-      LOG(FIT) << "Ending fit routines loop." << endl;
+    if (fitstate == kFitFinished || fitstate == kNoChange) {
+      LOG(FIT) << "Ending fit routines loop." << std::endl;
       break;
     }
   }
 
   return;
 }
 
 //*************************************
-int MinimizerRoutines::RunFitRoutine(std::string routine){
+int MinimizerRoutines::RunFitRoutine(std::string routine) {
 //*************************************
   int endfits = kFitUnfinished;
 
   // set fitter at the current start values
   fOutputRootFile->cd();
   SetupFitter(routine);
 
   // choose what to do with the minimizer depending on routine.
   if      (!routine.compare("Migrad") or
-	   !routine.compare("Simplex") or
-	   !routine.compare("Combined") or
-	   !routine.compare("Brute") or
-	   !routine.compare("Fumili") or
-	   !routine.compare("ConjugateFR") or
-	   !routine.compare("ConjugatePR") or
-	   !routine.compare("BFGS") or
-	   !routine.compare("BFGS2") or
-	   !routine.compare("SteepDesc") or
-	   //	   !routine.compare("GSLMulti") or
-	   !routine.compare("GSLSimAn")) {
-
-    if (fMinimizer->NFree() > 0){
-      LOG(FIT) << StatusMessage(fMinimizer->Minimize()) << std::endl;
+           !routine.compare("Simplex") or
+           !routine.compare("Combined") or
+           !routine.compare("Brute") or
+           !routine.compare("Fumili") or
+           !routine.compare("ConjugateFR") or
+           !routine.compare("ConjugatePR") or
+           !routine.compare("BFGS") or
+           !routine.compare("BFGS2") or
+           !routine.compare("SteepDesc") or
+           //    !routine.compare("GSLMulti") or
+           !routine.compare("GSLSimAn")) {
+
+    if (fMinimizer->NFree() > 0) {
+      LOG(FIT) << fMinimizer->Minimize() << std::endl;
       GetMinimizerState();
     }
   }
 
   // other otptions
   else if (!routine.compare("Contour")) {
     CreateContours();
   }
 
   return endfits;
 }
 
 //*************************************
-void MinimizerRoutines::PrintState(){
+void MinimizerRoutines::PrintState() {
 //*************************************
-  LOG(FIT)<<"------------"<<std::endl;
+  LOG(FIT) << "------------" << std::endl;
 
   // Count max size
   int maxcount = 0;
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     maxcount = max(int(fParams[i].size()), maxcount);
   }
 
   // Header
   LOG(FIT) << " #    " << left << setw(maxcount) << "Parameter "
-	   << " = "
-	   << setw(10) << "Value"     << " +- "
-	   << setw(10) << "Error"     << " "
-	   << setw(8)  << "(Units)"   << " "
-	   << setw(10) << "Conv. Val" << " +- "
-	   << setw(10) << "Conv. Err" << " "
-	   << setw(8)  << "(Units)"   << std::endl;
+           << " = "
+           << setw(10) << "Value"     << " +- "
+           << setw(10) << "Error"     << " "
+           << setw(8)  << "(Units)"   << " "
+           << setw(10) << "Conv. Val" << " +- "
+           << setw(10) << "Conv. Err" << " "
+           << setw(8)  << "(Units)"   << std::endl;
 
   // Parameters
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams.at(i);
 
     std::string typestr  = FitBase::ConvDialType(fTypeVals[syst]);
     std::string curunits = "(sig.)";
     double      curval   = fCurVals[syst];
     double      curerr   = fErrorVals[syst];
 
-    if (fStateVals[syst].find("ABS") != std::string::npos){
+    if (fStateVals[syst].find("ABS") != std::string::npos) {
       curval = FitBase::RWSigmaToAbs(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
-		FitBase::RWSigmaToAbs(typestr, syst, 0.0));
+                FitBase::RWSigmaToAbs(typestr, syst, 0.0));
       curunits = "(Abs.)";
-    } else if (fStateVals[syst].find("FRAC") != std::string::npos){
+    } else if (fStateVals[syst].find("FRAC") != std::string::npos) {
       curval = FitBase::RWSigmaToFrac(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToFrac(typestr, syst, curerr) -
-		FitBase::RWSigmaToFrac(typestr, syst, 0.0));
+                FitBase::RWSigmaToFrac(typestr, syst, 0.0));
       curunits = "(Frac)";
     }
 
     std::string convunits = "(" + FitBase::GetRWUnits(typestr, syst) + ")";
     double      convval   = FitBase::RWSigmaToAbs(typestr, syst, curval);
     double      converr   = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
-			     FitBase::RWSigmaToAbs(typestr, syst, 0.0));
+                             FitBase::RWSigmaToAbs(typestr, syst, 0.0));
 
     std::ostringstream curparstring;
 
     curparstring << " " << setw(3) << left
-		 << i << ". "
-		 << setw(maxcount) << syst << " = "
-		 << setw(10) << curval     << " +- "
-		 << setw(10) << curerr     << " "
-		 << setw(8)  << curunits   << " "
+                 << i << ". "
+                 << setw(maxcount) << syst << " = "
+                 << setw(10) << curval     << " +- "
+                 << setw(10) << curerr     << " "
+                 << setw(8)  << curunits   << " "
                  << setw(10) << convval    << " +- "
                  << setw(10) << converr    << " "
                  << setw(8)  << convunits;
 
 
-    LOG(FIT) << curparstring.str() << endl;
+    LOG(FIT) << curparstring.str() << std::endl;
   }
 
-  LOG(FIT)<<"------------"<<std::endl;
+  LOG(FIT) << "------------" << std::endl;
   double like = fSampleFCN->GetLikelihood();
-  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << endl;
-  LOG(FIT)<<"------------"<<std::endl;
+  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << std::endl;
+  LOG(FIT) << "------------" << std::endl;
 }
 
 //*************************************
-void MinimizerRoutines::GetMinimizerState(){
+void MinimizerRoutines::GetMinimizerState() {
 //*************************************
 
-  LOG(FIT) << "Minimizer State: "<<std::endl;
+  LOG(FIT) << "Minimizer State: " << std::endl;
   // Get X and Err
   const double *values = fMinimizer->X();
   const double *errors = fMinimizer->Errors();
   //  int ipar = 0;
 
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams.at(i);
 
     fCurVals[syst]   = values[i];
     fErrorVals[syst] = errors[i];
   }
 
   PrintState();
 
   // Covar
   SetupCovariance();
-  if (fMinimizer->CovMatrixStatus() > 0){
+  if (fMinimizer->CovMatrixStatus() > 0) {
 
     // Fill Full Covar
-    for (int i = 0; i < fCovar->GetNbinsX(); i++){
-      for (int j = 0; j < fCovar->GetNbinsY(); j++){
-	fCovar->SetBinContent(i+1,j+1, fMinimizer->CovMatrix(i,j));
+    for (int i = 0; i < fCovar->GetNbinsX(); i++) {
+      for (int j = 0; j < fCovar->GetNbinsY(); j++) {
+        fCovar->SetBinContent(i + 1, j + 1, fMinimizer->CovMatrix(i, j));
       }
     }
 
     int freex = 0;
     int freey = 0;
-    for (int i = 0; i < fCovar->GetNbinsX(); i++){
+    for (int i = 0; i < fCovar->GetNbinsX(); i++) {
       if (fMinimizer->IsFixedVariable(i)) continue;
       freey = 0;
 
-      for (int j = 0; j < fCovar->GetNbinsY(); j++){
-	if (fMinimizer->IsFixedVariable(j)) continue;
+      for (int j = 0; j < fCovar->GetNbinsY(); j++) {
+        if (fMinimizer->IsFixedVariable(j)) continue;
 
-	fCovFree->SetBinContent(freex+1,freey+1, fMinimizer->CovMatrix(i,j));
-	freey++;
+        fCovFree->SetBinContent(freex + 1, freey + 1, fMinimizer->CovMatrix(i, j));
+        freey++;
       }
       freex++;
     }
 
-    fCorrel     = PlotUtils::GetCorrelationPlot(fCovar,"correlation");
-    fDecomp     = PlotUtils::GetDecompPlot(fCovar,"decomposition");
-    if (fMinimizer->NFree() > 0){
-      fCorFree = PlotUtils::GetCorrelationPlot(fCovFree,"correlation_free");
-      fDecFree = PlotUtils::GetDecompPlot(fCovFree,"decomposition_free");
+    fCorrel     = PlotUtils::GetCorrelationPlot(fCovar, "correlation");
+    fDecomp     = PlotUtils::GetDecompPlot(fCovar, "decomposition");
+    if (fMinimizer->NFree() > 0) {
+      fCorFree = PlotUtils::GetCorrelationPlot(fCovFree, "correlation_free");
+      fDecFree = PlotUtils::GetDecompPlot(fCovFree, "decomposition_free");
     }
   }
 
 
   return;
 };
 
 //*************************************
-void MinimizerRoutines::LowStatRoutine(std::string routine){
+void MinimizerRoutines::LowStatRoutine(std::string routine) {
 //*************************************
 
-  LOG(FIT) << "Running Low Statistics Routine: "<<routine<<std::endl;
+  LOG(FIT) << "Running Low Statistics Routine: " << routine << std::endl;
   int lowstatsevents = FitPar::Config().GetParI("minimizer.lowstatevents");
   int maxevents      = FitPar::Config().GetParI("input.maxevents");
   int verbosity      = FitPar::Config().GetParI("VERBOSITY");
 
   std::string trueroutine = routine;
   std::string substring = "LowStat";
   trueroutine.erase( trueroutine.find(substring),
-		     substring.length() );
+                     substring.length() );
 
   // Set MAX EVENTS=1000
-  FitPar::Config().SetParI("input.maxevents",lowstatsevents);
-  FitPar::Config().SetParI("VERBOSITY",3);
+  FitPar::Config().SetParI("input.maxevents", lowstatsevents);
+  FitPar::Config().SetParI("VERBOSITY", 3);
   SetupFCN();
 
   RunFitRoutine(trueroutine);
 
-  FitPar::Config().SetParI("input.maxevents",maxevents);
+  FitPar::Config().SetParI("input.maxevents", maxevents);
   SetupFCN();
 
-  FitPar::Config().SetParI("VERBOSITY",verbosity);
+  FitPar::Config().SetParI("VERBOSITY", verbosity);
   return;
 }
 
 //*************************************
-void MinimizerRoutines::Create1DScans(){
+void MinimizerRoutines::Create1DScans() {
 //*************************************
 
   // 1D Scan Routine
   // Steps through all free parameters about nominal using the step size
   // Creates a graph for each free parameter
 
   // At the current point create a 1D Scan for all parametes (Uncorrelated)
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
 
     if (fFixVals[fParams[i]]) continue;
 
-    LOG(FIT) << "Running 1D Scan for " << fParams[i] << endl;
+    LOG(FIT) << "Running 1D Scan for " << fParams[i] << std::endl;
     fSampleFCN->CreateIterationTree(fParams[i] +
-				    "_scan1D_iterations",
-				    FitBase::GetRW());
+                                    "_scan1D_iterations",
+                                    FitBase::GetRW());
 
     double scanmiddlepoint = fCurVals[fParams[i]];
 
     // Determine N points needed
     double limlow  = fMinVals[fParams[i]];
     double limhigh = fMaxVals[fParams[i]];
     double step    = fStepVals[fParams[i]];
 
-    int npoints = int( fabs(limhigh - limlow)/(step+0.) );
+    int npoints = int( fabs(limhigh - limlow) / (step + 0.) );
 
     TH1D* contour = new TH1D(("Chi2Scan1D_" + fParams[i]).c_str(),
-			     ("Chi2Scan1D_" + fParams[i] +
-			      ";" + fParams[i]).c_str(),
-			     npoints, limlow, limhigh);
+                             ("Chi2Scan1D_" + fParams[i] +
+                              ";" + fParams[i]).c_str(),
+                             npoints, limlow, limhigh);
 
     // Fill bins
-    for (int x = 0; x < contour->GetNbinsX(); x++){
+    for (int x = 0; x < contour->GetNbinsX(); x++) {
 
       // Set X Val
-      fCurVals[fParams[i]] = contour->GetXaxis()->GetBinCenter(x+1);
+      fCurVals[fParams[i]] = contour->GetXaxis()->GetBinCenter(x + 1);
 
       // Run Eval
       double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
       double  chi2 = fSampleFCN->DoEval( vals );
       delete vals;
 
       // Fill Contour
-      contour->SetBinContent(x+1, chi2);
+      contour->SetBinContent(x + 1, chi2);
     }
 
     // Save contour
     contour->Write();
 
     // Reset Parameter
     fCurVals[fParams[i]] = scanmiddlepoint;
 
     // Save TTree
     fSampleFCN->WriteIterationTree();
   }
 
   return;
 }
 
 //*************************************
-void MinimizerRoutines::Chi2Scan2D(){
+void MinimizerRoutines::Chi2Scan2D() {
 //*************************************
 
   // Chi2 Scan 2D
   // Creates a 2D chi2 scan by stepping through all free parameters
   // Works for all pairwise combos of free parameters
 
   // Scan I
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     if (fFixVals[fParams[i]]) continue;
 
     // Scan J
-    for (UInt_t j = 0; j < i; j++){
+    for (UInt_t j = 0; j < i; j++) {
       if (fFixVals[fParams[j]]) continue;
 
       fSampleFCN->CreateIterationTree( fParams[i] + "_" +
-					fParams[j] + "_" +
-					"scan2D_iterations",
-					FitBase::GetRW() );
+                                       fParams[j] + "_" +
+                                       "scan2D_iterations",
+                                       FitBase::GetRW() );
 
       double scanmid_i = fCurVals[fParams[i]];
       double scanmid_j = fCurVals[fParams[j]];
 
       double limlow_i  = fMinVals[fParams[i]];
       double limhigh_i = fMaxVals[fParams[i]];
       double step_i    = fStepVals[fParams[i]];
 
       double limlow_j  = fMinVals[fParams[j]];
       double limhigh_j = fMaxVals[fParams[j]];
       double step_j    = fStepVals[fParams[j]];
 
-      int npoints_i = int( fabs(limhigh_i - limlow_i)/(step_i+0.) ) + 1;
-      int npoints_j = int( fabs(limhigh_j - limlow_j)/(step_j+0.) ) + 1;
+      int npoints_i = int( fabs(limhigh_i - limlow_i) / (step_i + 0.) ) + 1;
+      int npoints_j = int( fabs(limhigh_j - limlow_j) / (step_j + 0.) ) + 1;
 
       TH2D* contour = new TH2D(("Chi2Scan2D_" + fParams[i] + "_" + fParams[j]).c_str(),
-			       ("Chi2Scan2D_" + fParams[i] + "_" + fParams[j] +
-				";" + fParams[i] + ";" + fParams[j]).c_str(),
-			       npoints_i, limlow_i, limhigh_i,
-			       npoints_j, limlow_j, limhigh_j );
+                               ("Chi2Scan2D_" + fParams[i] + "_" + fParams[j] +
+                                ";" + fParams[i] + ";" + fParams[j]).c_str(),
+                               npoints_i, limlow_i, limhigh_i,
+                               npoints_j, limlow_j, limhigh_j );
 
       // Begin Scan
-      LOG(FIT)<<"Running scan for "<<fParams[i]<<" "<<fParams[j]<<endl;
+      LOG(FIT) << "Running scan for " << fParams[i] << " " << fParams[j] << std::endl;
 
       // Fill bins
-      for (int x = 0; x < contour->GetNbinsX(); x++){
+      for (int x = 0; x < contour->GetNbinsX(); x++) {
 
         // Set X Val
-        fCurVals[fParams[i]] = contour->GetXaxis()->GetBinCenter(x+1);
+        fCurVals[fParams[i]] = contour->GetXaxis()->GetBinCenter(x + 1);
 
         // Loop Y
-        for (int y = 0; y < contour->GetNbinsY(); y++){
+        for (int y = 0; y < contour->GetNbinsY(); y++) {
 
           // Set Y Val
-          fCurVals[fParams[j]] = contour->GetYaxis()->GetBinCenter(y+1);
+          fCurVals[fParams[j]] = contour->GetYaxis()->GetBinCenter(y + 1);
 
-	  // Run Eval
-	  double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
-	  double  chi2 = fSampleFCN->DoEval( vals );
-	  delete vals;
+          // Run Eval
+          double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
+          double  chi2 = fSampleFCN->DoEval( vals );
+          delete vals;
 
           // Fill Contour
-          contour->SetBinContent(x+1,y+1, chi2);
+          contour->SetBinContent(x + 1, y + 1, chi2);
 
           fCurVals[fParams[j]] = scanmid_j;
         }
 
         fCurVals[fParams[i]] = scanmid_i;
         fCurVals[fParams[j]] = scanmid_j;
       }
 
       // Save contour
       contour->Write();
 
       // Save Iterations
       fSampleFCN->WriteIterationTree();
 
     }
   }
 
   return;
 }
 
 //*************************************
-void MinimizerRoutines::CreateContours(){
+void MinimizerRoutines::CreateContours() {
 //*************************************
 
   // Use MINUIT for this if possible
-  ERR(FTL) << " Contours not yet implemented as it is really slow!" << endl;
+  ERR(FTL) << " Contours not yet implemented as it is really slow!" << std::endl;
   throw;
 
   return;
 }
 
 //*************************************
-int MinimizerRoutines::FixAtLimit(){
+int MinimizerRoutines::FixAtLimit() {
 //*************************************
 
   bool fixedparam = false;
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams.at(i);
     if (fFixVals[syst]) continue;
 
     double curVal = fCurVals.at(syst);
     double minVal = fMinVals.at(syst);
     double maxVal = fMinVals.at(syst);
 
-    if (fabs(curVal - minVal) < 0.0001){
+    if (fabs(curVal - minVal) < 0.0001) {
       fCurVals[syst] = minVal;
       fFixVals[syst] = true;
       fixedparam = true;
     }
 
-    if (fabs(maxVal - curVal) < 0.0001){
+    if (fabs(maxVal - curVal) < 0.0001) {
       fCurVals[syst] = maxVal;
       fFixVals[syst] = true;
       fixedparam = true;
     }
   }
 
-  if (!fixedparam){
-    LOG(FIT) << "No dials needed fixing!" << endl;
+  if (!fixedparam) {
+    LOG(FIT) << "No dials needed fixing!" << std::endl;
     return kNoChange;
-  }else return kStateChange;
+  } else return kStateChange;
 }
 
 
 /*
   Write Functions
 */
 //*************************************
-void MinimizerRoutines::SaveResults(){
+void MinimizerRoutines::SaveResults() {
 //*************************************
 
   fOutputRootFile->cd();
 
-  if (fMinimizer){
+  if (fMinimizer) {
     SetupCovariance();
     SaveMinimizerState();
   }
 
   SaveCurrentState();
 
 }
 
 //*************************************
-void MinimizerRoutines::SaveMinimizerState(){
+void MinimizerRoutines::SaveMinimizerState() {
 //*************************************
 
-  if (!fMinimizer){
-    ERR(FTL) << "Can't save minimizer state without min object" << endl;
+  if (!fMinimizer) {
+    ERR(FTL) << "Can't save minimizer state without min object" << std::endl;
     throw;
   }
 
   // Save main fit tree
   fSampleFCN->WriteIterationTree();
 
   // Get Vals and Errors
   GetMinimizerState();
 
   // Save tree with fit status
   std::vector<std::string> nameVect;
   std::vector<double>      valVect;
   std::vector<double>      errVect;
   std::vector<double>      minVect;
   std::vector<double>      maxVect;
   std::vector<double>      startVect;
   std::vector<int>      endfixVect;
   std::vector<int>      startfixVect;
 
   //  int NFREEPARS = fMinimizer->NFree();
   int NPARS = fMinimizer->NDim();
 
   int ipar = 0;
   // Dial Vals
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string name = fParams.at(i);
 
     nameVect    .push_back( name );
 
     valVect     .push_back( fCurVals.at(name)   );
     errVect     .push_back( fErrorVals.at(name) );
     minVect     .push_back( fMinVals.at(name)   );
     maxVect     .push_back( fMaxVals.at(name)   );
 
     startVect   .push_back( fStartVals.at(name) );
     endfixVect  .push_back( fFixVals.at(name)      );
     startfixVect.push_back( fStartFixVals.at(name) );
 
     ipar++;
   }
 
   int NFREE = fMinimizer->NFree();
   int NDIM  = fMinimizer->NDim();
 
   double CHI2 = fSampleFCN->GetLikelihood();
   int NBINS = fSampleFCN->GetNDOF();
   int NDOF = NBINS - NFREE;
 
   // Write fit results
-  TTree* fit_tree = new TTree("fit_result","fit_result");
-  fit_tree->Branch("parameter_names",&nameVect);
-  fit_tree->Branch("parameter_values",&valVect);
-  fit_tree->Branch("parameter_errors",&errVect);
-  fit_tree->Branch("parameter_min",&minVect);
-  fit_tree->Branch("parameter_max",&maxVect);
-  fit_tree->Branch("parameter_start",&startVect);
-  fit_tree->Branch("parameter_fix",&endfixVect);
-  fit_tree->Branch("parameter_startfix",&startfixVect);
-  fit_tree->Branch("CHI2",&CHI2,"CHI2/D");
-  fit_tree->Branch("NDOF",&NDOF,"NDOF/I");
-  fit_tree->Branch("NBINS",&NBINS,"NBINS/I");
-  fit_tree->Branch("NDIM",&NDIM,"NDIM/I");
-  fit_tree->Branch("NFREE",&NFREE,"NFREE/I");
+  TTree* fit_tree = new TTree("fit_result", "fit_result");
+  fit_tree->Branch("parameter_names", &nameVect);
+  fit_tree->Branch("parameter_values", &valVect);
+  fit_tree->Branch("parameter_errors", &errVect);
+  fit_tree->Branch("parameter_min", &minVect);
+  fit_tree->Branch("parameter_max", &maxVect);
+  fit_tree->Branch("parameter_start", &startVect);
+  fit_tree->Branch("parameter_fix", &endfixVect);
+  fit_tree->Branch("parameter_startfix", &startfixVect);
+  fit_tree->Branch("CHI2", &CHI2, "CHI2/D");
+  fit_tree->Branch("NDOF", &NDOF, "NDOF/I");
+  fit_tree->Branch("NBINS", &NBINS, "NBINS/I");
+  fit_tree->Branch("NDIM", &NDIM, "NDIM/I");
+  fit_tree->Branch("NFREE", &NFREE, "NFREE/I");
   fit_tree->Fill();
   fit_tree->Write();
 
   // Make dial variables
-  TH1D dialvar  = TH1D("fit_dials","fit_dials",NPARS,0,NPARS);
-  TH1D startvar = TH1D("start_dials","start_dials",NPARS,0,NPARS);
-  TH1D minvar   = TH1D("min_dials","min_dials",NPARS,0,NPARS);
-  TH1D maxvar   = TH1D("max_dials","max_dials",NPARS,0,NPARS);
+  TH1D dialvar  = TH1D("fit_dials", "fit_dials", NPARS, 0, NPARS);
+  TH1D startvar = TH1D("start_dials", "start_dials", NPARS, 0, NPARS);
+  TH1D minvar   = TH1D("min_dials", "min_dials", NPARS, 0, NPARS);
+  TH1D maxvar   = TH1D("max_dials", "max_dials", NPARS, 0, NPARS);
 
-  TH1D dialvarfree  = TH1D("fit_dials_free","fit_dials_free",NFREE,0,NFREE);
-  TH1D startvarfree = TH1D("start_dials_free","start_dials_free",NFREE,0,NFREE);
-  TH1D minvarfree   = TH1D("min_dials_free","min_dials_free",NFREE,0,NFREE);
-  TH1D maxvarfree   = TH1D("max_dials_free","max_dials_free",NFREE,0,NFREE);
+  TH1D dialvarfree  = TH1D("fit_dials_free", "fit_dials_free", NFREE, 0, NFREE);
+  TH1D startvarfree = TH1D("start_dials_free", "start_dials_free", NFREE, 0, NFREE);
+  TH1D minvarfree   = TH1D("min_dials_free", "min_dials_free", NFREE, 0, NFREE);
+  TH1D maxvarfree   = TH1D("max_dials_free", "max_dials_free", NFREE, 0, NFREE);
 
   int freecount = 0;
 
-  for (UInt_t i = 0; i < nameVect.size(); i++){
+  for (UInt_t i = 0; i < nameVect.size(); i++) {
     std::string name = nameVect.at(i);
 
-    dialvar.SetBinContent(i+1, valVect.at(i));
-    dialvar.SetBinError(i+1, errVect.at(i));
-    dialvar.GetXaxis()->SetBinLabel(i+1, name.c_str());
+    dialvar.SetBinContent(i + 1, valVect.at(i));
+    dialvar.SetBinError(i + 1, errVect.at(i));
+    dialvar.GetXaxis()->SetBinLabel(i + 1, name.c_str());
 
-    startvar.SetBinContent(i+1, startVect.at(i));
-    startvar.GetXaxis()->SetBinLabel(i+1, name.c_str());
+    startvar.SetBinContent(i + 1, startVect.at(i));
+    startvar.GetXaxis()->SetBinLabel(i + 1, name.c_str());
 
-    minvar.SetBinContent(i+1,   minVect.at(i));
-    minvar.GetXaxis()->SetBinLabel(i+1, name.c_str());
+    minvar.SetBinContent(i + 1,   minVect.at(i));
+    minvar.GetXaxis()->SetBinLabel(i + 1, name.c_str());
 
-    maxvar.SetBinContent(i+1,   maxVect.at(i));
-    maxvar.GetXaxis()->SetBinLabel(i+1, name.c_str());
+    maxvar.SetBinContent(i + 1,   maxVect.at(i));
+    maxvar.GetXaxis()->SetBinLabel(i + 1, name.c_str());
 
-    if (NFREE > 0){
-      if (!startfixVect.at(i)){
-	freecount++;
+    if (NFREE > 0) {
+      if (!startfixVect.at(i)) {
+        freecount++;
 
-	dialvarfree.SetBinContent(freecount, valVect.at(i));
-	dialvarfree.SetBinError(freecount, errVect.at(i));
-	dialvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
+        dialvarfree.SetBinContent(freecount, valVect.at(i));
+        dialvarfree.SetBinError(freecount, errVect.at(i));
+        dialvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
 
-	startvarfree.SetBinContent(freecount, startVect.at(i));
-	startvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
+        startvarfree.SetBinContent(freecount, startVect.at(i));
+        startvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
 
-	minvarfree.SetBinContent(freecount,   minVect.at(i));
-	minvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
+        minvarfree.SetBinContent(freecount,   minVect.at(i));
+        minvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
 
-	maxvarfree.SetBinContent(freecount,   maxVect.at(i));
-	maxvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
+        maxvarfree.SetBinContent(freecount,   maxVect.at(i));
+        maxvarfree.GetXaxis()->SetBinLabel(freecount, name.c_str());
 
       }
     }
   }
 
   // Save Dial Plots
   dialvar.Write();
   startvar.Write();
   minvar.Write();
   maxvar.Write();
 
-  if (NFREE > 0){
+  if (NFREE > 0) {
     dialvarfree.Write();
     startvarfree.Write();
     minvarfree.Write();
     maxvarfree.Write();
   }
 
   // Save fit_status plot
-  TH1D statusplot = TH1D("fit_status","fit_status",8,0,8);
+  TH1D statusplot = TH1D("fit_status", "fit_status", 8, 0, 8);
   std::string fit_labels[8] = {"status", "cov_status",  \
-			       "maxiter", "maxfunc",	\
-			       "iter",    "func",	\
-			       "precision", "tolerance"};
+                               "maxiter", "maxfunc",  \
+                               "iter",    "func", \
+                               "precision", "tolerance"
+                              };
   double fit_vals[8];
   fit_vals[0] = fMinimizer->Status() + 0.;
   fit_vals[1] = fMinimizer->CovMatrixStatus() + 0.;
   fit_vals[2] = fMinimizer->MaxIterations() + 0.;
-  fit_vals[3] = fMinimizer->MaxFunctionCalls()+ 0.;
+  fit_vals[3] = fMinimizer->MaxFunctionCalls() + 0.;
   fit_vals[4] = fMinimizer->NIterations() + 0.;
   fit_vals[5] = fMinimizer->NCalls() + 0.;
   fit_vals[6] = fMinimizer->Precision() + 0.;
   fit_vals[7] = fMinimizer->Tolerance() + 0.;
 
-  for (int i = 0; i < 8; i++){
-    statusplot.SetBinContent(i+1, fit_vals[i]);
-    statusplot.GetXaxis()->SetBinLabel(i+1, fit_labels[i].c_str());
+  for (int i = 0; i < 8; i++) {
+    statusplot.SetBinContent(i + 1, fit_vals[i]);
+    statusplot.GetXaxis()->SetBinLabel(i + 1, fit_labels[i].c_str());
   }
 
   statusplot.Write();
 
   // Save Covars
   if (fCovar) fCovar->Write();
   if (fCovFree) fCovFree->Write();
   if (fCorrel) fCorrel->Write();
   if (fCorFree) fCorFree->Write();
   if (fDecomp) fDecomp->Write();
   if (fDecFree) fDecFree->Write();
 
   return;
 }
 
 //*************************************
-void MinimizerRoutines::SaveCurrentState(std::string subdir){
+void MinimizerRoutines::SaveCurrentState(std::string subdir) {
 //*************************************
 
-  LOG(FIT)<<"Saving current full FCN predictions" <<std::endl;
+  LOG(FIT) << "Saving current full FCN predictions" << std::endl;
 
   // Setup DIRS
   TDirectory* curdir = gDirectory;
-  if (!subdir.empty()){
-    TDirectory* newdir =(TDirectory*) gDirectory->mkdir(subdir.c_str());
+  if (!subdir.empty()) {
+    TDirectory* newdir = (TDirectory*) gDirectory->mkdir(subdir.c_str());
     newdir->cd();
   }
 
   FitBase::GetRW()->Reconfigure();
   fSampleFCN->ReconfigureAllEvents();
   fSampleFCN->Write();
 
   // Change back to current DIR
   curdir->cd();
 
   return;
 }
 
 //*************************************
-void MinimizerRoutines::SaveNominal(){
+void MinimizerRoutines::SaveNominal() {
 //*************************************
 
   fOutputRootFile->cd();
 
-  LOG(FIT)<<"Saving Nominal Predictions (be cautious with this)" <<std::endl;
+  LOG(FIT) << "Saving Nominal Predictions (be cautious with this)" << std::endl;
   FitBase::GetRW()->Reconfigure();
   SaveCurrentState("nominal");
 
 };
 
 //*************************************
-void MinimizerRoutines::SavePrefit(){
+void MinimizerRoutines::SavePrefit() {
 //*************************************
 
   fOutputRootFile->cd();
 
-  LOG(FIT)<<"Saving Prefit Predictions"<<std::endl;
+  LOG(FIT) << "Saving Prefit Predictions" << std::endl;
   UpdateRWEngine(fStartVals);
   SaveCurrentState("prefit");
   UpdateRWEngine(fCurVals);
 
 };
 
 
 /*
   MISC Functions
 */
 //*************************************
-int MinimizerRoutines::GetStatus(){
+int MinimizerRoutines::GetStatus() {
 //*************************************
 
   return 0;
 }
 
 //*************************************
-void MinimizerRoutines::SetupCovariance(){
+void MinimizerRoutines::SetupCovariance() {
 //*************************************
 
   // Remove covares if they exist
   if (fCovar) delete fCovar;
   if (fCovFree) delete fCovFree;
   if (fCorrel) delete fCorrel;
   if (fCorFree) delete fCorFree;
   if (fDecomp) delete fDecomp;
   if (fDecFree) delete fDecFree;
 
-  LOG(FIT) << "Building covariance matrix.." << endl;
+  LOG(FIT) << "Building covariance matrix.." << std::endl;
 
   int NFREE = 0;
   int NDIM = 0;
 
 
   // Get NFREE from min or from vals (for cases when doing throws)
-  if (fMinimizer){
+  if (fMinimizer) {
     NFREE = fMinimizer->NFree();
     NDIM  = fMinimizer->NDim();
   } else {
     NDIM = fParams.size();
-    for (UInt_t i = 0; i < fParams.size(); i++){
+    for (UInt_t i = 0; i < fParams.size(); i++) {
       if (!fFixVals[fParams[i]]) NFREE++;
     }
   }
 
   if (NDIM == 0) return;
-  LOG(FIT) << "NFREE == " << NFREE << endl;
-  fCovar = new TH2D("covariance","covariance",NDIM,0,NDIM,NDIM,0,NDIM);
-  if (NFREE > 0){
+  LOG(FIT) << "NFREE == " << NFREE << std::endl;
+  fCovar = new TH2D("covariance", "covariance", NDIM, 0, NDIM, NDIM, 0, NDIM);
+  if (NFREE > 0) {
     fCovFree = new TH2D("covariance_free",
-			  "covariance_free",
-			  NFREE,0,NFREE,
-			  NFREE,0,NFREE);
+                        "covariance_free",
+                        NFREE, 0, NFREE,
+                        NFREE, 0, NFREE);
   } else {
     fCovFree = NULL;
   }
 
   // Set Bin Labels
   int countall = 0;
   int countfree = 0;
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
 
-    fCovar->GetXaxis()->SetBinLabel(countall+1,fParams[i].c_str());
-    fCovar->GetYaxis()->SetBinLabel(countall+1,fParams[i].c_str());
+    fCovar->GetXaxis()->SetBinLabel(countall + 1, fParams[i].c_str());
+    fCovar->GetYaxis()->SetBinLabel(countall + 1, fParams[i].c_str());
     countall++;
 
-    if (!fFixVals[fParams[i]] and NFREE > 0){
-      fCovFree->GetXaxis()->SetBinLabel(countfree+1,fParams[i].c_str());
-      fCovFree->GetYaxis()->SetBinLabel(countfree+1,fParams[i].c_str());
+    if (!fFixVals[fParams[i]] and NFREE > 0) {
+      fCovFree->GetXaxis()->SetBinLabel(countfree + 1, fParams[i].c_str());
+      fCovFree->GetYaxis()->SetBinLabel(countfree + 1, fParams[i].c_str());
       countfree++;
     }
   }
 
-  fCorrel = PlotUtils::GetCorrelationPlot(fCovar,"correlation");
-  fDecomp = PlotUtils::GetDecompPlot(fCovar,"decomposition");
+  fCorrel = PlotUtils::GetCorrelationPlot(fCovar, "correlation");
+  fDecomp = PlotUtils::GetDecompPlot(fCovar, "decomposition");
 
   if (NFREE > 0) {
     fCorFree = PlotUtils::GetCorrelationPlot(fCovFree, "correlation_free");
-    fDecFree = PlotUtils::GetDecompPlot(fCovFree,"decomposition_free");
+    fDecFree = PlotUtils::GetDecompPlot(fCovFree, "decomposition_free");
   } else {
     fCorFree = NULL;
     fDecFree = NULL;
   }
 
   return;
 };
 
 //*************************************
-void MinimizerRoutines::ThrowCovariance(bool uniformly){
+void MinimizerRoutines::ThrowCovariance(bool uniformly) {
 //*************************************
   std::vector<double> rands;
 
   if (!fDecFree) {
-    ERR(WRN) << "Trying to throw 0 free parameters"<<std::endl;
+    ERR(WRN) << "Trying to throw 0 free parameters" << std::endl;
     return;
   }
 
   // Generate Random Gaussians
-  for (Int_t i = 0; i < fDecFree->GetNbinsX(); i++){
-    rands.push_back(gRandom->Gaus(0.0,1.0));
+  for (Int_t i = 0; i < fDecFree->GetNbinsX(); i++) {
+    rands.push_back(gRandom->Gaus(0.0, 1.0));
   }
 
   // Reset Thrown Values
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     fThrownVals[fParams[i]] = fCurVals[fParams[i]];
   }
 
   // Loop and get decomp
-  for (Int_t i = 0; i < fDecFree->GetNbinsX(); i++){
+  for (Int_t i = 0; i < fDecFree->GetNbinsX(); i++) {
 
-    std::string parname = std::string(fDecFree->GetXaxis()->GetBinLabel(i+1));
+    std::string parname = std::string(fDecFree->GetXaxis()->GetBinLabel(i + 1));
     double mod = 0.0;
 
-    if (!uniformly){
-      for (Int_t j = 0; j < fDecFree->GetNbinsY(); j++){
-	mod += rands[j] * fDecFree->GetBinContent(j+1,i+1);
+    if (!uniformly) {
+      for (Int_t j = 0; j < fDecFree->GetNbinsY(); j++) {
+        mod += rands[j] * fDecFree->GetBinContent(j + 1, i + 1);
       }
     }
 
     if (fCurVals.find(parname) != fCurVals.end()) {
 
-      if (uniformly) fThrownVals[parname] = gRandom->Uniform(fMinVals[parname],fMaxVals[parname]);
-      else {  fThrownVals[parname] = 	  fCurVals[parname] + mod; }
+      if (uniformly) fThrownVals[parname] = gRandom->Uniform(fMinVals[parname], fMaxVals[parname]);
+      else {  fThrownVals[parname] =    fCurVals[parname] + mod; }
 
     }
   }
 
   // Check Limits
-  for (UInt_t i = 0; i < fParams.size(); i++){
+  for (UInt_t i = 0; i < fParams.size(); i++) {
     std::string syst = fParams[i];
     if (fFixVals[syst]) continue;
     if (fThrownVals[syst] < fMinVals[syst]) fThrownVals[syst] = fMinVals[syst];
     if (fThrownVals[syst] > fMaxVals[syst]) fThrownVals[syst] = fMaxVals[syst];
   }
 
   return;
 };
 
 //*************************************
-void MinimizerRoutines::GenerateErrorBands(){
+void MinimizerRoutines::GenerateErrorBands() {
 //*************************************
 
   TDirectory* errorDIR = (TDirectory*) fOutputRootFile->mkdir("error_bands");
   errorDIR->cd();
 
   // Make a second file to store throws 
   std::string tempFileName = fOutputFile;
   if (tempFileName.find(".root") != std::string::npos) tempFileName.erase(tempFileName.find(".root"), 5);
   tempFileName += ".throws.root";
   TFile* tempfile = new TFile(tempFileName.c_str(),"RECREATE");
 
   tempfile->cd();
   int nthrows = FitPar::Config().GetParI("error_throws");
 
   UpdateRWEngine(fCurVals);
   fSampleFCN->ReconfigureAllEvents();
 
   TDirectory* nominal = (TDirectory*) tempfile->mkdir("nominal");
   nominal->cd();
   fSampleFCN->Write();
 
 
   TDirectory* outnominal = (TDirectory*) fOutputRootFile->mkdir("nominal_throw");
   outnominal->cd();
   fSampleFCN->Write();
 
 
   errorDIR->cd();
-  TTree* parameterTree = new TTree("throws","throws");
+  TTree* parameterTree = new TTree("throws", "throws");
   double chi2;
   for (UInt_t i = 0; i < fParams.size(); i++)
     parameterTree->Branch(fParams[i].c_str(), &fThrownVals[fParams[i]], (fParams[i] + "/D").c_str());
-  parameterTree->Branch("chi2",&chi2,"chi2/D");
+  parameterTree->Branch("chi2", &chi2, "chi2/D");
 
 
   bool uniformly = FitPar::Config().GetParB("error_uniform");
 
   // Run Throws and save
-  for (Int_t i = 0; i < nthrows; i++){
+  for (Int_t i = 0; i < nthrows; i++) {
 
-    TDirectory* throwfolder = (TDirectory*)tempfile->mkdir(Form("throw_%i",i));
+    TDirectory* throwfolder = (TDirectory*)tempfile->mkdir(Form("throw_%i", i));
     throwfolder->cd();
 
     // Generate Random Parameter Throw
     ThrowCovariance(uniformly);
 
     // Run Eval
     double *vals = FitUtils::GetArrayFromMap( fParams, fThrownVals );
     chi2 = fSampleFCN->DoEval( vals );
     delete vals;
 
     // Save the FCN
     fSampleFCN->Write();
 
     parameterTree->Fill();
   }
 
   errorDIR->cd();
   fDecFree->Write();
   fCovFree->Write();
   parameterTree->Write();
 
   delete parameterTree;
 
   // Now go through the keys in the temporary file and look for TH1D, and TH2D plots
   TIter next(nominal->GetListOfKeys());
   TKey *key;
   while ((key = (TKey*)next())) {
     TClass *cl = gROOT->GetClass(key->GetClassName());
     if (!cl->InheritsFrom("TH1D") and !cl->InheritsFrom("TH2D")) continue;
     TH1D *baseplot = (TH1D*)key->ReadObj();
     std::string plotname = std::string(baseplot->GetName());
 
-    int nbins = baseplot->GetNbinsX()*baseplot->GetNbinsY();
+    int nbins = baseplot->GetNbinsX() * baseplot->GetNbinsY();
 
     // Setup TProfile with RMS option
-    TProfile* tprof = new TProfile((plotname + "_prof").c_str(),(plotname + "_prof").c_str(),nbins, 0, nbins, "S");
+    TProfile* tprof = new TProfile((plotname + "_prof").c_str(), (plotname + "_prof").c_str(), nbins, 0, nbins, "S");
 
     // Setup The TTREE
     double* bincontents;
     bincontents = new double[nbins];
 
     double* binlowest;
     binlowest = new double[nbins];
 
     double* binhighest;
     binhighest = new double[nbins];
 
     errorDIR->cd();
     TTree* bintree = new TTree((plotname + "_tree").c_str(), (plotname + "_tree").c_str());
-    for (Int_t i = 0; i < nbins; i++){
+    for (Int_t i = 0; i < nbins; i++) {
       bincontents[i] = 0.0;
       binhighest[i] = 0.0;
       binlowest[i] = 0.0;
-      bintree->Branch(Form("content_%i",i),&bincontents[i],Form("content_%i/D",i));
+      bintree->Branch(Form("content_%i", i), &bincontents[i], Form("content_%i/D", i));
     }
 
-    for (Int_t i = 0; i < nthrows; i++){
-      TH1* newplot = (TH1*)tempfile->Get(Form(("throw_%i/" + plotname).c_str(),i));
+    for (Int_t i = 0; i < nthrows; i++) {
+      TH1* newplot = (TH1*)tempfile->Get(Form(("throw_%i/" + plotname).c_str(), i));
 
-      for (Int_t j = 0; j < nbins; j++){
-	tprof->Fill(j+0.5, newplot->GetBinContent(j+1));
-	bincontents[j] = newplot->GetBinContent(j+1);
+      for (Int_t j = 0; j < nbins; j++) {
+        tprof->Fill(j + 0.5, newplot->GetBinContent(j + 1));
+        bincontents[j] = newplot->GetBinContent(j + 1);
 
-	if (bincontents[j] < binlowest[j] or i == 0) binlowest[j] = bincontents[j];
-	if (bincontents[j] > binhighest[j] or i == 0) binhighest[j] = bincontents[j];
+        if (bincontents[j] < binlowest[j] or i == 0) binlowest[j] = bincontents[j];
+        if (bincontents[j] > binhighest[j] or i == 0) binhighest[j] = bincontents[j];
       }
 
       errorDIR->cd();
       bintree->Fill();
 
       delete newplot;
     }
 
     errorDIR->cd();
 
-    for (Int_t j = 0; j < nbins; j++){
+    for (Int_t j = 0; j < nbins; j++) {
 
-      if (!uniformly){
-	baseplot->SetBinError(j+1,tprof->GetBinError(j+1));
+      if (!uniformly) {
+        baseplot->SetBinError(j + 1, tprof->GetBinError(j + 1));
 
       } else {
-	baseplot->SetBinContent(j+1, (binlowest[j] + binhighest[j]) / 2.0);
-        baseplot->SetBinError(j+1, (binhighest[j] - binlowest[j])/2.0);
+        baseplot->SetBinContent(j + 1, (binlowest[j] + binhighest[j]) / 2.0);
+        baseplot->SetBinError(j + 1, (binhighest[j] - binlowest[j]) / 2.0);
       }
     }
 
     errorDIR->cd();
     baseplot->Write();
     tprof->Write();
     bintree->Write();
 
     delete baseplot;
     delete tprof;
     delete bintree;
     delete [] bincontents;
   }
 
   return;
 };
diff --git a/src/Routines/MinimizerRoutines.h b/src/Routines/MinimizerRoutines.h
index f8a7a02..548ee25 100755
--- a/src/Routines/MinimizerRoutines.h
+++ b/src/Routines/MinimizerRoutines.h
@@ -1,262 +1,267 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef MINIMIZER_ROUTINES_H
 #define MINIMIZER_ROUTINES_H
 
 /*!
  *  \addtogroup Minimizer
  *  @{
  */
 
 #include "TH1.h"
 #include "TF1.h"
 #include "TMatrixD.h"
 #include "TVectorD.h"
 #include "Minuit2/FCNBase.h"
 #include "TFitterMinuit.h"
 #include "TSystem.h"
 #include "TFile.h"
 #include "TProfile.h"
 
 
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 #include "FitEvent.h"
 #include "JointFCN.h"
 #include "MinimizerFCN.h"
 #include "FitParameters.h"
 
 #include "Math/Minimizer.h"
 #include "Math/Factory.h"
 #include "Math/Functor.h"
 #include "FitLogger.h"
+#include "ParserUtils.h"
 
 enum minstate {
   kErrorStatus = -1,
   kGoodStatus,
   kFitError,
   kNoChange,
   kFitFinished,
   kFitUnfinished,
   kStateChange,
 };
 
 //*************************************
 //! Collects all possible fit routines into a single class to avoid repeated code
 class MinimizerRoutines{
 //*************************************
 
 public:
 
   /*
     Constructor/Destructor
   */
 
   //! Constructor reads in arguments given at the command line for the fit here.
   MinimizerRoutines(int argc, char* argv[]);
     
   //! Default destructor
   ~MinimizerRoutines();
 
   //! Reset everything to default/NULL
   void Init();
   
   /*
     Input Functions
   */
 
   //! Splits the arguments ready for initial setup
   void ParseArgs(int argc, char* argv[]);
 
   //! Sorts out configuration and verbosity right at the very start.
   //! Calls readCard to set everything else up.
   void InitialSetup();
 
   //! Loops through each line of the card file and passes it to other read functions
   void ReadCard(std::string cardfile);
 
   //! Check for parameter string in the line and assign the correct type.
   //! Fills maps for each of the parameters
   int ReadParameters(std::string parstring);
 
   //! Reads in fake parameters and assigns them (Requires the parameter to be included as a normal parameter as well)
   int ReadFakeDataPars(std::string parstring);
 
   //! Read in the samples so we can set up the free normalisation dials if required
   int ReadSamples(std::string sampleString);
+void SetupMinimizerFromXML();
 
   /*
     Setup Functions
   */
 
   //! Setup the configuration given the arguments passed at the commandline and card file
   void SetupConfig();
 
   //! Setups up our custom RW engine with all the parameters passed in the card file
   void SetupRWEngine();
 
   //! Setups up the jointFCN.
   void SetupFCN();
 
   //! Sets up the minimizerObj for ROOT. there are cases where this is called repeatedly, e.g. If you are using a brute force scan before using Migrad.
   void SetupFitter(std::string routine);
 
   //! Set the current data histograms in each sample to the fake data.
   void SetFakeData();
 
   //! Setup the covariances with the correct dimensions. At the start this is either uncorrelated or merged given all the input covariances.
   //! At the end of the fit this produces the blank covariances which can then be filled by the minimizerObj with best fit covariances.
   void SetupCovariance();
 
   /*
     Fitting Functions
   */
 
   //! Main function to actually start iterating over the different required fit routines
   void Run();
 
   //! Given a new map change the values that the RW engine is currently set to
   void UpdateRWEngine(std::map<std::string,double>& updateVals);
 
   //! Given a single routine (see tutorial for options) run that fit routine now.
   int RunFitRoutine(std::string routine);
 
   //! Get the current state of minimizerObj and fill it into currentVals and currentNorms
   void GetMinimizerState();
 
   //! Print current value
   void PrintState();
   
   //! Performs a fit routine where the input.maxevents is set to a much lower value to try and move closer to the best fit minimum.
   void LowStatRoutine(std::string routine);
 
   //! Perform a chi2 scan in 1D around the current point
   void Create1DScans();
 
   //! Perform a chi2 scan in 2D around the current point
   void Chi2Scan2D();
 
   //! Currently a placeholder NEEDS UPDATING
   void CreateContours();
 
   //! If any currentVals are close to the limits set them to the limit and fix them
   int FixAtLimit();
 
   //! Throw the current covariance of dial values we have, and fill the thrownVals and thrownNorms maps.
   //! If uniformly is true parameters will be thrown uniformly between their upper and lower limits.
   void ThrowCovariance(bool uniformly);
 
   //! Given the covariance we currently have generate error bands by throwing the covariance.
   //! The FitPar config "error_uniform" defines whether to throw using the covariance or uniformly.
   //! The FitPar config "error_throws" defines how many throws are needed.
   //! Currently only supports TH1D plots.
   void GenerateErrorBands();
 
   /*
     Write Functions
   */
 
   //! Write plots and TTrees listing the minimizerObj result of the fit to file
   void SaveMinimizerState();
 
   //! Save the sample plots for current MC
   //! dir if not empty forces plots to be saved in a subdirectory of outputfile
   void SaveCurrentState(std::string subdir="");
 
   //! Save starting predictions into a seperate folder
   void SaveNominal();
 
   //! Save predictions before the fit is ran into a seperate folder
   void SavePrefit();
 
   void SaveResults();
   /*
     MISC Functions
   */
 
   //! Get previous fit status from a file
   Int_t GetStatus();
 
 protected:
 
   //! Our Custom ReWeight Object
   FitWeight* rw;
 
   std::string fOutputFile;
   std::string fInputFile;
 
   TFile* fInputRootFile;
   TFile* fOutputRootFile;
 
   //! Flag for whether the fit should be continued if an output file is already found.
   bool fitContinue;
 
   //! Minimizer Object for handling roots different minimizer methods
   ROOT::Math::Minimizer* fMinimizer;
 
   JointFCN* fSampleFCN;
   MinimizerFCN* fMinimizerFCN;
   ROOT::Math::Functor* fCallFunctor;
 
   int nfreepars;
 
   std::string fCardFile;
 
   std::string fStrategy;
   std::vector<std::string> fRoutines;
   std::string fAllowedRoutines;
   
   std::string fFakeDataInput;
 
   // Input Dial Vals
   //! Vector of dial names
   std::vector<std::string> fParams;
   std::map<std::string, std::string> fStateVals;
   std::map<std::string, double>      fStartVals;
   std::map<std::string, double>      fCurVals;
   std::map<std::string, double>      fErrorVals;
   std::map<std::string, double>      fMinVals;
   std::map<std::string, double>      fMaxVals;
   std::map<std::string, double>      fStepVals;
   std::map<std::string, int>         fTypeVals;
   std::map<std::string, bool>        fFixVals;
   std::map<std::string, bool>        fStartFixVals;
 
   //! Vector of fake parameter names
   std::map<std::string,double> fFakeVals;
 
   //! Map of thrown parameter names and values (After ThrowCovariance)
   std::map<std::string,double> fThrownVals;
 
   TH2D* fCorrel;
   TH2D* fDecomp;
   TH2D* fCovar;
   
   TH2D* fCorFree;
   TH2D* fDecFree;
   TH2D* fCovFree;
+
+    nuiskey fCompKey;
+
 };
 
 /*! @} */
 #endif
diff --git a/src/Routines/SplineRoutines.cxx b/src/Routines/SplineRoutines.cxx
index aabd204..4cbe86a 100755
--- a/src/Routines/SplineRoutines.cxx
+++ b/src/Routines/SplineRoutines.cxx
@@ -1,918 +1,2593 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#include "StatusMessage.h"
-
 #include "SplineRoutines.h"
 
-/*
-  Constructor/Destructor
-*/
-//************************
 void SplineRoutines::Init() {
-  //************************
 
   fStrategy = "SaveEvents";
   fRoutines.clear();
 
   fCardFile = "";
 
   fSampleFCN = NULL;
   fRW = NULL;
 
-  fAllowedRoutines = ("SaveEvents,SaveSplineEvents");
+  fAllowedRoutines = ("SaveEvents,TestEvents,SaveSplineEvents");
 };
 
-//*************************************
-SplineRoutines::~SplineRoutines(){
-    //*************************************
+SplineRoutines::~SplineRoutines() {
 };
 
-/*
-  Input Functions
-*/
-//*************************************
 SplineRoutines::SplineRoutines(int argc, char* argv[]) {
-  //*************************************
 
-  // Set everything to defaults
+  // Initialise Defaults
   Init();
-  std::vector<std::string> configs_cmd;
-  std::string maxevents_flag = "";
-  int verbosity_flag = 0;
-  int error_flag = 0;
-
-  // If No Arguments print commands
-  for (int i = 1; i < argc; ++i) {
-    if (i + 1 != argc) {
-      // Cardfile
-      if (!std::strcmp(argv[i], "-c")) {
-        fCardFile = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-f")) {
-        fStrategy = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-q")) {
-        configs_cmd.push_back(argv[i + 1]);
-        ++i;
-      } else if (!std::strcmp(argv[i], "-n")) {
-        maxevents_flag = argv[i + 1];
-        ++i;
-      } else if (!std::strcmp(argv[i], "-v")) {
-        verbosity_flag -= 1;
-      } else if (!std::strcmp(argv[i], "+v")) {
-        verbosity_flag += 1;
-      } else if (!std::strcmp(argv[i], "-e")) {
-        error_flag -= 1;
-      } else if (!std::strcmp(argv[i], "+e")) {
-        error_flag += 1;
-      } else {
-        ERR(FTL) << "ERROR: unknown command line option given! - '" << argv[i]
-                 << " " << argv[i + 1] << "'" << std::endl;
-        throw;
-      }
-    }
+  nuisconfig configuration = Config::Get();
+
+  // Default containers
+  std::string cardfile = "";
+  std::string maxevents = "-1";
+  int errorcount = 0;
+  int verbocount = 0;
+  std::vector<std::string> xmlcmds;
+  std::vector<std::string> configargs;
+
+  // Make easier to handle arguments.
+  std::vector<std::string> args = GeneralUtils::LoadCharToVectStr(argc, argv);
+  ParserUtils::ParseArgument(args, "-c", fCardFile, true);
+  ParserUtils::ParseArgument(args, "-o", fOutputFile, false, false);
+  ParserUtils::ParseArgument(args, "-n", maxevents, false, false);
+  ParserUtils::ParseArgument(args, "-f", fStrategy, false, false);
+  ParserUtils::ParseArgument(args, "-i", xmlcmds);
+  ParserUtils::ParseArgument(args, "-q", configargs);
+  ParserUtils::ParseCounter(args, "e", errorcount);
+  ParserUtils::ParseCounter(args, "v", verbocount);
+  ParserUtils::CheckBadArguments(args);
+
+  // Add extra defaults if none given
+  if (fCardFile.empty() and xmlcmds.empty()) {
+    ERR(FTL) << "No input supplied!" << std::endl;
+    throw;
   }
 
-  if (fCardFile.empty()) {
-    ERR(FTL) << "ERROR: card file not specified." << std::endl;
-    ERR(FTL) << "Run with '-h' to see options." << std::endl;
+  if (fOutputFile.empty() and !fCardFile.empty()) {
+    fOutputFile = fCardFile + ".root";
+    ERR(WRN) << "No output supplied so saving it to: " << fOutputFile << std::endl;
+
+  } else if (fOutputFile.empty()) {
+    ERR(FTL) << "No output file or cardfile supplied!" << std::endl;
     throw;
   }
 
-  // Fill fit routines and check they are good
-  fRoutines = GeneralUtils::ParseToStr(fStrategy, ",");
-  for (UInt_t i = 0; i < fRoutines.size(); i++) {
-    if (fAllowedRoutines.find(fRoutines[i]) == std::string::npos) {
-      ERR(FTL) << "Unknown fit routine given! "
-               << "Must be provided as a comma seperated list." << std::endl;
-      ERR(FTL) << "Allowed Routines: " << fAllowedRoutines << std::endl;
-      throw;
-    }
+  // Configuration Setup =============================
+
+  // Check no comp key is available
+  nuiskey fCompKey;
+  if (Config::Get().GetNodes("nuiscomp").empty()) {
+    fCompKey = Config::Get().CreateNode("nuiscomp");
+  } else {
+    fCompKey = Config::Get().GetNodes("nuiscomp")[0];
   }
 
-  // CONFIG
-  // ---------------------------
-  std::string par_dir = GeneralUtils::GetTopLevelDir() + "/parameters/";
-  FitPar::Config().ReadParamFile(par_dir + "config.list.dat");
-  FitPar::Config().ReadParamFile(fCardFile);
+  if (!fCardFile.empty())   fCompKey.AddS("cardfile", fCardFile);
+  fCompKey.AddS("outputfile", fOutputFile);
+  if (!fStrategy.empty())   fCompKey.AddS("strategy", fStrategy);
 
-  for (UInt_t iter = 0; iter < configs_cmd.size(); iter++) {
-    FitPar::Config().ForceParam(configs_cmd[iter]);
-  }
+  // Load XML Cardfile
+  configuration.LoadConfig( fCompKey.GetS("cardfile"), "");
 
-  if (!maxevents_flag.empty()) {
-    FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
+  // Add CMD XML Structs
+  for (size_t i = 0; i < xmlcmds.size(); i++) {
+    configuration.AddXMLLine(xmlcmds[i]);
   }
 
-  if (verbosity_flag != 0) {
-    int curverb = FitPar::Config().GetParI("VERBOSITY");
-    FitPar::Config().SetParI("VERBOSITY", curverb + verbosity_flag);
+  // Add Config Args
+  for (size_t i = 0; i < configargs.size(); i++) {
+    configuration.OverrideConfig(configargs[i]);
   }
-
-  if (error_flag != 0) {
-    int curwarn = FitPar::Config().GetParI("ERROR");
-    FitPar::Config().SetParI("ERROR", curwarn + error_flag);
+  if (maxevents.compare("-1")) {
+    std::cout << "[ NUISANCE ] : Overriding " << "MAXEVENTS=" + maxevents << std::endl;
+    configuration.OverrideConfig("MAXEVENTS=" + maxevents);
   }
 
-  LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
-  ERR_VERB(FitPar::Config().GetParI("ERROR"));
-
-  // CARD
-  // ---------------------------
-  // Parse Card Options
-  ReadCard(fCardFile);
+  // Finish configuration XML
+  configuration.FinaliseConfig(fCompKey.GetS("outputfile") + ".xml");
 
-  // Outputs
-  // ---------------------------
-  // Save Configs to output file
-  //  fOutputRootFile = new TFile(fOutputFile.c_str(),"RECREATE");
-  FitPar::Config().Write();
+  // Add Error Verbo Lines
+  verbocount += Config::Get().GetParI("VERBOSITY");
+  errorcount += Config::Get().GetParI("ERROR");
+  std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+  std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+  // FitPar::log_verb = verbocount;
+  SETVERBOSITY(verbocount);
+  // ERR_VERB(errorcount);
 
   // Starting Setup
   // ---------------------------
   SetupRWEngine();
-  SetupSamples();
-  SetupGenericInputs();
 
   return;
 };
 
+
+/*
+  Setup Functions
+*/
+//*************************************
+void SplineRoutines::SetupRWEngine() {
 //*************************************
-void SplineRoutines::ReadCard(std::string cardfile) {
-  //*************************************
 
-  // Read cardlines into vector
-  std::vector<std::string> cardlines =
-      GeneralUtils::ParseFileToStr(cardfile, "\n");
-  FitPar::Config().cardLines = cardlines;
-
-  // Read Inputs
-  int linecount = 0;
-  for (std::vector<std::string>::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;
-
-    // Read Valid Samples
-    int samstatus = ReadSamples(line);
-    int genstatus = ReadGenericInputs(line);
-    int parstatus = ReadParameters(line);
-    int evtstatus = ReadEventSplines(line);
-    int binstatus = ReadBinSplines(line);
-
-    // Show line if bad to help user
-    if (samstatus == kErrorStatus || genstatus == kErrorStatus ||
-        parstatus == kErrorStatus || evtstatus == kErrorStatus ||
-        binstatus == kErrorStatus) {
-      ERR(FTL) << "Bad Input in cardfile " << fCardFile << " at line "
-               << linecount << "!" << endl;
-      ERR(FTL) << line << endl;
-      throw;
-    }
+  fRW = new FitWeight("splineweight");
+  // std::vector<nuiskey> splinekeys    = Config::QueryKeys("spline");
+  std::vector<nuiskey> parameterkeys = Config::QueryKeys("parameter");
+
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    std::string parname = key.GetS("name");
+    std::string partype = key.GetS("type");
+    double nom = key.GetD("nominal");
+
+    fRW->IncludeDial( key.GetS("name"),
+                      FitBase::ConvDialType(key.GetS("type")), nom);
+    fRW->SetDialValue( key.GetS("name"), key.GetD("nominal") );
+
   }
+  fRW->Reconfigure();
 
   return;
-};
+}
 
-//*****************************************
-int SplineRoutines::ReadEventSplines(std::string splstring) {
-  //*****************************************
-  std::string inputspec = "eventspline dialnames type points";
 
-  // Check spline input
-  if (splstring.find("eventspline") == std::string::npos) return kGoodStatus;
+/*
+  Fitting Functions
+*/
+//*************************************
+void SplineRoutines::UpdateRWEngine(std::map<std::string, double>& updateVals) {
+//*************************************
 
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(splstring, " ");
+  for (UInt_t i = 0; i < fParams.size(); i++) {
+    std::string name = fParams[i];
 
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' ||
-      strvct[0].find("eventspline") == std::string::npos) {
-    return kGoodStatus;
+    if (updateVals.find(name) == updateVals.end()) continue;
+    fRW->SetDialValue(name, updateVals.at(name));
   }
 
-  // Check length
-  if (strvct.size() < 4) {
-    ERR(FTL) << "Input rw dials need to provide at least 4 inputs."
-             << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
+  fRW->Reconfigure();
+  return;
+}
+
+//*************************************
+void SplineRoutines::Run() {
+//*************************************
+  std::cout << "Running " << std::endl;
+
+  // Parse given routines
+  fRoutines = GeneralUtils::ParseToStr(fStrategy, ",");
+  if (fRoutines.empty()) {
+    ERR(FTL) << "Trying to run ComparisonRoutines with no routines given!" << std::endl;
+    throw;
   }
 
-  // Read Values
-  std::string parname = strvct[1];
-  std::string partype = strvct[2];
-  std::string parpnts = strvct[3];
+  for (size_t i = 0; i < fRoutines.size(); i++) {
+
+    LOG(FIT) << "Running Routine: " << fRoutines[i] << std::endl;
+    std::string rout = fRoutines[i];
+    if       (!rout.compare("SaveEvents")) SaveEvents();
+    else if  (!rout.compare("TestEvents")) TestEvents();
+    else if  (!rout.compare("GenerateEventSplines")) {  GenerateEventWeights(); BuildEventSplines(); }
+    else if  (!rout.compare("GenerateEventWeights")) { GenerateEventWeights(); }
+    else if  (!rout.compare("GenerateEventWeightChunks")){ GenerateEventWeightChunks(FitPar::Config().GetParI("spline_procchunk")); }
+    else if  (!rout.compare("BuildEventSplines"))    { BuildEventSplines(); }
+    else if  (!rout.compare("TestSplines_1DEventScan")) TestSplines_1DEventScan();
+    else if  (!rout.compare("TestSplines_NDEventThrow")) TestSplines_NDEventThrow();
+    else if  (!rout.compare("SaveSplinePlots")) SaveSplinePlots();
+    else if  (!rout.compare("TestSplines_1DLikelihoodScan")) TestSplines_1DLikelihoodScan();
+    else if  (!rout.compare("TestSplines_NDLikelihoodThrow")) TestSplines_NDLikelihoodThrow();
+    else if (!rout.compare("BuildEventSplinesChunks")) {
+      int chunk = FitPar::Config().GetParI("spline_procchunk");
+      BuildEventSplines(chunk);
+    } else if (!rout.compare("MergeEventSplinesChunks")) {
+      MergeEventSplinesChunks();
+    }
+  }
 
-  // Fill Containers
-  fSplineNames.push_back(parname);
-  fSplineTypes[parname] = partype;
-  fSplinePoints[parname] = parpnts;
 
-  // Return
-  LOG(FIT) << "Read Spline: " << parname << " " << partype << " " << parpnts
-           << endl;
-  return kGoodStatus;
 }
 
-//*****************************************
-int SplineRoutines::ReadParameters(std::string parstring) {
-  //******************************************
+//*************************************
+void SplineRoutines::SaveEvents() {
+//*************************************
+
+  if (fRW) delete fRW;
+  SetupRWEngine();
+  fRW->Reconfigure();
+  fRW->Print();
+
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
 
-  std::string inputspec =
-      "RW Dial Inputs Syntax \n"
-      "free input w/ limits: TYPE  NAME  START  MIN  MAX  STEP  [STATE] \n"
-      "fix  input: TYPE  NAME  VALUE  [STATE] \n"
-      "free input w/o limits: TYPE  NAME  START  FREE,[STATE] \n"
-      "Allowed Types: \n"
-      "neut_parameter,niwg_parameter,t2k_parameter,"
-      "nuwro_parameter,gibuu_parameter";
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
 
-  // Check sample input
-  if (parstring.find("parameter") == std::string::npos) return kGoodStatus;
+    // Make new outputfile
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
 
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
 
-  // Skip if comment or parameter somewhere later in line
-  if (strvct[0].c_str()[0] == '#' ||
-      strvct[0].find("parameter") == std::string::npos) {
-    return kGoodStatus;
-  }
+    InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "Input rw dials need to provide at least 3 inputs."
-             << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Get info from inputhandler
+    int nevents = input->GetNEvents();
+    int countwidth = (nevents / 10);
+    FitEvent* nuisevent = input->FirstNuisanceEvent();
 
-  // Setup default inputs
-  std::string partype = strvct[0];
-  std::string parname = strvct[1];
-  double parval = GeneralUtils::StrToDbl(strvct[2]);
-  double minval = parval - 1.0;
-  double maxval = parval + 1.0;
-  double stepval = 1.0;
-  std::string state = "FIX";  //[DEFAULT]
+    // Setup a TTree to save the event
+    outputfile->cd();
+    TTree* eventtree = new TTree("nuisance_events", "nuisance_events");
+    nuisevent->AddBranchesToTree(eventtree);
 
-  // Check Type
-  if (FitBase::ConvDialType(partype) == kUNKNOWN) {
-    ERR(FTL) << "Unknown parameter type! " << partype << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Loop over all events and fill the TTree
+    int icount = 0;
+    // int countwidth = nevents / 5;
 
-  // Check Parameter Name
-  if (FitBase::GetDialEnum(partype, parname) == -1) {
-    ERR(FTL) << "Bad RW parameter name! " << partype << " " << parname << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    while (nuisevent) {
 
-  // Option Extra (No Limits)
-  if (strvct.size() == 4) {
-    state = strvct[3];
-  }
+      // Get Event Weight
+      nuisevent->RWWeight = fRW->CalcWeight(nuisevent);
+      // if (nuisevent->RWWeight != 1.0){
+      // std::cout << "Weight = " << nuisevent->RWWeight << std::endl;
+      // }
+      // Save everything
+      eventtree->Fill();
 
-  // Check for weirder inputs
-  if (strvct.size() > 4 && strvct.size() < 6) {
-    ERR(FTL) << "Provided incomplete limits for " << parname << endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+      // Logging
+      if (icount % countwidth == 0) {
+        LOG(REC) << "Saved " << icount << "/" << nevents
+                 << " nuisance events. [M, W] = ["
+                 << nuisevent->Mode << ", " << nuisevent->RWWeight << "]" << std::endl;
+      }
 
-  // Option Extra (With limits and steps)
-  if (strvct.size() >= 6) {
-    minval = GeneralUtils::StrToDbl(strvct[3]);
-    maxval = GeneralUtils::StrToDbl(strvct[4]);
-    stepval = GeneralUtils::StrToDbl(strvct[5]);
-  }
+      // iterate
+      nuisevent = input->NextNuisanceEvent();
+      i++;
+    }
 
-  // Option Extra (dial state after limits)
-  if (strvct.size() == 7) {
-    state = strvct[6];
-  }
+    // Save flux and close file
+    outputfile->cd();
+    eventtree->Write();
+    input->GetFluxHistogram()->Write("nuisance_fluxhist");
+    input->GetEventHistogram()->Write("nuisance_eventhist");
 
-  // Run Parameter Conversion if needed
-  if (state.find("ABS") != std::string::npos) {
-    parval = FitBase::RWAbsToSigma(partype, parname, parval);
-    minval = FitBase::RWAbsToSigma(partype, parname, minval);
-    maxval = FitBase::RWAbsToSigma(partype, parname, maxval);
-    stepval = FitBase::RWAbsToSigma(partype, parname, stepval);
-  } else if (state.find("FRAC") != std::string::npos) {
-    parval = FitBase::RWFracToSigma(partype, parname, parval);
-    minval = FitBase::RWFracToSigma(partype, parname, minval);
-    maxval = FitBase::RWFracToSigma(partype, parname, maxval);
-    stepval = FitBase::RWFracToSigma(partype, parname, stepval);
-  }
+    // Close Output
+    outputfile->Close();
 
-  // Check no repeat params
-  if (std::find(fParams.begin(), fParams.end(), parname) != fParams.end()) {
-    ERR(FTL) << "Duplicate parameter names given for " << parname << endl;
-    throw;
+    // Delete Inputs
+    delete input;
   }
 
-  // Setup Containers
-  fParams.push_back(parname);
-
-  fTypeVals[parname] = FitBase::ConvDialType(partype);
+  // remove Keys
+  eventkeys.clear();
 
-  fStartVals[parname] = parval;
-  fCurVals[parname] = fStartVals[parname];
+  // Finished
+  LOG(FIT) << "Finished processing all nuisance events." << std::endl;
+}
 
-  fErrorVals[parname] = 0.0;
+//*************************************
+void SplineRoutines::TestEvents() {
+//*************************************
 
-  fStateVals[parname] = state;
+  LOG(FIT) << "Testing events." << std::endl;
 
-  bool fixstate = state.find("FIX") != std::string::npos;
-  fFixVals[parname] = fixstate;
-  fStartFixVals[parname] = fFixVals[parname];
+  // Create a new file for the test samples
+  if (!fOutputRootFile) {
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
+  }
 
-  fMinVals[parname] = minval;
-  fMaxVals[parname] = maxval;
-  fStepVals[parname] = stepval;
+  // Loop over all tests
+  int count = 0;
+  std::vector<nuiskey> testkeys = Config::QueryKeys("sampletest");
+  for (std::vector<nuiskey>::iterator iter = testkeys.begin();
+       iter != testkeys.end(); iter++) {
+    nuiskey key = (*iter);
+
+    // 0. Create new measurement list
+    std::list<MeasurementBase*> samplelist;
+
+    // 1. Build Sample From Events
+    std::string samplename = key.GetS("name");
+    std::string eventsid = key.GetS("inputid");
+    nuiskey eventskey = Config::QueryLastKey("events", "id=" + eventsid);
+    std::string rawfile = eventskey.GetS("input");
+    LOG(FIT) << "Creating sample " << samplename << std::endl;
+    MeasurementBase* rawsample = SampleUtils::CreateSample(samplename, rawfile, "", "", FitBase::GetRW());
+
+    // 2. Build Sample From Nuisance Events
+    std::string eventsfile = eventskey.GetS("output");
+    LOG(FIT) << "Creating Fit Eevnt Sample " << samplename << " " << eventsfile << std::endl;
+    MeasurementBase* nuissample = SampleUtils::CreateSample(samplename, "FEVENT:" + eventsfile, "", "", FitBase::GetRW());
+
+    // 3. Make some folders to save stuff
+    TDirectory* sampledir   = (TDirectory*) fOutputRootFile->mkdir(Form((samplename + "_test_%d").c_str(), count));
+    TDirectory* rawdir      = (TDirectory*) sampledir->mkdir("raw");
+    TDirectory* nuisancedir = (TDirectory*) sampledir->mkdir("nuisance");
+    TDirectory* difdir      = (TDirectory*) sampledir->mkdir("difference");
+
+    // 4. Reconfigure both
+    rawdir->cd();
+    rawsample->Reconfigure();
+    rawsample->Write();
+
+    nuisancedir->cd();
+    nuissample->Reconfigure();
+    nuissample->Write();
+
+    // 4. Compare Raw to Nuisance Events
+
+    // Loop over all keyse
+    TIter next(rawdir->GetListOfKeys());
+    TKey *dirkey;
+    while ((dirkey = (TKey*)next())) {
+
+      // If not a 1D/2D histogram skip
+      TClass *cl = gROOT->GetClass(dirkey->GetClassName());
+      if (!cl->InheritsFrom("TH1D") and !cl->InheritsFrom("TH2D")) continue;
+
+      // Get TH1* from both dir
+      TH1 *rawplot      = (TH1*)rawdir->Get(dirkey->GetName());
+      TH1 *nuisanceplot = (TH1*)nuisancedir->Get(dirkey->GetName());
+
+      // Take Difference
+      nuisanceplot->Add(rawplot, -1.0);
+
+      // Save to dif folder
+      difdir->cd();
+      nuisanceplot->Write();
+    }
 
-  // Print the parameter
-  LOG(MIN) << "Read Parameter " << parname << " " << parval << " " << minval
-           << " " << maxval << " " << stepval << " " << state << std::endl;
+    // 5. Tidy Up
+    samplelist.clear();
 
-  // Tell reader its all good
-  return kGoodStatus;
+    // Iterator
+    count++;
+  }
 }
 
-//******************************************
-int SplineRoutines::ReadGenericInputs(std::string samstring) {
-  //******************************************
-  std::string inputspec = "genericinput  inputfile  [outputfile]  [type]";
+void SplineRoutines::GenerateEventWeightChunks(int procchunk) {
+  if (fRW) delete fRW;
+  SetupRWEngine();
 
-  // Check generic input
-  if (samstring.find("genericinput") == std::string::npos) return kGoodStatus;
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
 
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(samstring, " ");
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
 
-  // Skip if comment or input somewhere later in line
-  if (strvct[0].c_str()[0] == '#' || strvct[0] != "genericinput") {
-    return kGoodStatus;
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
   }
+  splwrite->SetupSplineSet();
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "genericinput need to provide at least 2 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+  // Event Loop
+  // Loop over all events and calculate weights for each parameter set.
 
-  // Setup default inputs
-  std::string inname = strvct[1];
-  std::string infile = strvct[2];
-  std::string outfile = infile + ".nuisancefile.root";
-  std::string type = "FULLSPLINES";
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
 
-  // Optional Specify outputname
-  if (strvct.size() > 3) {
-    outfile = strvct[3];
-  }
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
 
-  // Optional specify type
-  if (strvct.size() > 4) {
-    type = strvct[4];
-  }
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+    outputfilename += ".weights.root";
 
-  // Add to maps
-  fGenericInputNames.push_back(inname);
+    // Make new outputfile
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
 
-  fGenericInputFiles[inname] = infile;
-  fGenericOutputFiles[inname] = outfile;
-  fGenericOutputTypes[inname] = type;
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
 
-  // Print out
-  LOG(FIT) << "Read Generic Input: " << inname << " " << infile << " "
-           << outfile << " (" << type << ")" << endl;
+    InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
 
-  return kGoodStatus;
-}
+    // Get info from inputhandler
+    int nevents = input->GetNEvents();
+    // int countwidth = (nevents / 1000);
+    FitEvent* nuisevent = input->FirstNuisanceEvent();
 
-//******************************************
-int SplineRoutines::ReadSamples(std::string samstring) {
-  //******************************************
-  const static std::string inputspec =
-      "\tsample <sample_name> <input_type>:inputfile.root [OPTS] "
-      "[norm]\nsample_name: Name "
-      "of sample to include. e.g. MiniBooNE_CCQE_XSec_1DQ2_nu\ninput_type: The "
-      "input event format. e.g. NEUT, GENIE, EVSPLN, ...\nOPTS: Additional, "
-      "optional sample options.\nnorm: Additional, optional sample "
-      "normalisation factor.";
+    // Setup a TTree to save the event
+    outputfile->cd();
+    TTree* eventtree = new TTree("nuisance_events", "nuisance_events");
 
-  // Check sample input
-  if (samstring.find("sample") == std::string::npos) return kGoodStatus;
+    // Add a flag that allows just splines to be saved.
+    nuisevent->AddBranchesToTree(eventtree);
 
-  // Parse inputs
-  std::vector<std::string> strvct = GeneralUtils::ParseToStr(samstring, " ");
+    // Save the spline reader
+    splwrite->Write("spline_reader");
 
-  // Skip if comment or sample somewhere later in line
-  if (strvct[0].c_str()[0] == '#' || strvct[0] != "sample") {
-    return kGoodStatus;
-  }
+    // Setup the spline TTree
+    TTree* weighttree = new TTree("weight_tree", "weight_tree");
+    splwrite->AddWeightsToTree(weighttree);
 
-  // Check length
-  if (strvct.size() < 3) {
-    ERR(FTL) << "Sample need to provide at least 3 inputs." << std::endl;
-    std::cout << inputspec << std::endl;
-    return kErrorStatus;
-  }
+    // Make container for all weights
+    int nweights = splwrite->GetNWeights();
+    // int npar = splwrite->GetNPars();
+    // double* weightcont = new double[nweights];
 
-  // Setup default inputs
-  std::string samname = strvct[1];
-  std::string samfile = strvct[2];
+    int lasttime = time(NULL);
 
-  if (samfile == "FIX") {
-    ERR(FTL) << "Input filename was \"FIX\", this line is probably malformed "
-                "in the input card file. Line:\'"
-             << samstring << "\'" << std::endl;
-    ERR(FTL) << "Expect sample lines to look like:\n\t" << inputspec
-             << std::endl;
+    // Load N Chunks of the Weights into Memory
+    // Split into N processing chunks
+    int nchunks = FitPar::Config().GetParI("spline_chunks");
+    if (nchunks <= 0) nchunks = 1;
+    if (nchunks >= nevents / 2) nchunks = nevents / 2;
 
-    throw;
-  }
+    std::cout << "Starting NChunks " << nchunks << std::endl;
+    for (int ichunk = 0; ichunk < nchunks; ichunk++) {
 
-  std::string samtype = "DEFAULT";
-  double samnorm = 1.0;
+      // Skip to only do one processing chunk
+      if (procchunk != -1 and procchunk != ichunk) continue;
 
-  // Optional Type
-  if (strvct.size() > 3) {
-    samtype = strvct[3];
-    samname += "_"+samtype;
-    // Also get rid of the / and replace it with underscore because it might not be supported character
-    while (samname.find("/") != std::string::npos) {
-      samname.replace(samname.find("/"), 1, std::string("_"));
-    }
-  }
+      LOG(FIT) << "On Processing Chunk " << ichunk << std::endl;
+      int neventsinchunk   = nevents / nchunks;
+      int loweventinchunk  = neventsinchunk * ichunk;
+      // int higheventinchunk = neventsinchunk * (ichunk + 1);
 
-  // Optional Norm
-  if (strvct.size() > 4) samnorm = GeneralUtils::StrToDbl(strvct[4]);
+      double** allweightcont = new double*[neventsinchunk];
+      for (int k = 0; k < neventsinchunk; k++){
+        allweightcont[k] = new double[nweights];
+      }
 
-  // Add Sample Names as Norm Dials
-  std::string normname = samname + "_norm";
+      // Start Set Processing Here.
+      for (int iset = 0; iset < nweights; iset++) {
 
-  // Check no repeat params
-  if (std::find(fParams.begin(), fParams.end(), normname) != fParams.end()) {
-    ERR(FTL) << "Duplicate samples given for " << samname << endl;
-    throw;
-  }
+        splwrite->ReconfigureSet(iset);
 
-  fParams.push_back(normname);
+        // Could reorder this to save the weightconts in order instead of reconfiguring per event.
+        // Loop over all events and fill the TTree
+        for (int i = 0; i < neventsinchunk; i++){
 
-  fTypeVals[normname] = kNORM;
-  fStartVals[normname] = samnorm;
-  fCurVals[normname] = fStartVals[normname];
-  fErrorVals[normname] = 0.0;
+          nuisevent = input->GetNuisanceEvent(i+loweventinchunk);
+          double w = splwrite->GetWeightForThisSet(nuisevent);
 
-  fMinVals[normname] = 0.1;
-  fMaxVals[normname] = 10.0;
-  fStepVals[normname] = 0.5;
+	  if (iset == 0){
+	    allweightcont[i][0] = w;
+	  } else {
+	    allweightcont[i][iset] = w/allweightcont[i][0];
+	  }
 
-  bool state = samtype.find("FREE") == std::string::npos;
-  fFixVals[normname] = state;
-  fStartFixVals[normname] = state;
+          // Save everything
+          if (iset == 0) {
+            eventtree->Fill();
+          } 
+        }
+	
+	std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if  (timeelapsed) {
+          lasttime = time(NULL);
 
-  // Print read in
-  LOG(MIN) << "Read sample " << samname << " " << samfile << " " << samtype
-           << " " << samnorm << endl;
+          int setsleft = (nweights-iset-1) + (nweights * (nchunks - ichunk - 1));
+          float proj = (float(setsleft) *timeelapsed) / 60 / 60;
+          timestring << setsleft << " sets remaining. Last one took " << timeelapsed << ". " << proj << " hours remaining.";
 
-  // Tell reader its all good
-  return kGoodStatus;
-}
+        }
 
-/*
-  Setup Functions
-*/
-//*************************************
-void SplineRoutines::SetupRWEngine() {
-  //*************************************
+	LOG(REC) << "Processed Set " << iset << "/" << nweights <<" in chunk " << ichunk << "/" << nchunks << " " << timestring.str() << std::endl;
 
-  fRW = new FitWeight("splineweight");
+      }
 
-  for (UInt_t i = 0; i < fParams.size(); i++) {
-    std::string name = fParams[i];
-    fRW->IncludeDial(name, fTypeVals.at(name));
-  }
-  UpdateRWEngine(fStartVals);
+      // Fill weights for this chunk into the TTree
+      for (int k = 0; k < neventsinchunk; k++){
+        splwrite->SetWeights(allweightcont[k]);
+        weighttree->Fill();
+      }
+    }
 
-  return;
-}
+    // at end of the chunk, when all sets have been done
+    // loop over the container and fill weights to ttree
 
-//*************************************
-void SplineRoutines::SetupGenericInputs() {
-  //*************************************
+    outputfile->cd();
+    eventtree->Write();
+    weighttree->Write();
+    input->GetFluxHistogram()->Write("nuisance_fluxhist");
+    input->GetEventHistogram()->Write("nuisance_eventhist");
+    splwrite->Write("spline_reader");
+    outputfile->Close();
 
-  fGenericInputs.clear();
-  for (unsigned int i = 0; i < fGenericInputNames.size(); i++) {
-    std::string name = fGenericInputNames[i];
-    std::vector<std::string> file_descriptor =
-        GeneralUtils::ParseToStr(fGenericInputFiles[name], ":");
-    if (file_descriptor.size() != 2) {
-      ERR(FTL) << "File descriptor had no filetype declaration: \""
-               << fGenericInputFiles[name]
-               << "\". expected \"FILETYPE:file.root\"" << std::endl;
-      throw;
-    }
-    InputUtils::InputType inpType =
-        InputUtils::ParseInputType(file_descriptor[0]);
-    fGenericInputs[name] = (new InputHandler(name, inpType, file_descriptor[1]));
-  }
-}
+    // Close Output
+    outputfile->Close();
 
-//*************************************
-void SplineRoutines::SetupSamples() {
-  //*************************************
+    // Delete Inputs
+    delete input;
+  }
 
-  /*
-  LOG(FIT)<<"Making the jointFCN"<<std::endl;
-  if (fSampleFCN) delete fSampleFCN;
-  fSampleFCN = new JointFCN(fCardFile, fOutputRootFile);
-  fSamples = fSampleFCN->GetSampleList();
-  */
+  // remove Keys
+  eventkeys.clear();
 
-  return;
 }
 
-/*
-  Fitting Functions
-*/
 //*************************************
-void SplineRoutines::UpdateRWEngine(std::map<std::string, double>& updateVals) {
-  //*************************************
+void SplineRoutines::GenerateEventWeights() {
+//*************************************
+  if (fRW) delete fRW;
+  SetupRWEngine();
 
-  for (UInt_t i = 0; i < fParams.size(); i++) {
-    std::string name = fParams[i];
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
 
-    if (updateVals.find(name) == updateVals.end()) continue;
-    fRW->SetDialValue(name, updateVals.at(name));
-  }
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
 
-  fRW->Reconfigure();
-  return;
-}
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
+  }
+  splwrite->SetupSplineSet();
 
-//*************************************
-void SplineRoutines::Run() {
-  //*************************************
+  // Event Loop
+  // Loop over all events and calculate weights for each parameter set.
 
-  for (UInt_t i = 0; i < fRoutines.size(); i++) {
-    std::string routine = fRoutines.at(i);
-    int fitstate = kFitUnfinished;
-    LOG(FIT) << "Running Routine: " << routine << std::endl;
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
 
-    // Try Routines
-    if (!routine.compare("SaveSplineEvents"))
-      SaveEventSplines();
-    else if (!routine.compare("SaveEvents"))
-      SaveEvents();
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
 
-    // If ending early break here
-    if (fitstate == kFitFinished || fitstate == kNoChange) {
-      LOG(FIT) << "Ending fit routines loop." << endl;
-      break;
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
     }
-  }
+    outputfilename += ".weights.root";
 
-  return;
-}
+    // Make new outputfile
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
 
-//*************************************
-void SplineRoutines::SaveEvents() {
-  //*************************************
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
 
-  // Make a new RWm Engine
-  if (fRW) delete fRW;
-  SetupRWEngine();
+    InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
 
-  // Set RW engine to central values
-  UpdateRWEngine(fCurVals);
+    // Get info from inputhandler
+    int nevents = input->GetNEvents();
+    int countwidth = (nevents / 1000);
+    FitEvent* nuisevent = input->FirstNuisanceEvent();
 
-  // iterate over generic events
-  std::map<std::string, InputHandler*>::const_iterator iter =
-      fGenericInputs.begin();
+    // Setup a TTree to save the event
+    outputfile->cd();
+    TTree* eventtree = new TTree("nuisance_events", "nuisance_events");
 
-  // Iterate over all inputs
-  for (; iter != fGenericInputs.end(); iter++) {
-    std::string name = (iter->first);
+    // Add a flag that allows just splines to be saved.
+    nuisevent->AddBranchesToTree(eventtree);
 
-    LOG(FIT) << "Creating new nuisance event set in:" << endl;
-    LOG(FIT) << "Name = " << name << endl;
-    LOG(FIT) << "InputFile = " << fGenericInputFiles[name] << endl;
-    LOG(FIT) << "OutputFile = " << fGenericOutputFiles[name] << endl;
-    LOG(FIT) << "Type = " << fGenericOutputTypes[name] << endl;
+    // Save the spline reader
+    splwrite->Write("spline_reader");
 
-    // Create a new TFile
-    TFile* eventfile = new TFile(fGenericOutputFiles[name].c_str(), "RECREATE");
-    eventfile->cd();
+    // Setup the spline TTree
+    TTree* weighttree = new TTree("weight_tree", "weight_tree");
+    splwrite->AddWeightsToTree(weighttree);
 
-    // Get Input
-    InputHandler* curinput = (iter->second);
-    int nevents = curinput->GetNEvents();
+    // Make container for all weights
+    int nweights = splwrite->GetNWeights();
+    // int npar = splwrite->GetNPars();
+    double* weightcont = new double[nweights];
 
-    // Setup Event
-    FitEvent* custevent = curinput->GetEventPointer();
+    int lasttime = time(NULL);
 
-    // Setup TTree
-    eventfile->cd();
-    TTree* evttree = new TTree("FitEvents", "FitEvents");
-    custevent->AddBranchesToTree(evttree);
+    // Could reorder this to save the weightconts in order instead of reconfiguring per event.
+    // Loop over all events and fill the TTree
+    while (nuisevent) {
 
-    int countwidth = (nevents / 50);
 
-    // Run Loop and Fill Event Tree
-    for (int i = 0; i < nevents; i++) {
-      // Grab new event
-      curinput->ReadEvent(i);
+      // Calculate the weights for each parameter set
+      splwrite->GetWeightsForEvent(nuisevent, weightcont);
 
-      // Fill event info
-      custevent->CalcKinematics();
+      // Save everything
 
-      // Fill Spline/Weight Info
-      fRW->CalcWeight(custevent);
+      eventtree->Fill();
+      weighttree->Fill();
 
-      // Save everything
-      evttree->Fill();
 
+      // Logging
       if (i % countwidth == 0) {
-        LOG(REC) << "Filled " << i << "/" << nevents << " nuisance events."
-                 << endl;
+
+        std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if (i != 0 and timeelapsed) {
+          lasttime = time(NULL);
+
+          int eventsleft = nevents - i;
+          float speed = float(countwidth) / float(timeelapsed);
+          float proj = (float(eventsleft) / float(speed)) / 60 / 60;
+          timestring << proj << " hours remaining.";
+
+        }
+        LOG(REC) << "Saved " << i << "/" << nevents << " nuisance spline weights. " << timestring.str() << std::endl;
       }
+
+      // Iterate
+      i++;
+      nuisevent = input->NextNuisanceEvent();
     }
 
-    // Save TTree alongside flux info
-    eventfile->cd();
-    evttree->Write();
-    curinput->GetFluxHistogram()->Write("FitFluxHist");
-    curinput->GetEventHistogram()->Write("FitEventHist");
+    // at end of the chunk, when all sets have been done
+    // loop over the container and fill weights to ttree
+
+    outputfile->cd();
+    eventtree->Write();
+    weighttree->Write();
+    input->GetFluxHistogram()->Write("nuisance_fluxhist");
+    input->GetEventHistogram()->Write("nuisance_eventhist");
+    splwrite->Write("spline_reader");
+    outputfile->Close();
 
-    // Close file
-    eventfile->Close();
+    // Close Output
+    outputfile->Close();
+
+    // Delete Inputs
+    delete input;
   }
+
+  // remove Keys
+  eventkeys.clear();
+
 }
 
-//*************************************
-void SplineRoutines::TestEventSplines() {
-  //*************************************
 
-  // Make a new RW Engine
+
+
+//*************************************
+void SplineRoutines::GenerateEventSplines() {
+//*************************************
   if (fRW) delete fRW;
   SetupRWEngine();
 
-  // Set RW engine to central values
-  UpdateRWEngine(fCurVals);
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
 
-  // Create list of new temp InputHandlers
-  std::map<std::string, InputHandler*> evtsplinehandles;
-  for (UInt_t i = 0; i < fGenericInputNames.size(); i++) {
-    std::string name = fGenericInputNames[i];
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
 
-    evtsplinehandles[name] = (new InputHandler(
-        name + "_splines", InputUtils::kEVSPLN_Input, fGenericOutputFiles[name]));
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
   }
+  splwrite->SetupSplineSet();
 
-  // Iterate over both inputs/outputs
-  std::map<std::string, InputHandler*>::const_iterator initer =
-      fGenericInputs.begin();
-  std::map<std::string, InputHandler*>::const_iterator outiter =
-      evtsplinehandles.begin();
 
-  // Iterate over all inputs
-  for (; initer != fGenericInputs.end(); initer++, outiter++) {
-    std::string name = (initer->first);
-    LOG(FIT) << "Testing event splines in " << name << endl;
+  // Make an ugly list for N cores
+  int ncores = FitPar::Config().GetParI("NCORES");//omp_get_max_threads();
+  std::vector<SplineWriter*> splwriterlist;
 
-    // Create a new TFile
-    TFile* splinefile = new TFile(fGenericOutputFiles[name].c_str(), "UPDATE");
-    splinefile->cd();
+  for (int i = 0; i < ncores; i++) {
+    SplineWriter* tmpwriter = new SplineWriter(fRW);
 
-    // Get Input
-    InputHandler* rawinput = (initer->second);
-    InputHandler* splinput = (outiter->second);
-    int nevents = splinput->GetNEvents();  // Should match...
-    nevents = 100;
+    for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+         iter != splinekeys.end(); iter++) {
+      nuiskey splkey = (*iter);
 
-    FitEvent* rawevent = rawinput->GetEventPointer();
-    FitEvent* splevent = splinput->GetEventPointer();
+      // Add Spline Info To Reader
+      tmpwriter->AddSpline(splkey);
+    }
+    tmpwriter->SetupSplineSet();
 
-    fRW->ReadSplineHead(splinput->GetSplineHead());
+    splwriterlist.push_back(tmpwriter);
+  }
 
-    // Small Plots on event-by-event
-    // -------------------------------
 
-    // Make folder for graphs
-    TDirectory* graphdir = splinefile->mkdir("testgraphs");
-    graphdir->cd();
+  // Event Loop
+  // Loop over all events and calculate weights for each parameter set.
 
-    // Create Plot for each event
-    for (int i = 0; i < nevents; i++) {
-      // Grab new event from each sample
-      rawinput->ReadEvent(i);
-      splinput->ReadEvent(i);
-
-      // Start Loop for each parameter //TODO Make it test ND splines
-      for (unsigned int j = 0; j < fParams.size(); j++) {
-        std::string name = fParams.at(j);
-        if (fFixVals[name]) continue;
-
-        double startval = fCurVals[name];
-
-        // 1D Parameter Loop
-        std::vector<double> xvals;
-        std::vector<double> yvals_raw;
-        std::vector<double> yvals_spl;
-
-        // Start at min and loop
-        fCurVals[name] = fMinVals[name];
-        while (fCurVals[name] < fMaxVals[name]) {
-          // Update
-          UpdateRWEngine(fCurVals);
-          fRW->ReadSplineHead(splinput->GetSplineHead());
-
-          // Calc Weights
-          xvals.push_back(fCurVals[name]);
-          yvals_raw.push_back(fRW->CalcWeight(rawevent));
-          yvals_spl.push_back(fRW->CalcWeight(splevent));
-
-          // Step
-          fCurVals[name] = fCurVals[name] + fStepVals[name];
-        }
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make new outputfile
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
+
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
 
-        // Reset to normal
-        fCurVals[name] = startval;
-        splinefile->cd();
-        TGraph* graw = new TGraph(xvals.size(), &xvals[0], &yvals_raw[0]);
-        graw->SetNameTitle(
-            ("evspltest_raw_" + name).c_str(),
-            ("evspltest_raw_" + name + ";" + name + ";weight").c_str());
-        graw->SetLineColor(kBlue);
-        graw->SetMarkerColor(kBlue);
-        graw->SetLineWidth(2);
-        graw->SetMarkerStyle(0);
+    InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
 
-        TGraph* gspl = new TGraph(xvals.size(), &xvals[0], &yvals_spl[0]);
-        gspl->SetNameTitle(
-            ("evspltest_spl_" + name).c_str(),
-            ("evspltest_spl_" + name + ";" + name + ";weight").c_str());
-        gspl->SetLineColor(kRed);
-        gspl->SetMarkerColor(kRed);
-        gspl->SetLineWidth(2);
-        gspl->SetMarkerStyle(20);
+    // Get info from inputhandler
+    int nevents = input->GetNEvents();
+    int countwidth = (nevents / 1000);
+    FitEvent* nuisevent = input->FirstNuisanceEvent();
 
-        TCanvas* c1 = new TCanvas(("evspltest_" + name).c_str(),
-                                  ("evspltest_" + name).c_str(), 800, 600);
+    // Setup a TTree to save the event
+    outputfile->cd();
+    TTree* eventtree = new TTree("nuisance_events", "nuisance_events");
 
-        TLegend* l1 = new TLegend(0.6, 0.6, 0.9, 0.9);
-        l1->AddEntry(graw, "RAW", "l");
-        l1->AddEntry(gspl, "SPL", "l");
+    // Add a flag that allows just splines to be saved.
+    nuisevent->AddBranchesToTree(eventtree);
 
-        c1->cd();
-        graw->Draw("APL");
-        gspl->Draw("PL SAME");
-        l1->Draw("SAME");
+    // Save the spline reader
+    splwrite->Write("spline_reader");
 
-        graphdir->cd();
-        c1->Write();
+    // Setup the spline TTree
+    TTree* weighttree = new TTree("weight_tree", "weight_tree");
+    splwrite->AddWeightsToTree(weighttree);
 
-        delete graw;
-        delete gspl;
-        delete l1;
-      }
+    // Make container for all weights
+    int nweights = splwrite->GetNWeights();
+    double** weightcont = new double*[nevents];
+    for (int k = 0; k < nevents; k++) {
+      weightcont[k] = new double[nweights];
     }
 
-    // Clean up
-    splinefile->Close();
-  }
+    int npar = splwrite->GetNPars();
 
-  // Finish Up
-  evtsplinehandles.clear();
-}
 
-//*************************************
-void SplineRoutines::SaveEventSplines() {
-  //*************************************
+    int lasttime = time(NULL);
 
-  // Make a new RWm Engine
-  if (fRW) delete fRW;
-  SetupRWEngine();
+    // Could reorder this to save the weightconts in order instead of reconfiguring per event.
+    // Loop over all events and fill the TTree
+    while (nuisevent) {
 
-  // Set RW engine to central values
-  UpdateRWEngine(fCurVals);
+      // std::cout << "Fitting event " << i << std::endl;
+      // Calculate the weights for each parameter set
+      // splwrite->FitSplinesForEvent(nuisevent);
+      splwrite->GetWeightsForEvent(nuisevent, weightcont[i]);
+      bool hasresponse = false;
+      for (int j = 0; j < nweights; j++) {
 
-  // Add Splines to RW Engine
-  for (UInt_t i = 0; i < fSplineNames.size(); i++) {
-    std::string name = fSplineNames.at(i);
-    fRW->SetupSpline(name, fSplineTypes[name], fSplinePoints[name]);
-  }
+        if (weightcont[i][j] != 1.0) {
+          //    std::cout << "Non Zero Weight at " << i << " " << j << std::endl;
+          hasresponse = true;
+        } else {
+          //    std::cout << "Empty Weight at " << i << " " << j << std::endl;
+        }
+      }
+      if (!hasresponse) {
+        //  std::cout << "Deleting flat response " << nuisevent->Mode << std::endl;
+        delete weightcont[i];
+        weightcont[i] = NULL;
+      }
 
-  LOG(FIT) << "Starting spline inputs" << endl;
-  // iterate over generic events
-  std::map<std::string, InputHandler*>::const_iterator iter =
-      fGenericInputs.begin();
+      // Save everything
+      eventtree->Fill();
+      weighttree->Fill();
+      // splinetree->Fill();
+
+      // nuisevent->Print();
+      // std::cout << "Done with event " << i << std::endl;
+
+      // Push weight sets into a the array
+
+      // sleep(4);
+      // Logging
+      if (i % countwidth == 0) {
 
-  // Iterate over all inputs
-  for (; iter != fGenericInputs.end(); iter++) {
-    std::string name = (iter->first);
+        std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if (i != 0 and timeelapsed) {
+          lasttime = time(NULL);
 
-    LOG(FIT) << "Creating new spline set in:" << endl;
-    LOG(FIT) << "Name = " << name << endl;
-    LOG(FIT) << "InputFile = " << fGenericInputFiles[name] << endl;
-    LOG(FIT) << "OutputFile = " << fGenericOutputFiles[name] << endl;
-    LOG(FIT) << "Type = " << fGenericOutputTypes[name] << endl;
+          int eventsleft = nevents - i;
+          float speed = float(countwidth) / float(timeelapsed);
+          float proj = (float(eventsleft) / float(speed)) / 60 / 60;
+          timestring << proj << " hours remaining.";
 
-    // Create a new TFile
-    TFile* splinefile =
-        new TFile(fGenericOutputFiles[name].c_str(), "RECREATE");
-    splinefile->cd();
+        }
+        LOG(REC) << "Saved " << i << "/" << nevents << " nuisance spline weights. " << timestring.str() << std::endl;
+      }
 
-    // Get Input
-    InputHandler* curinput = (iter->second);
-    int nevents = curinput->GetNEvents();
+      // Iterate
+      i++;
+      nuisevent = input->NextNuisanceEvent();
+    }
 
-    // Setup Event
-    FitEvent* custevent = curinput->GetEventPointer();
+    outputfile->cd();
+    eventtree->Write();
+    weighttree->Write();
+    input->GetFluxHistogram()->Write("nuisance_fluxhist");
+    input->GetEventHistogram()->Write("nuisance_eventhist");
+    outputfile->Close();
+
+    outputfile = new TFile(outputfilename.c_str(), "UPDATE");
+    outputfile->cd();
+
+    weighttree = (TTree*) outputfile->Get("weight_tree");
+//    splwrite->ReadWeightsFromTree(weighttree);
+
+
+    // Divide weights container into Ncores.
+    // Parrallelise this loop checking for what core we are on.
+    // for (int i = 0; i < nevents; i++){
+    // splwriterlist[int(i / (nevents/4))]->FitSplinesForEvent(coeff);
+    // }
+
+    // // Now loop over weights tree
+    // for (int i = 0; i < weighttree->GetEntries(); i++) {
+    //   weighttree->GetEntry(i);
+    //   splwrite->FitSplinesForEvent();
+    //   splinetree->Fill();
+
+    //   if (i % countwidth == 0) {
+
+    //     std::ostringstream timestring;
+    //     int timeelapsed = time(NULL) - lasttime;
+    //     if (i != 0 and timeelapsed) {
+    //       lasttime = time(NULL);
+
+    //       int eventsleft = nevents - i;
+    //       float speed = float(countwidth) / float(timeelapsed);
+    //       float proj = (float(eventsleft) / float(speed)) / 60 / 60;
+    //       timestring << proj << " hours remaining.";
+
+    //     }
+    //     LOG(REC) << "Built " << i << "/" << nevents << " nuisance spline events. " << timestring.str() << std::endl;
+    //   }
+    // }
+
+    // Get Splines
+    float** allcoeff = new float*[nevents];
+    for (int k = 0; k < nevents; k++) {
+      allcoeff[k] = new float[npar];
+    }
 
-    // Setup TTree
-    splinefile->cd();
-    TTree* evttree = new TTree("FitEvents", "FitEvents");
-    fRW->SetupEventCoeff(static_cast<BaseFitEvt*>(custevent));
-    custevent->AddBranchesToTree(evttree);
-    custevent->AddSplineCoeffToTree(evttree);
-    LOG(REC) << "Added events+splines to TTree" << endl;
-    int countwidth = (nevents / 400);
 
-    // Make folder for graphs
-    TDirectory* graphdir = splinefile->mkdir("gengraphs");
-    graphdir->cd();
 
-    // Run Loop and Fill Event Tree
+    //    #pragma omp parallel for num_threads(ncores)
     for (int i = 0; i < nevents; i++) {
-      // Grab new event
-      curinput->ReadEvent(i);
 
-      // Fill event info
-      custevent->CalcKinematics();
+      //#pragma omp atomic
+      //      printf("Using Thread %d to build event %d \n", int(omp_get_thread_num()), (int)i );
+      //      std::cout<< " -> Writer = " << splwriterlist[ i / (nevents/ncores) ] << std::endl;
+
+      //      #pragma omp atomic
+      if (weightcont[i]) {
+        splwriterlist[ int(omp_get_thread_num()) ]->FitSplinesForEvent(weightcont[i], allcoeff[i]);
+      } else {
+        for (int j = 0; j < npar; j++) {
+          allcoeff[i][j] = float(0.0);
+        }
+      }
+
+      //      splwrite->FitSplinesForEvent(weightcont[i], allcoeff[i]);
 
-      bool save = false;
-      if (i % nevents / 20 == 0) save = true;
-      // Fill Spline/Weight Info
-      fRW->GenSplines(custevent, save);
-      fRW->CalcWeight(custevent);
 
-      // Save everything
-      evttree->Fill();
+      if (i % 500 == 0) {
 
-      if (i % countwidth == 0) {
-        LOG(REC) << "Filled " << i << "/" << nevents << " spline events."
-                 << endl;
+        if (LOG_LEVEL(REC)) {
+          printf("Using Thread %d to build event %d \n", int(omp_get_thread_num()), (int)i );
+        }
+      }
+      /*
+
+        std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if (i != 0 and timeelapsed) {
+          lasttime = time(NULL);
+
+          int eventsleft = nevents - i;
+          float speed = float(countwidth) / float(timeelapsed);
+          float proj = (float(eventsleft) / float(speed)) / 60 / 60;
+          timestring << proj << " hours remaining.";
+      timestring << " Using Writer at " << i / (nevents/ncores) << " = " << splwriterlist[ i / (nevents/ncores) ] << std::endl;
+
+        }
+        LOG(REC) << "Built " << i << "/" << nevents << " nuisance spline events. " << timestring.str() << std::endl;
       }
+      */
     }
 
-    // Save TTree alongside flux info
-    splinefile->cd();
-    fRW->GetSplineHeader()->Write("FitSplineHead");
-    evttree->Write();
-    curinput->GetFluxHistogram()->Write("FitFluxHist");
-    curinput->GetEventHistogram()->Write("FitEventHist");
+    // Save Splines into TTree
+    float* coeff = new float[npar];
+    outputfile->cd();
+    TTree* splinetree = new TTree("spline_tree", "spline_tree");
+
+    splinetree->Branch("SplineCoeff", coeff, Form("SplineCoeff[%d]/F", npar));
+
+    std::cout << "Saving to the allcoeff" << std::endl;
+    for (int k = 0; k < nevents; k++) {
+      for (int l = 0; l < npar; l++) {
+        coeff[l] = allcoeff[k][l];
+      }
+      std::cout << "Coeff 0, 1, 2 = " << coeff[0] << " " << coeff[1] << " " << coeff[2] << std::endl;
+      splinetree->Fill();
+    }
+
+    // Save flux and close file
+    outputfile->cd();
+    splinetree->Write();
+
+    // Delete the container.
+    for (int k = 0; k < nevents; k++) {
+      delete weightcont[k];
+    }
+    delete weightcont;
+    delete coeff;
+
+    // Close Output
+    outputfile->Close();
+
+    // Delete Inputs
+    delete input;
+  }
+
+  // remove Keys
+  eventkeys.clear();
+
+}
+
+
+
+//*************************************
+void SplineRoutines::BuildEventSplines(int procchunk) {
+//*************************************
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
+
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
+
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
+  }
+  splwrite->SetupSplineSet();
+
+
+  // Make an ugly list for N cores
+  int ncores = FitPar::Config().GetParI("spline_cores");//omp_get_max_threads();
+  if (ncores > omp_get_max_threads()) ncores = omp_get_max_threads();
+  if (ncores <= 0) ncores = 1;
+
+  std::vector<SplineWriter*> splwriterlist;
+
+  for (int i = 0; i < ncores; i++) {
+    SplineWriter* tmpwriter = new SplineWriter(fRW);
+
+    for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+         iter != splinekeys.end(); iter++) {
+      nuiskey splkey = (*iter);
+
+      // Add Spline Info To Reader
+      tmpwriter->AddSpline(splkey);
+    }
+    tmpwriter->SetupSplineSet();
+
+    splwriterlist.push_back(tmpwriter);
+  }
+
+
+  // Event Loop
+  // Loop over all events and calculate weights for each parameter set.
+
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make new outputfile
+    TFile* outputfile;
+    if (procchunk == -1) outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    else  outputfile = new TFile((outputfilename + std::string(Form(".coeffchunk_%d.root", procchunk))).c_str(), "RECREATE");
+
+    outputfile->cd();
+
+    // Get Weights File
+    TFile* weightsfile = new TFile((outputfilename + ".weights.root").c_str(), "READ");
+    TTree* weighttree = (TTree*) weightsfile->Get("weight_tree");
+
+    // Get SPLWRite Info
+    //splwrite->ReadWeightsFromTree(weighttree);
+    int nevents = weighttree->GetEntries();
+    // int countwidth = (nevents / 1000);
+    int nweights = splwrite->GetNWeights();
+    int npar = splwrite->GetNPars();
+
+    // Access Weights
+    double* eventweights = new double[nweights];
+    weighttree->SetBranchAddress("SplineWeights", eventweights);
+
+
+    // Make counter
+    // int lasttime = time(NULL);
+
+
+    // Setup Splines To Be Saved into TTree
+    outputfile->cd();
+    TTree* splinetree = new TTree("spline_tree", "spline_tree");
+
+    float* coeff = new float[npar];
+    splinetree->Branch("SplineCoeff", coeff, Form("SplineCoeff[%d]/F", npar));
+
+
+    // Load N Chunks of the Weights into Memory
+    // Split into N processing chunks
+    int nchunks = FitPar::Config().GetParI("spline_chunks");
+    if (nchunks <= 0) nchunks = 1;
+    if (nchunks >= nevents / 2) nchunks = nevents / 2;
+
+    std::cout << "Starting NChunks " << nchunks << std::endl;
+    sleep(1);
+    for (int ichunk = 0; ichunk < nchunks; ichunk++) {
+
+      // Skip to only do one processing chunk
+      if (procchunk != -1 and procchunk != ichunk) continue;
+
+      LOG(FIT) << "On Processing Chunk " << ichunk << std::endl;
+      int neventsinchunk   = nevents / nchunks;
+      int loweventinchunk  = neventsinchunk * ichunk;
+      // int higheventinchunk = neventsinchunk * (ichunk + 1);
+
+
+      // Build Chunk Containers for Event Weights
+      double** weightcont = new double*[nevents];
+      float** allcoeff = new float*[nevents];
+
+      // Load Chunks into Containers
+      for (int k = 0; k < neventsinchunk; k++) {
+        weighttree->GetEntry(loweventinchunk + k);
+
+        weightcont[k] = new double[nweights];
+        allcoeff[k] = new float[npar];
+
+        bool hasresponse = false;
+        for (int j = 0; j < nweights; j++) {
+          weightcont[k][j] = eventweights[j];
+          if (eventweights[j] != 1.0) hasresponse = true;
+        }
+        if (!hasresponse) delete weightcont[k];
+      }
+
+
+      // Loop over ncores and process chunks
+      //      #pragma omp parallel for num_threads(ncores)
+      for (int k = 0; k < neventsinchunk; k++) {
+
+        if (weightcont[k]) {
+          splwriterlist[ int(omp_get_thread_num()) ]->FitSplinesForEvent(weightcont[k], allcoeff[k]);
+        } else {
+          for (int j = 0; j < npar; j++) {
+            allcoeff[k][j] = float(0.0);
+          }
+        }
+
+        if (k + loweventinchunk % 500 == 0) {
+
+          if (LOG_LEVEL(REC)) {
+            printf("Using Thread %d to build event %d in chunk %d \n", int(omp_get_thread_num()), (int) loweventinchunk + k, ichunk );
+          }
+
+        }
+      }
+
+      // Save Coeff To Tree
+      std::cout << "Saving coeffs to Tree in Chunk " << ichunk << std::endl;
+      for (int k = 0; k < neventsinchunk; k++) {
+        for (int l = 0; l < npar; l++) {
+          coeff[l] = allcoeff[k][l];
+        }
+        // std::cout << "Coeff 0, 1, 2 = " << coeff[0] << " " << coeff[1] << " " << coeff[2] << std::endl;
+        splinetree->Fill();
+      }
+
+      // Delete the container.
+      for (int k = 0; k < neventsinchunk; k++) {
+        if (weightcont[k]) delete weightcont[k];
+        if (allcoeff[k]) delete allcoeff[k];
+      }
+      delete allcoeff;
+      delete weightcont;
+    }
+    // Save flux and close file
+    outputfile->cd();
+    splinetree->Write();
+
+
+    if (procchunk == -1 or procchunk == 0) {
+      outputfile->cd();
+      splwrite->Write("spline_reader");
+
+      TTree* nuisanceevents = (TTree*) weightsfile->Get("nuisance_events");
+      nuisanceevents->CloneTree()->Write();
+      weighttree->CloneTree()->Write();
+
+      TH1D* nuisance_fluxhist = (TH1D*) weightsfile->Get("nuisance_fluxhist");
+      TH1D* nuisance_eventhist = (TH1D*) weightsfile->Get("nuisance_eventhist");
+      nuisance_fluxhist->Write("nuisance_fluxhist");
+      nuisance_eventhist->Write("nuisance_eventhist");
+    }
+    weightsfile->Close();
+
+
+    // Add option to build seperate chunks
+
+    // Close Output
+    outputfile->Close();
+  }
+
+  // remove Keys
+  eventkeys.clear();
+
+}
+
+void SplineRoutines::MergeEventSplinesChunks() {
+
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
+
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
+
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
+  }
+  splwrite->SetupSplineSet();
+
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make new outputfile
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
+
+    // Get Weights File
+    TFile* weightsfile = new TFile((outputfilename + ".weights.root").c_str(), "READ");
+    TTree* weighttree = (TTree*) weightsfile->Get("weight_tree");
+
+    // Get SPLWRite Info
+    //splwrite->ReadWeightsFromTree(weighttree);
+    int nevents = weighttree->GetEntries();
+    // int countwidth = (nevents / 1000);
+    // int nweights = splwrite->GetNWeights();
+    int npar = splwrite->GetNPars();
+
+    // Make counter
+    // int lasttime = time(NULL);
+
+
+    // Setup Splines To Be Saved into TTree
+    outputfile->cd();
+    TTree* splinetree = new TTree("spline_tree", "spline_tree");
+
+    float* coeff = new float[npar];
+    splinetree->Branch("SplineCoeff", coeff, Form("SplineCoeff[%d]/F", npar));
+
+
+    // Load N Chunks of the Weights into Memory
+    // Split into N processing chunks
+    int nchunks = FitPar::Config().GetParI("spline_chunks");
+    if (nchunks <= 0) nchunks = 1;
+    if (nchunks >= nevents / 2) nchunks = nevents / 2;
+    int neventsinchunk   = nevents / nchunks;
+
+
+    for (int ichunk = 0; ichunk < nchunks; ichunk++) {
+
+      // Get Output File
+      TFile* chunkfile = new TFile( (outputfilename + std::string(Form(".coeffchunk_%d.root", ichunk))).c_str() );
+
+      // Get TTree for spline coeffchunk
+      TTree* splinetreechunk = (TTree*) chunkfile->Get("spline_tree");
+
+      // Set Branch Address to coeffchunk
+      float* coeffchunk = new float[npar];
+      splinetreechunk->SetBranchAddress("SplineCoeff", coeffchunk);
+
+      // Loop over nevents in chunk
+      for (int k = 0; k < neventsinchunk; k++) {
+        splinetreechunk->GetEntry(k);
+        for (int j = 0; j < npar; j++) {
+          coeff[j] = coeffchunk[j];
+        }
+        splinetree->Fill();
+      }
+
+      // Close up
+      chunkfile->Close();
+      delete coeffchunk;
+
+      std::cout << "Merged chunk " << ichunk << std::endl;
+
+    }
+
+    // Save flux and close file
+    outputfile->cd();
+    splinetree->Write();
+
+    outputfile->cd();
+    splwrite->Write("spline_reader");
+
+    TTree* nuisanceevents = (TTree*) weightsfile->Get("nuisance_events");
+    nuisanceevents->CloneTree()->Write();
+    weighttree->CloneTree()->Write();
+
+    TH1D* nuisance_fluxhist = (TH1D*) weightsfile->Get("nuisance_fluxhist");
+    TH1D* nuisance_eventhist = (TH1D*) weightsfile->Get("nuisance_eventhist");
+    nuisance_fluxhist->Write("nuisance_fluxhist");
+    nuisance_eventhist->Write("nuisance_eventhist");
+
+    weightsfile->Close();
+
+
+    // Add option to build seperate chunks
+
+    // Close Output
+    outputfile->Close();
+  }
+
+  // remove Keys
+  eventkeys.clear();
+
+}
+
+// void SplineRoutines::BuildSplineChunk(){
+//}
+
+// void SplineRoutines::MergeSplineChunks(){
+//}
+
+
+//*************************************
+void SplineRoutines::MergeSplines() {
+//*************************************
+  // Loop over all 'splinemerge' keys.
+  // Add them to the Merger.
+  // Call setup splines.
+
+  // Get the key with eventinput
+  // - remaining keys should have splineinput
+  // - Loop over number of entries.
+  // - FillEntry in merger.
+  // - Fill NUISANCEEvent into a new TTree.
+
+  SplineMerger* splmerge = new SplineMerger();
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("splinemerge");
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
+
+    TFile* infile = new TFile(splkey.GetS("input").c_str(), "READ");
+    splmerge->AddSplineSetFromFile(infile);
+
+  }
+  splmerge->SetupSplineSet();
+
+  // Now get Event File
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("eventmerge");
+  nuiskey key = eventkeys[0];
+
+  std::string inputfilename  = key.GetS("input");
+
+  // Make a new input handler
+  std::vector<std::string> file_descriptor =
+    GeneralUtils::ParseToStr(inputfilename, ":");
+  if (file_descriptor.size() != 2) {
+    ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+             << "\". expected \"FILETYPE:file.root\"" << std::endl;
+    throw;
+  }
+  InputUtils::InputType inptype =
+    InputUtils::ParseInputType(file_descriptor[0]);
+
+  InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
+
+  std::string outputfilename = key.GetS("output");
+  if (outputfilename.empty()) {
+    outputfilename = inputfilename + ".nuisance.root";
+    ERR(FTL) << "No output give for set of output events! Saving to "
+             << outputfilename << std::endl;
+  }
+
+  // Make new outputfile
+  TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+  outputfile->cd();
+
+
+  // Get info from inputhandler
+  int nevents = input->GetNEvents();
+  int countwidth = (nevents / 1000);
+  FitEvent* nuisevent = input->FirstNuisanceEvent();
+
+  // Setup a TTree to save the event
+  outputfile->cd();
+  TTree* eventtree = new TTree("nuisance_events", "nuisance_events");
+
+  // Add a flag that allows just splines to be saved.
+  nuisevent->AddBranchesToTree(eventtree);
+
+  // Save the spline reader
+  splmerge->Write("spline_reader");
+
+  // Setup the spline TTree
+  TTree* splinetree = new TTree("spline_tree", "spline_tree");
+  splmerge->AddCoefficientsToTree(splinetree);
+
+  int lasttime = time(NULL);
+  int i = 0;
+  // Loop over all events and fill the TTree
+  while (nuisevent) {
+
+    // Calculate the weights for each parameter set
+    splmerge->FillMergedSplines(i);
+
+    // Save everything
+    eventtree->Fill();
+    splinetree->Fill();
+
+    // Logging
+    if (i % countwidth == 0) {
+
+      std::ostringstream timestring;
+      int timeelapsed = time(NULL) - lasttime;
+      if (i != 0 and timeelapsed) {
+        lasttime = time(NULL);
+
+        int eventsleft = nevents - i;
+        float speed = float(countwidth) / float(timeelapsed);
+        float proj = (float(eventsleft) / float(speed)) / 60 / 60;
+        timestring << proj << " hours remaining.";
+
+      }
+      LOG(REC) << "Saved " << i << "/" << nevents << " nuisance spline events. " << timestring.str() << std::endl;
+    }
+
+    // Iterate
+    i++;
+    nuisevent = input->NextNuisanceEvent();
+  }
+
+  // Save flux and close file
+  outputfile->cd();
+  eventtree->Write();
+  splinetree->Write();
+
+  input->GetFluxHistogram()->Write("nuisance_fluxhist");
+  input->GetEventHistogram()->Write("nuisance_eventhist");
+
+  // Close Output
+  outputfile->Close();
+
+  // Delete Inputs
+  delete input;
+}
+
+
+//*************************************
+void SplineRoutines::TestSplines_1DEventScan() {
+//*************************************
+
+  // Setup RW Engine
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Make a spline RW Engine too.
+  FitWeight* splweight = new FitWeight("splinerwaweight");
+  // std::vector<nuiskey> splinekeys    = Config::QueryKeys("spline");
+  std::vector<nuiskey> parameterkeys = Config::QueryKeys("parameter");
+  TH1D* parhisttemplate = new TH1D("parhist", "parhist", parameterkeys.size(), 0.0, float(parameterkeys.size()));
+
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    std::string parname = key.GetS("name");
+    std::string partype = key.GetS("type");
+    double nom = key.GetD("nominal");
+
+    parhisttemplate->SetBinContent(i + 1, nom);
+    parhisttemplate->GetXaxis()->SetBinLabel(i + 1, parname.c_str());
+
+    splweight->IncludeDial( key.GetS("name"),
+                            kSPLINEPARAMETER, nom);
+    splweight->SetDialValue( key.GetS("name"), key.GetD("nominal") );
+
+  }
+  splweight->Reconfigure();
+
+  // Make a high resolution spline set.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  // int testres = FitPar::Config().GetParI("spline_test_resolution");
+
+  std::vector< std::vector<double> > scanparset_vals;
+  std::vector< TH1D* > scanparset_hists;
+
+  // Loop over all params
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    // Get Par Name
+    std::string name = key.GetS("name");
+
+    if (!key.Has("low") or !key.Has("high") or !key.Has("step")) {
+      continue;
+    }
+
+    // Push Back Scan
+    double low  = key.GetD("low");
+    double high = key.GetD("high");
+    double cur = low;
+    double step = key.GetD("step");
+
+    while (cur <= high) {
+
+      // Make new set
+      std::vector<double> newvals = nomvals;
+      newvals[i] = cur;
+
+      // Add to vects
+      scanparset_vals.push_back(newvals);
+
+      TH1D* parhist = (TH1D*)parhisttemplate->Clone();
+      for (size_t j = 0; j < newvals.size(); j++) {
+        parhist->SetBinContent(j + 1, newvals[j]);
+      }
+      scanparset_hists.push_back(parhist);
+
+
+      // Move to next one
+      cur += step;
+    }
+  }
+
+  // Print out the parameter set to test
+  for (uint i = 0; i < scanparset_vals.size(); i++) {
+    std::cout << "Parset " << i;
+    for (uint j = 0 ; j < scanparset_vals[i].size(); j++) {
+      std::cout << " " << scanparset_vals[i][j];
+    }
+    std::cout << std::endl;
+  }
+  
+  // Weight holders
+  double* rawweights = new double[scanparset_vals.size()];
+  double* splweights = new double[scanparset_vals.size()];
+  double* difweights = new double[scanparset_vals.size()];
+  int nweights = scanparset_vals.size();
+  // int NParSets = scanparset_vals.size();
+
+  // Loop over all event I/O
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
+
+
+    // Make handlers for input and output
+    InputHandlerBase* input  = InputUtils::CreateInputHandler("rawevents", inptype, file_descriptor[1]);
+    InputHandlerBase* output =  InputUtils::CreateInputHandler("splineevents", InputUtils::kEVSPLN_Input, outputfilename);
+
+    // Get Base Events for each case.
+    FitEvent* rawevent = input->FirstNuisanceEvent();
+    FitEvent* splevent = output->FirstNuisanceEvent();
+
+
+    // Setup outputfile
+    std::string outputtest = outputfilename + ".splinetest.1DEventScan.root";
+    TFile* outputtestfile = new TFile(outputtest.c_str(), "RECREATE");
+    outputtestfile->cd();
+
+    // Save Parameter Sets
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      scanparset_hists[i]->Write(Form("Paramater_Set_%i", (int)i));
+    }
+
+    // Save a TTree of weights and differences.
+    TTree* weighttree = new TTree("weightscan", "weightscan");
+
+    // Make a branch for each weight set
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      weighttree->Branch(Form("RawWeights_Set_%i", (int)i), &rawweights[i], Form("RawWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("SplineWeights_Set_%i", (int)i), &splweights[i], Form("SplineWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("DifWeights_Set_%i", (int)i), &difweights[i], Form("DifWeights_Set_%i/D", (int)i) );
+
+    }
+
+    // Count
+    // int i = 0;
+    int nevents = input->GetNEvents();
+    int lasttime = time(NULL);
+
+    // Load N Chunks of the Weights into Memory
+    // Split into N processing chunks
+    int nchunks = FitPar::Config().GetParI("spline_chunks");
+    if (nchunks <= 0) nchunks = 1;
+    if (nchunks >= nevents / 2) nchunks = nevents / 2;
+    
+    std::cout << "Starting NChunks " << nchunks << std::endl;
+    for (int ichunk = 0; ichunk < nchunks; ichunk++) {
+
+      // Skip to only do one processing chunk
+      //      if (procchunk != -1 and procchunk != ichunk) continue;
+
+      LOG(FIT) << "On Processing Chunk " << ichunk << std::endl;
+      int neventsinchunk   = nevents / nchunks;
+      int loweventinchunk  = neventsinchunk * ichunk;
+      // int higheventinchunk = neventsinchunk * (ichunk + 1);
+
+      double** allrawweights = new double*[neventsinchunk];
+      double** allsplweights = new double*[neventsinchunk];
+      double** alldifweights = new double*[neventsinchunk];
+      for (int k = 0; k < neventsinchunk; k++){
+        allrawweights[k] = new double[nweights];
+	allsplweights[k] = new double[nweights];
+	alldifweights[k] = new double[nweights];
+      }
+
+      // Start Set Processing Here.
+      for (int iset = 0; iset < nweights; iset++) {
+
+	// Reconfigure
+        fRW->SetAllDials(&scanparset_vals[iset][0], scanparset_vals[iset].size());
+        fRW->Reconfigure();
+
+        // Reconfigure spline RW
+        splweight->SetAllDials(&scanparset_vals[iset][0], scanparset_vals[iset].size());
+        splweight->Reconfigure();
+
+        splevent->fSplineRead->SetNeedsReconfigure(true);
+
+        // Could reorder this to save the weightconts in order instead of reconfiguring per event.
+        // Loop over all events and fill the TTree
+        for (int i = 0; i < neventsinchunk; i++){
+
+	  rawevent = input->GetNuisanceEvent(i+loweventinchunk);
+	  splevent = output->GetNuisanceEvent(i+loweventinchunk);
+
+	  allrawweights[i][iset] = fRW->CalcWeight(rawevent);
+	  allsplweights[i][iset] = splweight->CalcWeight(splevent);
+	  alldifweights[i][iset] = allsplweights[i][iset] - allrawweights[i][iset];
+        }
+	
+	std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if  (timeelapsed) {
+          lasttime = time(NULL);
+
+          int setsleft = (nweights-iset-1) + (nweights * (nchunks - ichunk - 1));
+          float proj = (float(setsleft) *timeelapsed) / 60 / 60;
+          timestring << setsleft << " sets remaining. Last one took " << timeelapsed << ". " << proj << " hours remaining.";
+
+        }
+
+	LOG(REC) << "Processed Set " << iset << "/" << nweights <<" in chunk " << ichunk << "/" << nchunks << " " << timestring.str() << std::endl;
+
+      }
+
+      // Fill weights for this chunk into the TTree
+      for (int k = 0; k < neventsinchunk; k++){
+	for (int l = 0; l < nweights; l++){
+	  rawweights[l] = allrawweights[k][l];
+	  splweights[l] = allsplweights[k][l];
+	  difweights[l] = alldifweights[k][l];
+	}
+        weighttree->Fill();
+      }
+    }
+
+
+    // Loop over nchunks
+
+    // Loop over parameter sets
+    // Set All Dials and reconfigure
+
+    // Loop over events in chunk
+    // Fill Chunkweightcontainers
+    
+    // Once all dials are done, fill the weight tree
+    
+    // Iterator to next chunk
+    
+
+    outputtestfile->cd();
+    weighttree->Write();
+    outputtestfile->Close();
+  }
+}
+
+  
+
+
+
+
+/*
+  // Make a high resolution spline set.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  int testres = FitPar::Config().GetParI("spline_test_resolution");
+
+  std::vector< std::vector<double> > scanparset_vals;
+  std::vector< TH1D* > scanparset_hists;
+
+  // Loop over all params
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    // Get Par Name
+    std::string name = key.GetS("name");
+
+    if (!key.Has("low") or !key.Has("high") or !key.Has("step")) {
+      continue;
+    }
+
+    // Push Back Scan
+    double low  = key.GetD("low");
+    double high = key.GetD("high");
+    double cur = low;
+    double step = key.GetD("step");
+
+    while (cur <= high) {
+
+      // Make new set
+      std::vector<double> newvals = nomvals;
+      newvals[i] = cur;
+
+      // Add to vects
+      scanparset_vals.push_back(newvals);
+
+      TH1D* parhist = (TH1D*)parhisttemplate->Clone();
+      for (size_t j = 0; j < newvals.size(); j++) {
+        parhist->SetBinContent(j + 1, newvals[j]);
+      }
+      scanparset_hists.push_back(parhist);
+
+
+      // Move to next one
+      cur += step;
+    }
+  }
+
+  // Print out the parameter set to test
+  for (int i = 0; i < scanparset_vals.size(); i++) {
+    std::cout << "Parset " << i;
+    for (int j = 0 ; j < scanparset_vals[i].size(); j++) {
+      std::cout << " " << scanparset_vals[i][j];
+    }
+    std::cout << std::endl;
+  }
+
+
+  // Weight holders
+  double* rawweights = new double[scanparset_vals.size()];
+  double* splweights = new double[scanparset_vals.size()];
+  double* difweights = new double[scanparset_vals.size()];
+
+  int NParSets = scanparset_vals.size();
+
+  // Loop over all event I/O
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
+
+
+    // Make handlers for input and output
+    InputHandlerBase* input  = InputUtils::CreateInputHandler("rawevents", inptype, file_descriptor[1]);
+    InputHandlerBase* output =  InputUtils::CreateInputHandler("splineevents", InputUtils::kEVSPLN_Input, outputfilename);
+
+    // Get Base Events for each case.
+    FitEvent* rawevent = input->FirstNuisanceEvent();
+    FitEvent* splevent = output->FirstNuisanceEvent();
+
+
+    // Setup outputfile
+    std::string outputtest = outputfilename + ".splinetest.1DEventScan.root";
+    TFile* outputtestfile = new TFile(outputtest.c_str(), "RECREATE");
+    outputtestfile->cd();
+
+    // Save Parameter Sets
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      scanparset_hists[i]->Write(Form("Paramater_Set_%i", (int)i));
+    }
+
+    // Save a TTree of weights and differences.
+    TTree* weighttree = new TTree("weightscan", "weightscan");
+
+    // Make a branch for each weight set
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      weighttree->Branch(Form("RawWeights_Set_%i", (int)i), &rawweights[i], Form("RawWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("SplineWeights_Set_%i", (int)i), &splweights[i], Form("SplineWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("DifWeights_Set_%i", (int)i), &difweights[i], Form("DifWeights_Set_%i/D", (int)i) );
+
+    }
+
+    // Count
+    int i = 0;
+    int nevents = input->GetNEvents();
+    while (rawevent and splevent) {
+
+      // Loop over 1D parameter sets.
+      for (size_t j = 0; j < scanparset_vals.size(); j++) {
+
+        // Reconfigure
+        fRW->SetAllDials(&scanparset_vals[j][0], scanparset_vals[j].size());
+        fRW->Reconfigure();
+
+        // Reconfigure spline RW
+        splweight->SetAllDials(&scanparset_vals[j][0], scanparset_vals[j].size());
+        splweight->Reconfigure();
+
+        splevent->fSplineRead->SetNeedsReconfigure(true);
+
+        // Calc weight for both events
+        rawweights[j] = fRW->CalcWeight(rawevent);
+        splweights[j] = splweight->CalcWeight(splevent);
+        difweights[j] = splweights[j] - rawweights[j];
+      }
+
+
+      if (i % 1000 == 0) {
+        LOG(FIT) << "Processed " << i << "/" << nevents << std::endl;
+      }
+
+      // Fill Array
+      weighttree->Fill();
+
+      // Iterate to next event.
+      i++;
+      rawevent = input->NextNuisanceEvent();
+      splevent = output->NextNuisanceEvent();
+    }
+
+    outputtestfile->cd();
+    weighttree->Write();
+    outputtestfile->Close();
+  }
+}
+
+*/
+
+//*************************************
+void SplineRoutines::TestSplines_NDEventThrow() {
+//*************************************
+
+  // Setup RW Engine
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Make a spline RW Engine too.
+  FitWeight* splweight = new FitWeight("splinerwaweight");
+  std::vector<nuiskey> parameterkeys = Config::QueryKeys("parameter");
+  TH1D* parhisttemplate = new TH1D("parhist", "parhist", parameterkeys.size(), 0.0, float(parameterkeys.size()));
+
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    std::string parname = key.GetS("name");
+    std::string partype = key.GetS("type");
+    double nom = key.GetD("nominal");
+
+    parhisttemplate->SetBinContent(i + 1, nom);
+    parhisttemplate->GetXaxis()->SetBinLabel(i + 1, parname.c_str());
+
+    splweight->IncludeDial( key.GetS("name"),
+                            kSPLINEPARAMETER, nom);
+    splweight->SetDialValue( key.GetS("name"), key.GetD("nominal") );
+
+  }
+  splweight->Reconfigure();
+
+  // Make a high resolution spline set.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  // int testres = FitPar::Config().GetParI("spline_test_resolution");
+
+  std::vector< std::string > scanparset_names;
+  std::vector< std::vector<double> > scanparset_vals;
+  std::vector< TH1D* > scanparset_hists;
+
+  // Loop over all params
+  // Add Parameters
+  int nthrows = FitPar::Config().GetParI("spline_test_throws");
+  for (int i = 0; i < nthrows; i++) {
+
+    std::vector<double> newvals = nomvals;
+
+    for (size_t j = 0; j < parameterkeys.size(); j++) {
+      nuiskey key = parameterkeys[j];
+
+      if (!key.Has("low") or !key.Has("high") or !key.Has("step")) {
+        continue;
+      }
+
+      // Push Back Scan
+      double low  = key.GetD("low");
+      double high = key.GetD("high");
+      newvals[j] =  gRandom->Uniform(low, high);
+
+    }
+    // Add to vects
+    scanparset_vals.push_back(newvals);
+
+    TH1D* parhist = (TH1D*)parhisttemplate->Clone();
+    for (size_t j = 0; j < newvals.size(); j++) {
+      parhist->SetBinContent(j + 1, newvals[j]);
+    }
+    scanparset_hists.push_back(parhist);
+  }
+
+  // Print out the parameter set to test
+  for (uint i = 0; i < scanparset_vals.size(); i++) {
+    std::cout << "Parset " << i;
+    for (uint j = 0 ; j < scanparset_vals[i].size(); j++) {
+      std::cout << " " << scanparset_vals[i][j];
+    }
+    std::cout << std::endl;
+  }
+
+
+  // Weight holders
+  double* rawweights = new double[scanparset_vals.size()];
+  double* splweights = new double[scanparset_vals.size()];
+  double* difweights = new double[scanparset_vals.size()];
+  int nweights = scanparset_vals.size();
+  // int NParSets = scanparset_vals.size();
+
+  // Loop over all event I/O
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
+
+
+    // Make handlers for input and output
+    InputHandlerBase* input  = InputUtils::CreateInputHandler("rawevents", inptype, file_descriptor[1]);
+    InputHandlerBase* output =  InputUtils::CreateInputHandler("splineevents", InputUtils::kEVSPLN_Input, outputfilename);
+
+    // Get Base Events for each case.
+    FitEvent* rawevent = input->FirstNuisanceEvent();
+    FitEvent* splevent = output->FirstNuisanceEvent();
+
+
+    // Setup outputfile
+    std::string outputtest = outputfilename + ".splinetest.NDEventThrow.root";
+    TFile* outputtestfile = new TFile(outputtest.c_str(), "RECREATE");
+    outputtestfile->cd();
+
+    // Save Parameter Sets
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      scanparset_hists[i]->Write(Form("Paramater_Set_%i", (int)i));
+    }
+
+    // Save a TTree of weights and differences.
+    TTree* weighttree = new TTree("weightscan", "weightscan");
+
+    // Make a branch for each weight set
+    for (size_t i = 0; i < scanparset_hists.size(); i++) {
+      weighttree->Branch(Form("RawWeights_Set_%i", (int)i), &rawweights[i], Form("RawWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("SplineWeights_Set_%i", (int)i), &splweights[i], Form("SplineWeights_Set_%i/D", (int)i) );
+      weighttree->Branch(Form("DifWeights_Set_%i", (int)i), &difweights[i], Form("DifWeights_Set_%i/D", (int)i) );
+
+    }
+
+    // Count
+    // int i = 0;
+    int nevents = input->GetNEvents();
+    int lasttime = time(NULL);
+
+    // Load N Chunks of the Weights into Memory
+    // Split into N processing chunks
+    int nchunks = FitPar::Config().GetParI("spline_chunks");
+    if (nchunks <= 0) nchunks = 1;
+    if (nchunks >= nevents / 2) nchunks = nevents / 2;
+    
+    std::cout << "Starting NChunks " << nchunks << std::endl;
+    for (int ichunk = 0; ichunk < nchunks; ichunk++) {
+
+      // Skip to only do one processing chunk
+      //      if (procchunk != -1 and procchunk != ichunk) continue;
+
+      LOG(FIT) << "On Processing Chunk " << ichunk << std::endl;
+      int neventsinchunk   = nevents / nchunks;
+      int loweventinchunk  = neventsinchunk * ichunk;
+      // int higheventinchunk = neventsinchunk * (ichunk + 1);
+
+      double** allrawweights = new double*[neventsinchunk];
+      double** allsplweights = new double*[neventsinchunk];
+      double** alldifweights = new double*[neventsinchunk];
+      for (int k = 0; k < neventsinchunk; k++){
+        allrawweights[k] = new double[nweights];
+	allsplweights[k] = new double[nweights];
+	alldifweights[k] = new double[nweights];
+      }
+
+      // Start Set Processing Here.
+      for (int iset = 0; iset < nweights; iset++) {
+
+	// Reconfigure
+        fRW->SetAllDials(&scanparset_vals[iset][0], scanparset_vals[iset].size());
+        fRW->Reconfigure();
+
+        // Reconfigure spline RW
+        splweight->SetAllDials(&scanparset_vals[iset][0], scanparset_vals[iset].size());
+        splweight->Reconfigure();
+
+        splevent->fSplineRead->SetNeedsReconfigure(true);
+
+        // Could reorder this to save the weightconts in order instead of reconfiguring per event.
+        // Loop over all events and fill the TTree
+        for (int i = 0; i < neventsinchunk; i++){
+
+	  rawevent = input->GetNuisanceEvent(i+loweventinchunk);
+	  splevent = output->GetNuisanceEvent(i+loweventinchunk);
+
+	  allrawweights[i][iset] = fRW->CalcWeight(rawevent);
+	  allsplweights[i][iset] = splweight->CalcWeight(splevent);
+	  alldifweights[i][iset] = allsplweights[i][iset] - allrawweights[i][iset];
+        }
+	
+	std::ostringstream timestring;
+        int timeelapsed = time(NULL) - lasttime;
+        if  (timeelapsed) {
+          lasttime = time(NULL);
+
+          int setsleft = (nweights-iset-1) + (nweights * (nchunks - ichunk - 1));
+          float proj = (float(setsleft) *timeelapsed) / 60 / 60;
+          timestring << setsleft << " sets remaining. Last one took " << timeelapsed << ". " << proj << " hours remaining.";
+
+        }
+
+	LOG(REC) << "Processed Set " << iset << "/" << nweights <<" in chunk " << ichunk << "/" << nchunks << " " << timestring.str() << std::endl;
+
+      }
+
+      // Fill weights for this chunk into the TTree
+      for (int k = 0; k < neventsinchunk; k++){
+	for (int l = 0; l < nweights; l++){
+	  rawweights[l] = allrawweights[k][l];
+	  splweights[l] = allsplweights[k][l];
+	  difweights[l] = alldifweights[k][l];
+	}
+        weighttree->Fill();
+      }
+    }
+
+
+    // Loop over nchunks
+
+    // Loop over parameter sets
+    // Set All Dials and reconfigure
+
+    // Loop over events in chunk
+    // Fill Chunkweightcontainers
+    
+    // Once all dials are done, fill the weight tree
+    
+    // Iterator to next chunk
+    
+
+    outputtestfile->cd();
+    weighttree->Write();
+    outputtestfile->Close();
+  }
+}
+
+
+void SplineRoutines::SaveSplinePlots() {
+
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Setup the spline reader
+  SplineWriter* splwrite = new SplineWriter(fRW);
+  std::vector<nuiskey> splinekeys = Config::QueryKeys("spline");
+
+  // Add splines to splinewriter
+  for (std::vector<nuiskey>::iterator iter = splinekeys.begin();
+       iter != splinekeys.end(); iter++) {
+    nuiskey splkey = (*iter);
+
+    // Add Spline Info To Reader
+    splwrite->AddSpline(splkey);
+  }
+  splwrite->SetupSplineSet();
+
+
+
+  // Event Loop
+  // Loop over all events and calculate weights for each parameter set.
+
+  // Generate a set of nominal events
+  // Method, Loop over inputs, create input handler, then create a ttree
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  for (size_t i = 0; i < eventkeys.size(); i++) {
+    nuiskey key = eventkeys.at(i);
+
+    // Get I/O
+    std::string inputfilename  = key.GetS("input");
+    if (inputfilename.empty()) {
+      ERR(FTL) << "No input given for set of input events!" << std::endl;
+      throw;
+    }
+
+    std::string outputfilename = key.GetS("output");
+    if (outputfilename.empty()) {
+      outputfilename = inputfilename + ".nuisance.root";
+      ERR(FTL) << "No output give for set of output events! Saving to "
+               << outputfilename << std::endl;
+    }
+
+    // Make new outputfile
+    outputfilename += ".SplinePlots.root";
+    TFile* outputfile = new TFile(outputfilename.c_str(), "RECREATE");
+    outputfile->cd();
+
+    // Make a new input handler
+    std::vector<std::string> file_descriptor =
+      GeneralUtils::ParseToStr(inputfilename, ":");
+    if (file_descriptor.size() != 2) {
+      ERR(FTL) << "File descriptor had no filetype declaration: \"" << inputfilename
+               << "\". expected \"FILETYPE:file.root\"" << std::endl;
+      throw;
+    }
+    InputUtils::InputType inptype =
+      InputUtils::ParseInputType(file_descriptor[0]);
+
+    InputHandlerBase* input = InputUtils::CreateInputHandler("eventsaver", inptype, file_descriptor[1]);
+
+    // Get info from inputhandler
+    int nevents = input->GetNEvents();
+    int countwidth = (nevents / 1000);
+    FitEvent* nuisevent = input->FirstNuisanceEvent();
+
+    outputfile->cd();
+
+    // int lasttime = time(NULL);
+    TCanvas* fitcanvas = NULL;
+
+
+
+
+    // Loop over all events and fill the TTree
+    while (nuisevent) {
+
+      // std::cout << "Fitting event " << i << std::endl;
+      // Calculate the weights for each parameter set
+      splwrite->GetWeightsForEvent(nuisevent);
+      splwrite->FitSplinesForEvent(fitcanvas, true);
+
+      if (fitcanvas) {
+        outputfile->cd();
+        fitcanvas->Write(Form("Event_SplineCanvas_%i", (int)i));
+      }
+
+      // Logging
+      if (i % countwidth == 0) {
+        LOG(REC) << "Saved " << i << "/" << nevents << " nuisance spline plots. " << std::endl;
+      }
+
+      // Iterate
+      i++;
+      nuisevent = input->NextNuisanceEvent();
+    }
+    // Save flux and close file
+    outputfile->cd();
+
+    // Close Output
+    outputfile->Close();
+
+    // Delete Inputs
+    delete input;
+  }
+
+  // remove Keys
+  eventkeys.clear();
+
+}
+
+void SplineRoutines::TestSplines_NDLikelihoodThrow() {
+
+  // Setup RW Engine
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Make a spline RW Engine too.
+  FitWeight* splweight = new FitWeight("splinerwaweight");
+  std::vector<nuiskey> parameterkeys = Config::QueryKeys("parameter");
+  TH1D* parhisttemplate = new TH1D("parhist", "parhist", parameterkeys.size(), 0.0, float(parameterkeys.size()));
+
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    std::string parname = key.GetS("name");
+    std::string partype = key.GetS("type");
+    double nom = key.GetD("nominal");
+
+    parhisttemplate->SetBinContent(i + 1, nom);
+    parhisttemplate->GetXaxis()->SetBinLabel(i + 1, parname.c_str());
+
+    splweight->IncludeDial( key.GetS("name"),
+                            kSPLINEPARAMETER, nom);
+    splweight->SetDialValue( key.GetS("name"), key.GetD("nominal") );
+
+  }
+  splweight->Reconfigure();
+
+  // Make a high resolution spline set.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  // int testres = FitPar::Config().GetParI("spline_test_resolution");
+
+  std::vector< std::string > scanparset_names;
+  std::vector< std::vector<double> > scanparset_vals;
+  std::vector< TH1D* > scanparset_hists;
+
+  // Loop over all params
+  // Add Parameters
+  int nthrows = FitPar::Config().GetParI("spline_test_throws");
+  for (int i = 0; i < nthrows; i++) {
+
+    std::vector<double> newvals = nomvals;
+
+    for (size_t j = 0; j < parameterkeys.size(); j++) {
+      nuiskey key = parameterkeys[j];
+
+      if (!key.Has("low") or !key.Has("high") or !key.Has("step")) {
+        continue;
+      }
+
+      // Push Back Scan
+      double low  = key.GetD("low");
+      double high = key.GetD("high");
+      newvals[j] =  gRandom->Uniform(low, high);
+
+    }
+    // Add to vects
+    scanparset_vals.push_back(newvals);
+
+    TH1D* parhist = (TH1D*)parhisttemplate->Clone();
+    for (size_t j = 0; j < newvals.size(); j++) {
+      parhist->SetBinContent(j + 1, newvals[j]);
+    }
+    scanparset_hists.push_back(parhist);
+  }
+
+  // Print out the parameter set to test
+  for (uint i = 0; i < scanparset_vals.size(); i++) {
+    std::cout << "Parset " << i;
+    for (uint j = 0 ; j < scanparset_vals[i].size(); j++) {
+      std::cout << " " << scanparset_vals[i][j];
+    }
+    std::cout << std::endl;
+  }
+
+  // Make a new set of Raw/Spline Sample Keys
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  std::vector<nuiskey> testkeys  = Config::QueryKeys("sampletest");
+
+  std::vector<nuiskey> rawkeys;
+  std::vector<nuiskey> splkeys;
+
+
+  for (std::vector<nuiskey>::iterator iter = testkeys.begin();
+       iter != testkeys.end(); iter++) {
+    nuiskey key = (*iter);
+
+    std::string samplename = key.GetS("name");
+    std::string eventsid = key.GetS("inputid");
+    nuiskey eventskey = Config::QueryLastKey("events", "id=" + eventsid);
+    std::string rawfile = eventskey.GetS("input");
+    std::string splfile = eventskey.GetS("output");
+
+    nuiskey rawkeytemp = Config::CreateKey("sample");
+    rawkeytemp.SetS("name", samplename);
+    rawkeytemp.SetS("input", rawfile);
+
+    nuiskey splkeytemp = Config::CreateKey("sample");
+    splkeytemp.SetS("name", samplename);
+    splkeytemp.SetS("input", "EVSPLN:" + splfile);
+
+    rawkeys.push_back(rawkeytemp);
+    splkeys.push_back(splkeytemp);
+  }
+
+  if (fOutputRootFile) delete fOutputRootFile;
+  fOutputRootFile = new TFile(fOutputFile.c_str(), "RECREATE");
+
+  fOutputRootFile->ls();
+  // Make two new JointFCN
+  JointFCN* rawfcn = new JointFCN(rawkeys, fOutputRootFile);
+  JointFCN* splfcn = new JointFCN(splkeys, fOutputRootFile);
+
+  // Create iteration tree in output file
+  fOutputRootFile->cd();
+  rawfcn->CreateIterationTree("raw_iterations", fRW);
+  splfcn->CreateIterationTree("spl_iterations", splweight);
+
+  // Loop over parameter sets.
+  for (size_t j = 0; j < scanparset_vals.size(); j++) {
+
+    FitBase::SetRW(fRW);
+    double rawtotal = rawfcn->DoEval(&scanparset_vals[j][0]);
+
+    FitBase::SetRW(splweight);
+    double spltotal = splfcn->DoEval(&scanparset_vals[j][0]);
+
+    LOG(FIT) << "RAW SPLINE DIF = " << rawtotal << " " << spltotal << " " << spltotal - rawtotal << std::endl;
+  }
+
+  fOutputRootFile->cd();
+
+  rawfcn->WriteIterationTree();
+  splfcn->WriteIterationTree();
+
+}
+
+
+void SplineRoutines::TestSplines_1DLikelihoodScan() {
+
+  // Setup RW Engine.
+  if (fRW) delete fRW;
+  SetupRWEngine();
+
+  // Setup Parameter Set.
+  // Make a spline RW Engine too.
+  FitWeight* splweight = new FitWeight("splinerwaweight");
+  // std::vector<nuiskey> splinekeys    = Config::QueryKeys("spline");
+  std::vector<nuiskey> parameterkeys = Config::QueryKeys("parameter");
+  TH1D* parhisttemplate = new TH1D("parhist", "parhist", parameterkeys.size(), 0.0, float(parameterkeys.size()));
+
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    std::string parname = key.GetS("name");
+    std::string partype = key.GetS("type");
+    double nom = key.GetD("nominal");
+
+    parhisttemplate->SetBinContent(i + 1, nom);
+    parhisttemplate->GetXaxis()->SetBinLabel(i + 1, parname.c_str());
+
+    splweight->IncludeDial( key.GetS("name"),
+                            kSPLINEPARAMETER, nom);
+    splweight->SetDialValue( key.GetS("name"), key.GetD("nominal") );
+
+  }
+  splweight->Reconfigure();
+
+  // Make a high resolution spline set.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  // int testres = FitPar::Config().GetParI("spline_test_resolution");
+
+  std::vector< std::vector<double> > scanparset_vals;
+  std::vector< TH1D* > scanparset_hists;
+
+  // Loop over all params
+  // Add Parameters
+  for (size_t i = 0; i < parameterkeys.size(); i++) {
+    nuiskey key = parameterkeys[i];
+
+    // Get Par Name
+    std::string name = key.GetS("name");
+
+    if (!key.Has("low") or !key.Has("high") or !key.Has("step")) {
+      continue;
+    }
+
+    // Push Back Scan
+    double low  = key.GetD("low");
+    double high = key.GetD("high");
+    double cur = low;
+    double step = key.GetD("step");
+
+    while (cur <= high) {
+
+      // Make new set
+      std::vector<double> newvals = nomvals;
+      newvals[i] = cur;
+
+      // Add to vects
+      scanparset_vals.push_back(newvals);
+
+      TH1D* parhist = (TH1D*)parhisttemplate->Clone();
+      for (size_t j = 0; j < newvals.size(); j++) {
+        parhist->SetBinContent(j + 1, newvals[j]);
+      }
+      scanparset_hists.push_back(parhist);
+
+
+      // Move to next one
+      cur += step;
+    }
+  }
+
+  // Print out the parameter set to test
+  for (uint i = 0; i < scanparset_vals.size(); i++) {
+    std::cout << "Parset " << i;
+    for (uint j = 0 ; j < scanparset_vals[i].size(); j++) {
+      std::cout << " " << scanparset_vals[i][j];
+    }
+    std::cout << std::endl;
+  }
+
+  // Make a new set of Raw/Spline Sample Keys
+  std::vector<nuiskey> eventkeys = Config::QueryKeys("events");
+  std::vector<nuiskey> testkeys  = Config::QueryKeys("sampletest");
+
+  std::vector<nuiskey> rawkeys;
+  std::vector<nuiskey> splkeys;
+
+
+  for (std::vector<nuiskey>::iterator iter = testkeys.begin();
+       iter != testkeys.end(); iter++) {
+    nuiskey key = (*iter);
+
+    std::string samplename = key.GetS("name");
+    std::string eventsid = key.GetS("inputid");
+    nuiskey eventskey = Config::QueryLastKey("events", "id=" + eventsid);
+    std::string rawfile = eventskey.GetS("input");
+    std::string splfile = eventskey.GetS("output");
+
+    nuiskey rawkeytemp = Config::CreateKey("sample");
+    rawkeytemp.SetS("name", samplename);
+    rawkeytemp.SetS("input", rawfile);
+
+    nuiskey splkeytemp = Config::CreateKey("sample");
+    splkeytemp.SetS("name", samplename);
+    splkeytemp.SetS("input", "EVSPLN:" + splfile);
+
+    rawkeys.push_back(rawkeytemp);
+    splkeys.push_back(splkeytemp);
+  }
+
+  if (fOutputRootFile) delete fOutputRootFile;
+  fOutputRootFile = new TFile(fOutputFile.c_str(), "RECREATE");
+
+  fOutputRootFile->ls();
+  // Make two new JointFCN
+  JointFCN* rawfcn = new JointFCN(rawkeys, fOutputRootFile);
+  JointFCN* splfcn = new JointFCN(splkeys, fOutputRootFile);
+
+  // Create iteration tree in output file
+  fOutputRootFile->cd();
+  rawfcn->CreateIterationTree("raw_iterations", fRW);
+  splfcn->CreateIterationTree("spl_iterations", splweight);
+
+  // Loop over parameter sets.
+  for (size_t j = 0; j < scanparset_vals.size(); j++) {
+
+    FitBase::SetRW(fRW);
+    double rawtotal = rawfcn->DoEval(&scanparset_vals[j][0]);
+
+    FitBase::SetRW(splweight);
+    double spltotal = splfcn->DoEval(&scanparset_vals[j][0]);
+
+    LOG(FIT) << "RAW SPLINE DIF = " << rawtotal << " " << spltotal << " " << spltotal - rawtotal << std::endl;
+  }
+
+  fOutputRootFile->cd();
+
+  rawfcn->WriteIterationTree();
+  splfcn->WriteIterationTree();
+
+}
 
-    // Close file
-    splinefile->Close();
-  }
-  TestEventSplines();
-}
 
 /*
   MISC Functions
 */
 //*************************************
 int SplineRoutines::GetStatus() {
   //*************************************
 
   return 0;
 }
diff --git a/src/Routines/SplineRoutines.h b/src/Routines/SplineRoutines.h
index d6adae7..a56f692 100755
--- a/src/Routines/SplineRoutines.h
+++ b/src/Routines/SplineRoutines.h
@@ -1,196 +1,197 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef SPLINE_ROUTINES_H
 #define SPLINE_ROUTINES_H
 
 /*!
  *  \addtogroup Minimizer
  *  @{
  */
 
 #include "TH1.h"
 #include "TF1.h"
 #include "TMatrixD.h"
 #include "TVectorD.h"
 #include "TSystem.h"
 #include "TFile.h"
 #include "TProfile.h"
 
 
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 #include "FitEvent.h"
 #include "JointFCN.h"
 #include "FitParameters.h"
 #include "FitLogger.h"
 #include "BaseFitEvt.h"
-
+#include "NuisConfig.h"
+#include "NuisKey.h"
+#include "SplineReader.h"
+#include "SplineWriter.h"
+#include "SplineMerger.h"
+#include "ParserUtils.h"
+#include "OpenMPWrapper.h"
 enum minstate {
   kErrorStatus = -1,
   kGoodStatus,
   kFitError,
   kNoChange,
   kFitFinished,
   kFitUnfinished,
   kStateChange,
 };
 
 //*************************************
 //! Collects all possible fit routines into a single class to avoid repeated code
 class SplineRoutines{
 //*************************************
 
 public:
 
   /*
     Constructor/Destructor
   */
 
   //! Constructor reads in arguments given at the command line for the fit here.
   SplineRoutines(int argc, char* argv[]);
     
   //! Default destructor
   ~SplineRoutines();
 
   //! Reset everything to default/NULL
   void Init();
   
   /*
     Input Functions
   */
 
   //! Splits the arguments ready for initial setup
   void ParseArgs(int argc, char* argv[]);
-
-  //! Sorts out configuration and verbosity right at the very start.
-  //! Calls readCard to set everything else up.
-  void InitialSetup();
-
-  //! Loops through each line of the card file and passes it to other read functions
-  void ReadCard(std::string cardfile);
-
-  //! Check for parameter string in the line and assign the correct type.
-  //! Fills maps for each of the parameters
-  int ReadParameters(std::string parstring);
-
-  //! Read in the samples so we can set up the free normalisation dials if required
-  int ReadSamples(std::string sampleString);
-
-  //! Read Generic Inputs
-  int ReadGenericInputs(std::string sampleString);
-
-  //! Read Event Splines
-  int ReadEventSplines(std::string splstring);
-
-  //! Read Bin Splines
-  int ReadBinSplines(std::string binstring){ return kGoodStatus; };
   
   /*
     Setup Functions
   */
 
   //! Setup the configuration given the arguments passed at the commandline and card file
   void SetupConfig();
 
   //! Setups up our custom RW engine with all the parameters passed in the card file
   void SetupRWEngine();
 
-  //! Setups up the jointFCN and uses it to grab samples.
-  void SetupSamples();
+  void Run();
+  void SaveEvents();
+  void TestEvents();
+  void GenerateEventSplines();
+  void GenerateEventWeights();
+  void GenerateEventWeightChunks(int procchunk = -1);
+  void BuildEventSplines(int procchunk = -1);
+  void MergeEventSplinesChunks();
+  /* 
+    Testing Functions
+  */
+  
+  /// Scan parameter space in 1D at finer resolution than points. Compare Raw/Spline on an event by event basis.
+  void TestSplines_1DEventScan();
+
+  /// Scan parameter space in 1D at finer resolution than points. Compare likelihoods for all testsamples.
+  void TestSplines_1DLikelihoodScan();
 
-  void SetupGenericInputs();
+  /// Randomly throw in parameter space. For each throw, calc average weight difference.
+  void TestSplines_NDEventThrow();
 
-  void SaveEvents();
+  /// Randomly thow in parameter space. For each throw, calc likelihood difference for each sample.
+  void TestSplines_NDLikelihoodThrow();
 
-  void SaveEventSplines();
 
-  void TestEventSplines();
+  /// Generate a set of spline vs weight canvases and save to file
+  void SaveSplinePlots();
+
   /*
     Fitting Functions
   */
 
-  //! Main function to actually start iterating over the different required fit routines
-  void Run();
-
   //! Given a new map change the values that the RW engine is currently set to
   void UpdateRWEngine(std::map<std::string,double>& updateVals);
 
   /*
     MISC Functions
   */
 
   //! Get previous fit status from a file
   Int_t GetStatus();
 
+  void MergeSplines();
+
 protected:
 
   //! Our Custom ReWeight Object
   FitWeight* rw;
   FitWeight* fRW;
   
   std::string fOutputFile;
   std::string fInputFile;
 
   TFile* fInputRootFile;
   TFile* fOutputRootFile;
   
   JointFCN* fSampleFCN;
   std::list<MeasurementBase*> fSamples;
   
   std::string fCardFile;
 
   std::string fStrategy;
   std::vector<std::string> fRoutines;
   std::string fAllowedRoutines;
   
   // Input Dial Vals
   //! Vector of dial names
   std::vector<std::string> fParams;
   std::map<std::string, std::string> fStateVals;
   std::map<std::string, double>      fStartVals;
   std::map<std::string, double>      fCurVals;
   std::map<std::string, double>      fErrorVals;
   std::map<std::string, double>      fMinVals;
   std::map<std::string, double>      fMaxVals;
   std::map<std::string, double>      fStepVals;
   std::map<std::string, int>         fTypeVals;
   std::map<std::string, bool>        fFixVals;
   std::map<std::string, bool>        fStartFixVals;
 
   std::vector<std::string> fGenericInputNames;
   std::map<std::string, std::string> fGenericInputFiles;
   std::map<std::string, std::string> fGenericOutputFiles;
   std::map<std::string, std::string> fGenericOutputTypes;
-  std::map<std::string, InputHandler*> fGenericInputs;
+  std::map<std::string, InputHandlerBase*> fGenericInputs;
 
 
   std::vector<std::string> fSplineNames;
   std::map<std::string, std::string> fSplineTypes;
   std::map<std::string, std::string> fSplinePoints;
+    nuiskey fCompKey;
   
   
 };
 
 /*! @} */
 #endif
diff --git a/src/Routines/SystematicRoutines.cxx b/src/Routines/SystematicRoutines.cxx
index df041dc..124eb98 100755
--- a/src/Routines/SystematicRoutines.cxx
+++ b/src/Routines/SystematicRoutines.cxx
@@ -1,1186 +1,1508 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#include "StatusMessage.h"
 #include "SystematicRoutines.h"
 
-/*
-  Constructor/Destructor
-*/
-//************************
 void SystematicRoutines::Init(){
-//************************
 
   fInputFile = "";
   fInputRootFile = NULL;
 
   fOutputFile = "";
   fOutputRootFile = NULL;
 
   fCovar  = fCovarFree  = NULL;
   fCorrel = fCorrelFree = NULL;
   fDecomp = fDecompFree = NULL;
 
   fStrategy = "ErrorBands";
   fRoutines.clear();
+  fRoutines.push_back("ErrorBands");
 
   fCardFile = "";
 
   fFakeDataInput = "";
 
   fSampleFCN    = NULL;
 
   fAllowedRoutines = ("ErrorBands,PlotLimits");
 
 };
 
-//*************************************
 SystematicRoutines::~SystematicRoutines(){
-//*************************************
 };
 
-/*
-  Input Functions
-*/
-//*************************************
 SystematicRoutines::SystematicRoutines(int argc, char* argv[]){
-//*************************************
 
-  // Set everything to defaults
+  // Initialise Defaults
   Init();
-  std::vector<std::string> configs_cmd;
-  std::string maxevents_flag = "";
-  int verbosity_flag = 0;
-  int error_flag = 0;
-
-  // If No Arguments print commands
-  for (int i = 1; i< argc; ++i){
-    if (i+1 != argc){
-
-      // Cardfile
-      if (!std::strcmp(argv[i], "-c"))      { fCardFile=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-o")) { fOutputFile=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-f")) { fStrategy=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-q")) { configs_cmd.push_back(argv[i+1]); ++i;}
-      else if (!std::strcmp(argv[i], "-n")) { maxevents_flag=argv[i+1]; ++i;}
-      else if (!std::strcmp(argv[i], "-v")) { verbosity_flag -= 1; }
-      else if (!std::strcmp(argv[i], "+v")) { verbosity_flag += 1; }
-      else if (!std::strcmp(argv[i], "-e")) { error_flag -= 1; }
-      else if (!std::strcmp(argv[i], "+e")) { error_flag += 1; }
-      else {
-	ERR(FTL) << "ERROR: unknown command line option given! - '"
-		 <<argv[i]<<" "<<argv[i+1]<<"'"<< std::endl;
-	throw;
-      }
-    }
+  nuisconfig configuration = Config::Get();
+
+  // Default containers
+  std::string cardfile = "";
+  std::string maxevents = "-1";
+  int errorcount = 0;
+  int verbocount = 0;
+  std::vector<std::string> xmlcmds;
+  std::vector<std::string> configargs;
+  fNThrows = 250;
+  fStartThrows = 0;
+  fThrowString = "";
+  // Make easier to handle arguments.
+  std::vector<std::string> args = GeneralUtils::LoadCharToVectStr(argc, argv);
+  ParserUtils::ParseArgument(args, "-c", fCardFile, true);
+  ParserUtils::ParseArgument(args, "-o", fOutputFile, false, false);
+  ParserUtils::ParseArgument(args, "-n", maxevents, false, false);
+  ParserUtils::ParseArgument(args, "-f", fStrategy, false, false);
+  ParserUtils::ParseArgument(args, "-d", fFakeDataInput, false, false);
+  ParserUtils::ParseArgument(args, "-s", fStartThrows, false, false);
+  ParserUtils::ParseArgument(args, "-t", fNThrows, false, false);
+  ParserUtils::ParseArgument(args, "-p", fThrowString, false, false);
+  ParserUtils::ParseArgument(args, "-i", xmlcmds);
+  ParserUtils::ParseArgument(args, "-q", configargs);
+  ParserUtils::ParseCounter(args, "e", errorcount);
+  ParserUtils::ParseCounter(args, "v", verbocount);
+  ParserUtils::CheckBadArguments(args);
+
+  // Add extra defaults if none given
+  if (fCardFile.empty() and xmlcmds.empty()) {
+    ERR(FTL) << "No input supplied!" << std::endl;
+    throw;
   }
 
-  if (fCardFile.empty()){
-    ERR(FTL) << "ERROR: card file not specified."   << std::endl;
-    ERR(FTL) << "Run with '-h' to see options." << std::endl;
+  if (fOutputFile.empty() and !fCardFile.empty()) {
+    fOutputFile = fCardFile + ".root";
+    ERR(WRN) << "No output supplied so saving it to: " << fOutputFile << std::endl;
+
+  } else if (fOutputFile.empty()) {
+    ERR(FTL) << "No output file or cardfile supplied!" << std::endl;
     throw;
   }
 
-  if (fCardFile == fOutputFile) {
-    ERR(WRN) << "WARNING: output file and card file are the same file, "
-                "writing: "
-             << fCardFile << ".root" << std::endl;
-    fOutputFile = fCardFile + ".root";
+  // Configuration Setup =============================
+
+  // Check no comp key is available
+  if (Config::Get().GetNodes("nuiscomp").empty()) {
+    fCompKey = Config::Get().CreateNode("nuiscomp");
+  } else {
+    fCompKey = Config::Get().GetNodes("nuiscomp")[0];
   }
 
-  if(fCardFile == fOutputFile){
-    std::cerr << "WARNING: output file and card file are the same file, "
-      "writing: " << fCardFile << ".root" << std::endl;
-    fOutputFile = fCardFile + ".root";
+  if (!fCardFile.empty())   fCompKey.AddS("cardfile", fCardFile);
+  if (!fOutputFile.empty()) fCompKey.AddS("outputfile", fOutputFile);
+  if (!fStrategy.empty())   fCompKey.AddS("strategy", fStrategy);
+
+  // Load XML Cardfile
+  configuration.LoadConfig( fCompKey.GetS("cardfile"), "");
+
+  // Add CMD XML Structs
+  for (size_t i = 0; i < xmlcmds.size(); i++) {
+    configuration.AddXMLLine(xmlcmds[i]);
   }
 
-  // Fill fit routines and check they are good
-  fRoutines = GeneralUtils::ParseToStr(fStrategy,",");
-  for (UInt_t i = 0; i < fRoutines.size(); i++){
-    if (fAllowedRoutines.find(fRoutines[i]) == std::string::npos){
-      ERR(FTL) << "Unknown fit routine given! "
-	       << "Must be provided as a comma seperated list." << std::endl;
-      ERR(FTL) << "Allowed Routines: " << fAllowedRoutines << std::endl;
+  // Add Config Args
+  for (size_t i = 0; i < configargs.size(); i++) {
+    configuration.OverrideConfig(configargs[i]);
+  }
+  if (maxevents.compare("-1")){
+    configuration.OverrideConfig("MAXEVENTS=" + maxevents);
+  }
+
+  // Finish configuration XML
+  configuration.FinaliseConfig(fCompKey.GetS("outputfile") + ".xml");
+
+  // Add Error Verbo Lines
+  verbocount += Config::Get().GetParI("VERBOSITY");
+  errorcount += Config::Get().GetParI("ERROR");
+  std::cout << "[ NUISANCE ]: Setting VERBOSITY=" << verbocount << std::endl;
+  std::cout << "[ NUISANCE ]: Setting ERROR=" << errorcount << std::endl;
+  SETVERBOSITY(verbocount);
+  
+  // Proper Setup
+  if (fStrategy.find("ErrorBands") != std::string::npos ||
+      fStrategy.find("MergeErrors") != std::string::npos){
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");    
+  }
+
+  //  fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
+  SetupSystematicsFromXML();
+
+  SetupCovariance();
+  SetupRWEngine();
+  SetupFCN();
+  GetCovarFromFCN();
+
+  //  Run();
+
+  return;
+};
+
+void SystematicRoutines::SetupSystematicsFromXML(){
+
+  LOG(FIT) << "Setting up nuismin" << std::endl;
+
+  // Setup Parameters ------------------------------------------
+  std::vector<nuiskey> parkeys = Config::QueryKeys("parameter");
+  if (!parkeys.empty()) {
+    LOG(FIT) << "Number of parameters :  " << parkeys.size() << std::endl;
+  }
+
+  for (size_t i = 0; i < parkeys.size(); i++) {
+    nuiskey key = parkeys.at(i);
+
+    // Check for type,name,nom
+    if (!key.Has("type")) {
+      ERR(FTL) << "No type given for parameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("name")) {
+      ERR(FTL) << "No name given for parameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("nominal")) {
+      ERR(FTL) << "No nominal given for parameter " << i << std::endl;
       throw;
     }
-  }
 
-  // CONFIG
-  // ---------------------------
-  std::string par_dir =  GeneralUtils::GetTopLevelDir()+"/parameters/";
-  FitPar::Config().ReadParamFile( par_dir + "config.list.dat" );
-  FitPar::Config().ReadParamFile( fCardFile );
+    // 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;
+    std::string parstate = key.GetS("state");
+
+    // Extra limits
+    if (key.Has("low")) {
+      parlow  = key.GetD("low");
+      parhigh = key.GetD("high");
+      parstep = key.GetD("step");
+
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parlow << " < p < " << parhigh
+               << " : " << parstate << std::endl;
+    } else {
+      LOG(FIT) << "Read " << partype << " : "
+               << parname << " = "
+               << parnom << " : "
+               << parstate << std::endl;
+    }
+
+    // Run Parameter Conversion if needed
+    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);;
+    fStartVals[parname] = parnom;
+    fCurVals[parname]   = parnom;
+
+    fErrorVals[parname] = 0.0;
+
+    fStateVals[parname]    = parstate;
+    bool fixstate = parstate.find("FIX") != std::string::npos;
+    fFixVals[parname]      = fixstate;
+    fStartFixVals[parname] = fFixVals[parname];
+
+    fMinVals[parname]  = parlow;
+    fMaxVals[parname]  = parhigh;
+    fStepVals[parname] = parstep;
 
-  for (UInt_t iter = 0; iter < configs_cmd.size(); iter++){
-    FitPar::Config().ForceParam(configs_cmd[iter]);
   }
 
-  if (!maxevents_flag.empty()){
-    FitPar::Config().SetParI("input.maxevents", atoi(maxevents_flag.c_str()));
+  // Setup Samples ----------------------------------------------
+  std::vector<nuiskey> samplekeys =  Config::QueryKeys("sample");
+  if (!samplekeys.empty()) {
+    LOG(FIT) << "Number of samples : " << samplekeys.size() << std::endl;
   }
 
-  if (verbosity_flag != 0){
-    int curverb = FitPar::Config().GetParI("VERBOSITY");
-    FitPar::Config().SetParI("VERBOSITY", curverb + verbosity_flag);
+  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
+    LOG(FIT) << "Read sample info " << i << " : "
+             << samplename << std::endl
+             << "\t\t input -> " << samplefile  << std::endl
+             << "\t\t state -> " << sampletype << std::endl
+             << "\t\t norm  -> " << samplenorm << std::endl;
+
+    // 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 + sampletype + "_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;
+
+    fErrorVals[normname] = 0.0;
+
+    fMinVals[normname]  = 0.1;
+    fMaxVals[normname]  = 10.0;
+    fStepVals[normname] = 0.5;
+
+    bool state = sampletype.find("FREE") == std::string::npos;
+    fFixVals[normname]      = state;
+    fStartFixVals[normname] = state;
   }
 
-  if (error_flag != 0){
-    int curwarn = FitPar::Config().GetParI("ERROR");
-    FitPar::Config().SetParI("ERROR", curwarn + error_flag);
+  // Setup Fake Parameters -----------------------------
+  std::vector<nuiskey> fakekeys = Config::QueryKeys("fakeparameter");
+  if (!fakekeys.empty()) {
+    LOG(FIT) << "Number of fake parameters : " << fakekeys.size() << std::endl;
   }
 
-  LOG_VERB(FitPar::Config().GetParI("VERBOSITY"));
-  ERR_VERB(FitPar::Config().GetParI("ERROR"));
+  for (size_t i = 0; i < fakekeys.size(); i++) {
+    nuiskey key = fakekeys.at(i);
 
-  // CARD
-  // ---------------------------
-  // Parse Card Options
-  ReadCard(fCardFile);
+    // Check for type,name,nom
+    if (!key.Has("name")) {
+      ERR(FTL) << "No name given for fakeparameter " << i << std::endl;
+      throw;
+    } else if (!key.Has("nom")) {
+      ERR(FTL) << "No nominal given for fakeparameter " << i << std::endl;
+      throw;
+    }
 
-  // Outputs
-  // ---------------------------
-  // Save Configs to output file
-  fOutputRootFile = new TFile(fOutputFile.c_str(),"RECREATE");
-  FitPar::Config().Write();
+    // Get Inputs
+    std::string parname = key.GetS("name");
+    double parnom  = key.GetD("nom");
 
-  // Starting Setup
-  // ---------------------------
-  SetupCovariance();
-  SetupFCN();
-  GetCovarFromFCN();
-  SetupRWEngine();
+    // Push into vectors
+    fFakeVals[parname] = parnom;
+  }
+}
 
-  return;
-};
 
-//*************************************
 void SystematicRoutines::ReadCard(std::string cardfile){
-//*************************************
 
   // Read cardlines into vector
   std::vector<std::string> cardlines = GeneralUtils::ParseFileToStr(cardfile,"\n");
   FitPar::Config().cardLines = cardlines;
 
   // Read Samples first (norm params can be overridden)
   int linecount = 0;
   for (std::vector<std::string>::iterator iter = cardlines.begin();
        iter != cardlines.end(); iter++){
     std::string line = (*iter);
     linecount++;
 
     // Skip Empties
     if (line.empty()) continue;
     if (line.c_str()[0] == '#') continue;
 
     // Read Valid Samples
     int samstatus = ReadSamples(line);
 
     // Show line if bad to help user
     if (samstatus == kErrorStatus) {
       ERR(FTL) << "Bad Input in cardfile " << fCardFile
 	       << " at line " << linecount << "!" << std::endl;
       LOG(FIT) << line << std::endl;
       throw;
     }
   }
 
   // Read Parameters second
   linecount = 0;
   for (std::vector<std::string>::iterator iter = cardlines.begin();
        iter != cardlines.end(); iter++){
     std::string line = (*iter);
     linecount++;
 
     // Skip Empties
     if (line.empty()) continue;
     if (line.c_str()[0] == '#') continue;
 
     // Try Parameter Reads
     int parstatus = ReadParameters(line);
     int fakstatus = ReadFakeDataPars(line);
 
     // Show line if bad to help user
     if (parstatus == kErrorStatus ||
 	fakstatus == kErrorStatus ){
       ERR(FTL) << "Bad Parameter Input in cardfile " << fCardFile
 	       << " at line " << linecount << "!" << std::endl;
       LOG(FIT) << line << std::endl;
       throw;
     }
   }
 
   return;
 };
 
-//*****************************************
 int SystematicRoutines::ReadParameters(std::string parstring){
-//******************************************
 
   std::string inputspec = "RW Dial Inputs Syntax \n"
     "free input w/ limits: TYPE  NAME  START  MIN  MAX  STEP  [STATE] \n"
     "fix  input: TYPE  NAME  VALUE  [STATE] \n"
     "free input w/o limits: TYPE  NAME  START  FREE,[STATE] \n"
     "Allowed Types: \n"
     "neut_parameter,niwg_parameter,t2k_parameter,"
     "nuwro_parameter,gibuu_parameter";
 
   // Check sample input
   if (parstring.find("parameter") == std::string::npos) return kGoodStatus;
 
   // Parse inputs
   std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
 
   // Skip if comment or parameter somewhere later in line
   if (strvct[0].c_str()[0] == '#' ||
       strvct[0].find("parameter") == std::string::npos){
     return kGoodStatus;
   }
 
   // Check length
   if (strvct.size() < 3){
     ERR(FTL) << "Input rw dials need to provide at least 3 inputs." << std::endl;
     std::cout << inputspec << std::endl;
     return kErrorStatus;
   }
 
   // Setup default inputs
   std::string partype = strvct[0];
   std::string parname = strvct[1];
   double parval  = GeneralUtils::StrToDbl(strvct[2]);
   double minval  = parval - 1.0;
   double maxval  = parval + 1.0;
   double stepval = 1.0;
   std::string state = "FIX"; //[DEFAULT]
 
   // Check Type
   if (FitBase::ConvDialType(partype) == kUNKNOWN){
     ERR(FTL) << "Unknown parameter type! " << partype << std::endl;
     std::cout << inputspec << std::endl;
     return kErrorStatus;
   }
 
   // Check Parameter Name
   if (FitBase::GetDialEnum(partype, parname) == -1){
     ERR(FTL) << "Bad RW parameter name! " << partype << " " << parname << std::endl;
     std::cout << inputspec << std::endl;
     return kErrorStatus;
   }
 
   // Option Extra (No Limits)
   if (strvct.size() == 4){
     state = strvct[3];
   }
 
   // Check for weirder inputs
   if (strvct.size() > 4 && strvct.size() < 6){
     ERR(FTL) << "Provided incomplete limits for " << parname << std::endl;
     std::cout << inputspec << std::endl;
     return kErrorStatus;
   }
 
   // Option Extra (With limits and steps)
   if (strvct.size() >= 6){
     minval  = GeneralUtils::StrToDbl(strvct[3]);
     maxval  = GeneralUtils::StrToDbl(strvct[4]);
     stepval = GeneralUtils::StrToDbl(strvct[5]);
   }
 
   // Option Extra (dial state after limits)
   if (strvct.size() == 7){
     state = strvct[6];
   }
 
   // Run Parameter Conversion if needed
   if (state.find("ABS") != std::string::npos){
     parval  = FitBase::RWAbsToSigma( partype, parname, parval  );
     minval  = FitBase::RWAbsToSigma( partype, parname, minval  );
     maxval  = FitBase::RWAbsToSigma( partype, parname, maxval  );
     stepval = FitBase::RWAbsToSigma( partype, parname, stepval );
   } else if (state.find("FRAC") != std::string::npos){
     parval  = FitBase::RWFracToSigma( partype, parname, parval  );
     minval  = FitBase::RWFracToSigma( partype, parname, minval  );
     maxval  = FitBase::RWFracToSigma( partype, parname, maxval  );
     stepval = FitBase::RWFracToSigma( partype, parname, stepval );
   }
 
   // Check no repeat params
   if (std::find(fParams.begin(), fParams.end(), parname) != fParams.end()){
     ERR(FTL) << "Duplicate parameter names given for " << parname << std::endl;
     throw;
   }
 
   // Setup Containers
   fParams.push_back(parname);
 
   fTypeVals[parname]  = FitBase::ConvDialType(partype);
 
   fStartVals[parname] = parval;
   fCurVals[parname]   = fStartVals[parname];
 
   fErrorVals[parname] = 0.0;
 
   fStateVals[parname] = state;
 
   bool fixstate = state.find("FIX") != std::string::npos;
   fFixVals[parname]      = fixstate;
   fStartFixVals[parname] = fFixVals[parname];
 
   fMinVals[parname]  = minval;
   fMaxVals[parname]  = maxval;
   fStepVals[parname] = stepval;
 
   // Print the parameter
   LOG(MIN) << "Read Parameter " << parname << " " << parval << " "
 	   << minval << " " << maxval << " "
 	   << stepval << " " << state << std::endl;
 
   // Tell reader its all good
   return kGoodStatus;
 }
 
 //*******************************************
 int SystematicRoutines::ReadFakeDataPars(std::string parstring){
 //******************************************
 
   std::string inputspec = "Fake Data Dial Inputs Syntax \n"
     "fake value: fake_parameter  NAME  VALUE  \n"
     "Name should match dialnames given in actual dial specification.";
 
   // Check sample input
   if (parstring.find("fake_parameter") == std::string::npos)
     return kGoodStatus;
 
   // Parse inputs
   std::vector<std::string> strvct = GeneralUtils::ParseToStr(parstring, " ");
 
   // Skip if comment or parameter somewhere later in line
   if (strvct[0].c_str()[0] == '#' ||
       strvct[0] == "fake_parameter"){
     return kGoodStatus;
   }
 
   // Check length
   if (strvct.size() < 3){
     ERR(FTL) << "Fake dials need to provide at least 3 inputs." << std::endl;
     std::cout << inputspec << std::endl;
     return kErrorStatus;
   }
 
   // Read Inputs
   std::string parname = strvct[1];
   double      parval  = GeneralUtils::StrToDbl(strvct[2]);
 
   // Setup Container
   fFakeVals[parname] = parval;
 
   // Print the fake parameter
   LOG(MIN) << "Read Fake Parameter " << parname << " " << parval << std::endl;
 
   // Tell reader its all good
   return kGoodStatus;
 }
 
 //******************************************
 int SystematicRoutines::ReadSamples(std::string samstring){
 //******************************************
   const static std::string inputspec =
       "\tsample <sample_name> <input_type>:inputfile.root [OPTS] "
       "[norm]\nsample_name: Name "
       "of sample to include. e.g. MiniBooNE_CCQE_XSec_1DQ2_nu\ninput_type: The "
       "input event format. e.g. NEUT, GENIE, EVSPLN, ...\nOPTS: Additional, "
       "optional sample options.\nnorm: Additional, optional sample "
       "normalisation factor.";
 
   // Check sample input
   if (samstring.find("sample") == std::string::npos)
     return kGoodStatus;
 
   // Parse inputs
   std::vector<std::string> strvct = GeneralUtils::ParseToStr(samstring, " ");
 
   // Skip if comment or parameter somewhere later in line
   if (strvct[0].c_str()[0] == '#' ||
       strvct[0] != "sample"){
     return kGoodStatus;
   }
 
   // Check length
   if (strvct.size() < 3){
     ERR(FTL) << "Sample need to provide at least 3 inputs." << std::endl;
     return kErrorStatus;
   }
 
   // Setup default inputs
   std::string samname = strvct[1];
   std::string samfile = strvct[2];
 
   if (samfile == "FIX") {
     ERR(FTL) << "Input filename was \"FIX\", this line is probably malformed "
                 "in the input card file. Line:\'"
              << samstring << "\'" << std::endl;
     ERR(FTL) << "Expect sample lines to look like:\n\t" << inputspec
              << std::endl;
 
     throw;
   }
 
   std::string samtype = "DEFAULT";
   double      samnorm = 1.0;
 
   // Optional Type
   if (strvct.size() > 3) {
     samtype = strvct[3];
     //    samname += "_"+samtype;
     // Also get rid of the / and replace it with underscore because it might not be supported character
     //    while (samname.find("/") != std::string::npos) {
     //      samname.replace(samname.find("/"), 1, std::string("_"));
     //    }
   }
 
   // Optional Norm
   if (strvct.size() > 4) samnorm = GeneralUtils::StrToDbl(strvct[4]);
 
   // Add Sample Names as Norm Dials
   std::string normname = samname + "_norm";
 
   // Check no repeat params
   if (std::find(fParams.begin(), fParams.end(), normname) != fParams.end()){
     ERR(FTL) << "Duplicate samples given for " << samname << std::endl;
     throw;
   }
 
   fParams.push_back(normname);
 
   fTypeVals[normname]  = kNORM;
   fStartVals[normname] = samnorm;
   fCurVals[normname]   = fStartVals[normname];
   fErrorVals[normname] = 0.0;
 
   fMinVals[normname]  = 0.1;
   fMaxVals[normname]  = 10.0;
   fStepVals[normname] = 0.5;
 
   bool state = samtype.find("FREE") == std::string::npos;
   fFixVals[normname]      = state;
   fStartFixVals[normname] = state;
 
   // Print read in
   LOG(MIN) << "Read sample " << samname << " "
 	   << samfile << " " << samtype << " "
 	   << samnorm << std::endl;
 
   // Tell reader its all good
   return kGoodStatus;
 }
 
 /*
   Setup Functions
 */
 //*************************************
 void SystematicRoutines::SetupRWEngine(){
 //*************************************
 
   for (UInt_t i = 0; i < fParams.size(); i++){
     std::string name = fParams[i];
     FitBase::GetRW() -> IncludeDial(name, fTypeVals.at(name) );
   }
   UpdateRWEngine(fStartVals);
 
   return;
 }
 
 //*************************************
 void SystematicRoutines::SetupFCN(){
 //*************************************
 
   LOG(FIT)<<"Making the jointFCN"<<std::endl;
   if (fSampleFCN) delete fSampleFCN;
-  fSampleFCN = new JointFCN(fCardFile, fOutputRootFile);
+  fSampleFCN = new JointFCN(fOutputRootFile);
   SetFakeData();
 
   return;
 }
 
 
 //*************************************
 void SystematicRoutines::SetFakeData(){
 //*************************************
 
   if (fFakeDataInput.empty()) return;
 
   if (fFakeDataInput.compare("MC") == 0){
 
     LOG(FIT)<<"Setting fake data from MC starting prediction." <<std::endl;
     UpdateRWEngine(fFakeVals);
 
     FitBase::GetRW()->Reconfigure();
     fSampleFCN->ReconfigureAllEvents();
     fSampleFCN->SetFakeData("MC");
 
     UpdateRWEngine(fCurVals);
 
     LOG(FIT)<<"Set all data to fake MC predictions."<<std::endl;
   } else {
     fSampleFCN->SetFakeData(fFakeDataInput);
   }
 
   return;
 }
 
 //*****************************************
 void SystematicRoutines::GetCovarFromFCN(){
 //*****************************************
   LOG(FIT) << "Loading ParamPull objects from FCN to build covar" << std::endl;
 
   // Make helperstring
   std::ostringstream helperstr;
 
   // Keep track of what is being thrown
   std::map<std::string, std::string> dialthrowhandle;
 
   // Get Covariance Objects from FCN
   std::list<ParamPull*> inputpulls = fSampleFCN->GetPullList();
   for (PullListConstIter iter = inputpulls.begin();
        iter != inputpulls.end(); iter++){
 
     ParamPull* pull = (*iter);
 
     if (pull->GetType().find("THROW")){
       fInputThrows.push_back(pull);
       fInputCovar.push_back(pull->GetFullCovarMatrix());
       fInputDials.push_back(pull->GetDataHist());
 
       LOG(FIT) << "Read ParamPull: " << pull->GetName() << " " << pull->GetType() << std::endl;
     }
 
     TH1D dialhist = pull->GetDataHist();
     TH1D minhist  = pull->GetMinHist();
     TH1D maxhist  = pull->GetMaxHist();
     TH1I typehist = pull->GetDialTypes();
 
     for (int i = 0; i < dialhist.GetNbinsX(); i++){
       std::string name = std::string(dialhist.GetXaxis()->GetBinLabel(i+1));
       dialthrowhandle[name] = pull->GetName();
 
       if (fCurVals.find(name) == fCurVals.end()){
 
       	// Add to Containers
       	fParams.push_back(name);
       	fCurVals[name]      = dialhist.GetBinContent(i+1);
       	fStartVals[name]    = dialhist.GetBinContent(i+1);
       	fMinVals[name]      = minhist.GetBinContent(i+1);
       	fMaxVals[name]      = maxhist.GetBinContent(i+1);
       	fStepVals[name]     = 1.0;
       	fFixVals[name]      = false;
       	fStartFixVals[name] = false;
       	fTypeVals[name]     = typehist.GetBinContent(i+1);
       	fStateVals[name]    = "FREE" + pull->GetType();
 
       	// Maker Helper
       	helperstr << std::string(16, ' ' ) << FitBase::ConvDialType(fTypeVals[name]) << " "
       		  << name << " " << fMinVals[name] << " "
       		  << fMaxVals[name] << " " << fStepVals[name] << " " << fStateVals[name]
 		  << std::endl;
       }
     }
   }
 
   // Check if no throws given
   if (fInputThrows.empty()){
 
     ERR(WRN) << "No covariances given to nuissyst" << std::endl;
     ERR(WRN) << "Pushing back an uncorrelated gaussian throw error for each free parameter using step size" << std::endl;
 
     for (UInt_t i = 0; i < fParams.size(); i++){
       std::string syst     = fParams[i];
       if (fFixVals[syst]) continue;
 
       // Make Terms
       std::string name     = syst + "_pull";
 
       std::ostringstream pullterm;
       pullterm << "DIAL:" << syst << ";"
 	       << fStartVals[syst] << ";"
 	       << fStepVals[syst];
 
-      std::string type = fTypeVals[syst] + "/GAUSTHROW";
+      std::string type = "GAUSTHROW/NEUT";
 
       // Push Back Pulls
       ParamPull* pull = new ParamPull( name, pullterm.str(), type );
       fInputThrows.push_back(pull);
       fInputCovar.push_back(pull->GetFullCovarMatrix());
       fInputDials.push_back(pull->GetDataHist());
 
       // Print Whats added
       ERR(WRN) << "Added ParamPull : " << name << " " << pullterm.str() << " " << type << std::endl;
 
       // Add helper string for future fits
       helperstr << std::string(16, ' ' ) << "covar " << name << " " << pullterm.str() << " " << type << std::endl;
 
       // Keep Track of Throws
       dialthrowhandle[syst] = pull->GetName();
     }
   }
 
   // Print Helper String
   if (!helperstr.str().empty()){
     LOG(FIT) << "To remove these statements in future studies, add the lines below to your card:" << std::endl;
     // Can't use the logger properly because this can be multi-line. Use cout and added spaces to look better!
     std::cout << helperstr.str();
     sleep(2);
   }
 
 
 
   // Print Throw State
   for (UInt_t i = 0; i < fParams.size(); i++){
     std::string syst = fParams[i];
     if (dialthrowhandle.find(syst) != dialthrowhandle.end()){
       LOG(FIT) << "Dial " << i << ". " << setw(40) << syst << " = THROWING with " << dialthrowhandle[syst] << std::endl;
     } else {
       LOG(FIT) << "Dial " << i << ". " << setw(40) << syst << " = FIXED" << std::endl;
     }
   }
 
   // Pause anyway
   sleep(1);
   return;
 }
 
 
 
 
 /*
   Fitting Functions
 */
 //*************************************
 void SystematicRoutines::UpdateRWEngine(std::map<std::string,double>& updateVals){
 //*************************************
 
   for (UInt_t i = 0; i < fParams.size(); i++){
     std::string name = fParams[i];
 
     if (updateVals.find(name) == updateVals.end()) continue;
     FitBase::GetRW()->SetDialValue(name,updateVals.at(name));
   }
 
   FitBase::GetRW()->Reconfigure();
   return;
 }
 
 //*************************************
-void SystematicRoutines::Run(){
-//*************************************
-
-  for (UInt_t i = 0; i < fRoutines.size(); i++){
-
-    std::string routine = fRoutines.at(i);
-    int fitstate = kFitUnfinished;
-    LOG(FIT)<<"Running Routine: "<<routine<<std::endl;
-
-    if (routine.find("PlotLimits") != std::string::npos) PlotLimits();
-    else if (routine.find("ErrorBands") != std::string::npos) GenerateErrorBands();
-
-    // If ending early break here
-    if (fitstate == kFitFinished || fitstate == kNoChange){
-      LOG(FIT) << "Ending fit routines loop." << std::endl;
-      break;
-    }
-  }
-
-  return;
-}
-
-//*************************************
 void SystematicRoutines::PrintState(){
 //*************************************
   LOG(FIT)<<"------------"<<std::endl;
 
   // Count max size
   int maxcount = 0;
   for (UInt_t i = 0; i < fParams.size(); i++){
     maxcount = max(int(fParams[i].size()), maxcount);
   }
 
   // Header
   LOG(FIT) << " #    " << left << setw(maxcount) << "Parameter "
 	   << " = "
 	   << setw(10) << "Value"     << " +- "
 	   << setw(10) << "Error"     << " "
 	   << setw(8)  << "(Units)"   << " "
 	   << setw(10) << "Conv. Val" << " +- "
 	   << setw(10) << "Conv. Err" << " "
 	   << setw(8)  << "(Units)"   << std::endl;
 
   // Parameters
   for (UInt_t i = 0; i < fParams.size(); i++){
     std::string syst = fParams.at(i);
 
     std::string typestr  = FitBase::ConvDialType(fTypeVals[syst]);
     std::string curunits = "(sig.)";
     double      curval   = fCurVals[syst];
     double      curerr   = fErrorVals[syst];
 
     if (fStateVals[syst].find("ABS") != std::string::npos){
       curval = FitBase::RWSigmaToAbs(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
 		FitBase::RWSigmaToAbs(typestr, syst, 0.0));
       curunits = "(Abs.)";
     } else if (fStateVals[syst].find("FRAC") != std::string::npos){
       curval = FitBase::RWSigmaToFrac(typestr, syst, curval);
       curerr = (FitBase::RWSigmaToFrac(typestr, syst, curerr) -
 		FitBase::RWSigmaToFrac(typestr, syst, 0.0));
       curunits = "(Frac)";
     }
 
     std::string convunits = "(" + FitBase::GetRWUnits(typestr, syst) + ")";
     double      convval   = FitBase::RWSigmaToAbs(typestr, syst, curval);
     double      converr   = (FitBase::RWSigmaToAbs(typestr, syst, curerr) -
 			     FitBase::RWSigmaToAbs(typestr, syst, 0.0));
 
     std::ostringstream curparstring;
 
     curparstring << " " << setw(3) << left
 		 << i << ". "
 		 << setw(maxcount) << syst << " = "
 		 << setw(10) << curval     << " +- "
 		 << setw(10) << curerr     << " "
 		 << setw(8)  << curunits   << " "
                  << setw(10) << convval    << " +- "
                  << setw(10) << converr    << " "
                  << setw(8)  << convunits;
 
 
     LOG(FIT) << curparstring.str() << std::endl;
   }
 
   LOG(FIT)<<"------------"<<std::endl;
   double like = fSampleFCN->GetLikelihood();
-  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << endl;
+  LOG(FIT) << std::left << std::setw(46) << "Likelihood for JointFCN: " << like << std::endl;
   LOG(FIT)<<"------------"<<std::endl;
 }
 
 
 
 /*
   Write Functions
 */
 //*************************************
 void SystematicRoutines::SaveResults(){
 //*************************************
+  if (!fOutputRootFile)
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");  
 
   fOutputRootFile->cd();
 
   SaveCurrentState();
 
 }
 
 //*************************************
 void SystematicRoutines::SaveCurrentState(std::string subdir){
 //*************************************
 
   LOG(FIT)<<"Saving current full FCN predictions" <<std::endl;
 
   // Setup DIRS
   TDirectory* curdir = gDirectory;
   if (!subdir.empty()){
     TDirectory* newdir =(TDirectory*) gDirectory->mkdir(subdir.c_str());
     newdir->cd();
   }
 
   FitBase::GetRW()->Reconfigure();
   fSampleFCN->ReconfigureAllEvents();
   fSampleFCN->Write();
 
   // Change back to current DIR
   curdir->cd();
 
   return;
 }
 
 //*************************************
 void SystematicRoutines::SaveNominal(){
 //*************************************
+  if (!fOutputRootFile)
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
 
   fOutputRootFile->cd();
 
   LOG(FIT)<<"Saving Nominal Predictions (be cautious with this)" <<std::endl;
   FitBase::GetRW()->Reconfigure();
   SaveCurrentState("nominal");
 
 };
 
 //*************************************
 void SystematicRoutines::SavePrefit(){
 //*************************************
+  if (!fOutputRootFile)
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
 
   fOutputRootFile->cd();
 
   LOG(FIT)<<"Saving Prefit Predictions"<<std::endl;
   UpdateRWEngine(fStartVals);
   SaveCurrentState("prefit");
   UpdateRWEngine(fCurVals);
 
 };
 
 
 /*
   MISC Functions
 */
 //*************************************
 int SystematicRoutines::GetStatus(){
 //*************************************
 
   return 0;
 }
 
 //*************************************
 void SystematicRoutines::SetupCovariance(){
 //*************************************
 
   // Remove covares if they exist
   if (fCovar) delete fCovar;
   if (fCovarFree) delete fCovarFree;
   if (fCorrel) delete fCorrel;
   if (fCorrelFree) delete fCorrelFree;
   if (fDecomp) delete fDecomp;
   if (fDecompFree) delete fDecompFree;
 
   int NFREE = 0;
   int NDIM = 0;
 
   // Get NFREE from min or from vals (for cases when doing throws)
   NDIM = fParams.size();
   for (UInt_t i = 0; i < fParams.size(); i++){
     if (!fFixVals[fParams[i]]) NFREE++;
   }
 
   if (NDIM == 0) return;
 
   fCovar = new TH2D("covariance","covariance",NDIM,0,NDIM,NDIM,0,NDIM);
   if (NFREE > 0){
     fCovarFree = new TH2D("covariance_free",
 			      "covariance_free",
 			      NFREE,0,NFREE,
 			      NFREE,0,NFREE);
   }
 
   // Set Bin Labels
   int countall = 0;
   int countfree = 0;
   for (UInt_t i = 0; i < fParams.size(); i++){
 
     fCovar->GetXaxis()->SetBinLabel(countall+1,fParams[i].c_str());
     fCovar->GetYaxis()->SetBinLabel(countall+1,fParams[i].c_str());
     countall++;
 
     if (!fFixVals[fParams[i]] and NFREE > 0){
       fCovarFree->GetXaxis()->SetBinLabel(countfree+1,fParams[i].c_str());
       fCovarFree->GetYaxis()->SetBinLabel(countfree+1,fParams[i].c_str());
       countfree++;
     }
   }
 
   fCorrel = PlotUtils::GetCorrelationPlot(fCovar,"correlation");
   fDecomp = PlotUtils::GetDecompPlot(fCovar,"decomposition");
 
   if (NFREE > 0)fCorrelFree = PlotUtils::GetCorrelationPlot(fCovarFree, "correlation_free");
   if (NFREE > 0)fDecompFree = PlotUtils::GetDecompPlot(fCovarFree,"decomposition_free");
 
   return;
 };
 
 //*************************************
 void SystematicRoutines::ThrowCovariance(bool uniformly){
 //*************************************
 
   // Set fThrownVals to all values in currentVals
   for (UInt_t i = 0; i < fParams.size(); i++){
     std::string name = fParams.at(i);
     fThrownVals[name] = fCurVals[name];
   }
 
   for (PullListConstIter iter = fInputThrows.begin();
        iter != fInputThrows.end(); iter++){
     ParamPull* pull = *iter;
 
     pull->ThrowCovariance();
     TH1D dialhist = pull->GetDataHist();
 
     for (int i = 0; i < dialhist.GetNbinsX(); i++){
       std::string name = std::string(dialhist.GetXaxis()->GetBinLabel(i+1));
       if (fCurVals.find(name) != fCurVals.end()){
 	fThrownVals[name] = dialhist.GetBinContent(i+1);
       }
     }
 
     // Reset throw incase pulls are calculated.
     pull->ResetToy();
 
   }
 
   return;
 };
 
 //*************************************
-void SystematicRoutines::GenerateErrorBands(){
+void SystematicRoutines::PlotLimits(){
 //*************************************
+  std::cout << "Plotting Limits" << std::endl;
+  if (!fOutputRootFile)
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
 
-  TDirectory* errorDIR = (TDirectory*) fOutputRootFile->mkdir("error_bands");
-  errorDIR->cd();
+  TDirectory* limfolder = (TDirectory*) fOutputRootFile->mkdir("Limits");
+  limfolder->cd();
 
-  // Make a second file to store throws
-  std::string tempFileName = fOutputFile;
-  if (tempFileName.find(".root") != std::string::npos) tempFileName.erase(tempFileName.find(".root"), 5);
-  tempFileName += ".throws.root";
-  TFile* tempfile = new TFile(tempFileName.c_str(),"RECREATE");
+  // Set all parameters at their starting values
+  for (UInt_t i = 0; i < fParams.size(); i++){
+    fCurVals[fParams[i]] = fStartVals[fParams[i]];
+  }
 
-  tempfile->cd();
-  int nthrows = FitPar::Config().GetParI("error_throws");
+  TDirectory* nomfolder = (TDirectory*) limfolder->mkdir("nominal");
+  nomfolder->cd();
 
   UpdateRWEngine(fCurVals);
   fSampleFCN->ReconfigureAllEvents();
-
-  TDirectory* nominal = (TDirectory*) tempfile->mkdir("nominal");
-  nominal->cd();
   fSampleFCN->Write();
 
-  TDirectory* outnominal = (TDirectory*) fOutputRootFile->mkdir("nominal_throw");
-  outnominal->cd();
-  fSampleFCN->Write();
+  limfolder->cd();
+  std::vector<std::string> allfolders;
 
 
-  fOutputRootFile->cd();
+  // Loop through each parameter
+  for (UInt_t i = 0; i < fParams.size(); i++){
+    std::string syst = fParams[i];
+    std::cout << "Starting Param " << syst << std::endl;
+    if (fFixVals[syst]) continue;
+
+    // Loop Downwards
+    while (fCurVals[syst] > fMinVals[syst]){
+      fCurVals[syst] = fCurVals[syst] - fStepVals[syst];
+
+      // Check Limit
+      if (fCurVals[syst] < fMinVals[syst])
+	fCurVals[syst] = fMinVals[syst];
+
+      // Check folder exists
+      std::string curvalstring = std::string( Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
+      if (std::find(allfolders.begin(), allfolders.end(), curvalstring) != allfolders.end())
+	break;
+
+      // Make new folder for variation
+      TDirectory* minfolder = (TDirectory*) limfolder->mkdir(Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
+      minfolder->cd();
+
+      allfolders.push_back(curvalstring);
+
+      // Update Iterations
+      double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
+      fSampleFCN->DoEval( vals );
+      delete vals;
+
+      // Save to folder
+      fSampleFCN->Write();
+    }
+
+    // Reset before next loop
+    fCurVals[syst] = fStartVals[syst];
+
+    // Loop Upwards now
+    while (fCurVals[syst] < fMaxVals[syst]){
+      fCurVals[syst] = fCurVals[syst] + fStepVals[syst];
+
+      // Check Limit
+      if (fCurVals[syst] > fMaxVals[syst])
+	fCurVals[syst] = fMaxVals[syst];
+
+      // Check folder exists
+      std::string curvalstring = std::string( Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
+      if (std::find(allfolders.begin(), allfolders.end(), curvalstring) != allfolders.end())
+	break;
+
+      // Make new folder
+      TDirectory* maxfolder = (TDirectory*) limfolder->mkdir(Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
+      maxfolder->cd();
+
+      allfolders.push_back(curvalstring);
+
+      // Update Iterations
+      double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
+      fSampleFCN->DoEval( vals );
+      delete vals;
+
+      // Save to file
+      fSampleFCN->Write();
+    }
+
+    // Reset before leaving
+    fCurVals[syst] = fStartVals[syst];
+    UpdateRWEngine(fCurVals);
+  }
+
+  return;
+}
+
+//*************************************
+void SystematicRoutines::Run(){
+//*************************************
+
+  std::cout << "Running routines "<< std::endl;
+  fRoutines = GeneralUtils::ParseToStr(fStrategy,",");
+
+  for (UInt_t i = 0; i < fRoutines.size(); i++){
+
+    std::string routine = fRoutines.at(i);
+    int fitstate = kFitUnfinished;
+    LOG(FIT)<<"Running Routine: "<<routine<<std::endl;
+
+    if (routine.compare("PlotLimits") == 0) PlotLimits();
+    else if (routine.compare("ErrorBands") == 0) GenerateErrorBands();
+    else if (routine.compare("ThrowErrors") == 0) GenerateThrows();
+    else if (routine.compare("MergeErrors") == 0) MergeThrows();
+    else {
+      std::cout << "Unknown ROUTINE : " << routine << std::endl;
+    }
+
+    // If ending early break here
+    if (fitstate == kFitFinished || fitstate == kNoChange){
+      LOG(FIT) << "Ending fit routines loop." << std::endl;
+      break;
+    }
+  }
+
+  return;
+}
+
+void SystematicRoutines::GenerateErrorBands(){
+  GenerateThrows();
+  MergeThrows();
+}
+
+//*************************************
+void SystematicRoutines::GenerateThrows(){
+//*************************************
+
+
+  TFile* tempfile = new TFile((fOutputFile + ".throws.root").c_str(),"RECREATE");
+  tempfile->cd();
+
+  int nthrows = fNThrows;
+  int startthrows = fStartThrows;
+  int endthrows = startthrows + nthrows;
+
+  if (nthrows < 0) nthrows = endthrows;
+  if (startthrows < 0) startthrows = 0;
+  if (endthrows < 0) endthrows = startthrows + nthrows;
+
+  int seed = (gRandom->Uniform(0.0,1.0)*100000 + 100000000*(startthrows + endthrows) + time(NULL))/35;
+  gRandom->SetSeed(seed);
+  LOG(FIT) << "Using Seed : " << seed << std::endl;
+  LOG(FIT) << "nthrows = " << nthrows << std::endl;
+  LOG(FIT) << "startthrows = " << startthrows << std::endl;
+  LOG(FIT) << "endthrows = " << endthrows << std::endl;
+
+
+
+  UpdateRWEngine(fCurVals);
+  fSampleFCN->ReconfigureAllEvents();
+
+  if (startthrows == 0){
+    LOG(FIT) << "Making nominal " << std::endl;
+    TDirectory* nominal = (TDirectory*) tempfile->mkdir("nominal");
+    nominal->cd();
+    fSampleFCN->Write();
+  }
+
+  LOG(SAM) << "nthrows = " << nthrows << std::endl;
+  LOG(SAM) << "startthrows = " << startthrows << std::endl;
+  LOG(SAM) << "endthrows = " << endthrows << std::endl;
+
   TTree* parameterTree = new TTree("throws","throws");
   double chi2;
   for (UInt_t i = 0; i < fParams.size(); i++)
     parameterTree->Branch(fParams[i].c_str(), &fThrownVals[fParams[i]], (fParams[i] + "/D").c_str());
   parameterTree->Branch("chi2",&chi2,"chi2/D");
   fSampleFCN->CreateIterationTree("error_iterations", FitBase::GetRW());
 
   // Would anybody actually want to do uniform throws of any parameter??
   bool uniformly = FitPar::Config().GetParB("error_uniform");
 
   // Run Throws and save
-  for (Int_t i = 0; i < nthrows; i++){
+  for (Int_t i = 0; i < endthrows+1; i++){
+
+    LOG(FIT) << "Loop " << i << std::endl;
+    ThrowCovariance(uniformly);
+    if (i < startthrows) continue;
+    if (i == 0) continue;
+    LOG(FIT) << "Throw " << i << " ================================" << std::endl;
+    // Generate Random Parameter Throw
+    //    ThrowCovariance(uniformly);
 
     TDirectory* throwfolder = (TDirectory*)tempfile->mkdir(Form("throw_%i",i));
     throwfolder->cd();
 
-    // Generate Random Parameter Throw
-    ThrowCovariance(uniformly);
-
     // Run Eval
     double *vals = FitUtils::GetArrayFromMap( fParams, fThrownVals );
     chi2 = fSampleFCN->DoEval( vals );
     delete vals;
 
     // Save the FCN
     fSampleFCN->Write();
+
     parameterTree->Fill();
   }
 
-  fOutputRootFile->cd();
   fSampleFCN->WriteIterationTree();
 
-  //  fDecompFree->Write();
-  //  fCovarFree->Write();
-  parameterTree->Write();
+  tempfile->Close();
+}
+
+void SystematicRoutines::MergeThrows(){
+
+
+    fOutputRootFile = new TFile(fCompKey.GetS("outputfile").c_str(), "RECREATE");
+    fOutputRootFile->cd();
+
+
+  // Make a container folder
+  TDirectory* errorDIR = (TDirectory*) fOutputRootFile->mkdir("error_bands");
+  errorDIR->cd();
+
+  TDirectory* outnominal = (TDirectory*) fOutputRootFile->mkdir("nominal_throw");
+  outnominal->cd();
+
+  // Split Input Files
+  if (!fThrowString.empty()) fThrowList = GeneralUtils::ParseToStr(fThrowString,",");
 
-  delete parameterTree;
+  // Add default if no throwlist given
+  if (fThrowList.size() < 1) fThrowList.push_back( fOutputFile + ".throws.root" ); 
+
+  /// Save location of file containing nominal
+  std::string nominalfile;
+  bool nominalfound;
+
+  // Loop over files and check they exist.
+  for (uint i = 0; i < fThrowList.size(); i++){
+    std::string file = fThrowList[i];
+    bool found = false;
+
+    // normal
+    std::string newfile = file;
+    TFile* throwfile = new TFile(file.c_str(),"READ");
+    if (throwfile and !throwfile->IsZombie()){ 
+        found = true;
+    }
+
+    // normal.throws.root
+    if (!found){
+      newfile = file + ".throws.root";
+      throwfile = new TFile((file + ".throws.root").c_str(),"READ");
+      if (throwfile and !throwfile->IsZombie()) {
+        found = true;
+      }
+    }
+
+    // If its found save to throwlist, else save empty.
+    // Also search for nominal
+    if (found){
+      fThrowList[i] = newfile;
+      
+      LOG(FIT) << "Throws File :" << newfile << std::endl;
+
+      // Find input which contains nominal
+      if (throwfile->Get("nominal")){
+        nominalfound = true;
+        nominalfile = newfile;
+      }
+
+      throwfile->Close();
+
+    } else {
+      fThrowList[i] = "";
+    }
+
+    delete throwfile;
+  }
+
+  // Make sure we have a nominal file
+  if (!nominalfound or nominalfile.empty()){
+    ERR(FTL) << "No nominal found when mergining! Exiting!" << std::endl;
+    throw;  
+  }
+
+  
+
+    // Get the nominal throws file
+  TFile* tempfile = new TFile((nominalfile).c_str(),"READ");
+  tempfile->cd();
+  TDirectory* nominal = (TDirectory*)tempfile->Get("nominal");
+  // int nthrows = FitPar::Config().GetParI("error_throws");
+  bool uniformly = FitPar::Config().GetParB("error_uniform");
+
+  // Check percentage of bad files is okay.
+  int badfilecount = 0;
+  for (uint i = 0; i < fThrowList.size(); i++){
+    if (!fThrowList[i].empty()){
+      LOG(FIT) << "Loading Throws From File " << i << " : " 
+	       << fThrowList[i] << std::endl;
+    } else {
+      badfilecount++;
+    }
+  }
+
+  // Check we have at least one good file
+  if ((uint)badfilecount == fThrowList.size()){
+    ERR(FTL) << "Found no good throw files for MergeThrows" << std::endl;
+    throw;
+  } else if (badfilecount > fThrowList.size()*0.25){
+    ERR(WRN) << "Over 25% of your throw files are dodgy. Please check this is okay!" << std::endl;
+    ERR(WRN) << "Will continue for the time being..." << std::endl;
+    sleep(5);
+  }
 
   // Now go through the keys in the temporary file and look for TH1D, and TH2D plots
   TIter next(nominal->GetListOfKeys());
   TKey *key;
   while ((key = (TKey*)next())) {
     TClass *cl = gROOT->GetClass(key->GetClassName());
     if (!cl->InheritsFrom("TH1D") and !cl->InheritsFrom("TH2D")) continue;
-    TH1D *baseplot = (TH1D*)key->ReadObj();
+    TH1* baseplot = (TH1D*)key->ReadObj();
     std::string plotname = std::string(baseplot->GetName());
     LOG(FIT) << "Creating error bands for " << plotname;
     if (LOG_LEVEL(FIT)){
       if (!uniformly) std::cout << " : Using COVARIANCE Throws! " << std::endl;
       else std::cout << " : Using UNIFORM THROWS!!! " << std::endl;
     }
 
-    int nbins = baseplot->GetNbinsX()*baseplot->GetNbinsY();
+    int nbins = 0;
+    if (cl->InheritsFrom("TH1D")) nbins = ((TH1D*)baseplot)->GetNbinsX();
+    else nbins = ((TH1D*)baseplot)->GetNbinsX()* ((TH1D*)baseplot)->GetNbinsY();
 
     // Setup TProfile with RMS option
     TProfile* tprof = new TProfile((plotname + "_prof").c_str(),(plotname + "_prof").c_str(),nbins, 0, nbins, "S");
 
     // Setup The TTREE
     double* bincontents;
     bincontents = new double[nbins];
 
     double* binlowest;
     binlowest = new double[nbins];
 
     double* binhighest;
     binhighest = new double[nbins];
 
     errorDIR->cd();
     TTree* bintree = new TTree((plotname + "_tree").c_str(), (plotname + "_tree").c_str());
     for (Int_t i = 0; i < nbins; i++){
       bincontents[i] = 0.0;
       binhighest[i] = 0.0;
       binlowest[i] = 0.0;
       bintree->Branch(Form("content_%i",i),&bincontents[i],Form("content_%i/D",i));
     }
 
-    for (Int_t i = 0; i < nthrows; i++){
-      TH1* newplot = (TH1*)tempfile->Get(Form(("throw_%i/" + plotname).c_str(),i));
+    // Make new throw plot
+    TH1* newplot;
 
-      for (Int_t j = 0; j < nbins; j++){
-	tprof->Fill(j+0.5, newplot->GetBinContent(j+1));
-	bincontents[j] = newplot->GetBinContent(j+1);
+    // Run Throw Merging.
+    for (UInt_t i = 0; i < fThrowList.size(); i++){
 
-	if (bincontents[j] < binlowest[j] or i == 0) binlowest[j] = bincontents[j];
-	if (bincontents[j] > binhighest[j] or i == 0) binhighest[j] = bincontents[j];
-      }
+      TFile* throwfile = new TFile(fThrowList[i].c_str(), "READ");
+
+      // Loop over all throws in a folder
+      TIter nextthrow(throwfile->GetListOfKeys());
+      TKey *throwkey;
+      while ((throwkey = (TKey*)nextthrow())) {
+        
+        // Skip non throw folders
+        if (std::string(throwkey->GetName()).find("throw_") == std::string::npos) continue;
 
-      errorDIR->cd();
-      bintree->Fill();
+        // Get Throw DIR
+        TDirectory* throwdir = (TDirectory*)throwkey->ReadObj();
 
-      delete newplot;
+        // Get Plot From Throw
+        newplot = (TH1*)throwdir->Get(plotname.c_str());
+        if (!newplot) continue;
+
+        // Loop Over Plot
+        for (Int_t j = 0; j < nbins; j++){
+          tprof->Fill(j+0.5, newplot->GetBinContent(j+1));
+          bincontents[j] = newplot->GetBinContent(j+1);
+
+          if (bincontents[j] < binlowest[j] or i == 0) binlowest[j] = bincontents[j];
+          if (bincontents[j] > binhighest[j] or i == 0) binhighest[j] = bincontents[j];
+        }
+
+        errorDIR->cd();
+        bintree->Fill();
+      }
     }
 
     errorDIR->cd();
 
-    if (!uniformly){
+    if (uniformly){
       LOG(FIT) << "Uniformly Calculating Plot Errors!" << std::endl;
     }
+
+    TH1* statplot = (TH1*) baseplot->Clone();
+
     for (Int_t j = 0; j < nbins; j++){
 
       if (!uniformly){
-	       baseplot->SetBinError(j+1,tprof->GetBinError(j+1));
+//	if ((baseplot->GetBinError(j+1)/baseplot->GetBinContent(j+1)) < 1.0) {
+	  //	  baseplot->SetBinError(j+1,sqrt(pow(tprof->GetBinError(j+1),2) + pow(baseplot->GetBinError(j+1),2)));
+	//	} else {
+	  baseplot->SetBinError(j+1,tprof->GetBinError(j+1));
+	  //	}
       } else {
       	baseplot->SetBinContent(j+1, 0.0);//(binlowest[j] + binhighest[j]) / 2.0);
         baseplot->SetBinError(j+1, 0.0); //(binhighest[j] - binlowest[j])/2.0);
       }
     }
 
     errorDIR->cd();
     baseplot->Write();
     tprof->Write();
     bintree->Write();
 
+    outnominal->cd();
+    for (int i = 0; i < nbins; i++){
+      baseplot->SetBinError(i+1, sqrt(pow(statplot->GetBinError(i+1),2) + pow(baseplot->GetBinError(i+1),2)));
+    }
+    baseplot->Write();
+    
+    delete statplot;
     delete baseplot;
     delete tprof;
     delete bintree;
     delete [] bincontents;
   }
 
   return;
 };
-
-//*************************************
-void SystematicRoutines::PlotLimits(){
-//*************************************
-
-  TDirectory* limfolder = (TDirectory*) fOutputRootFile->mkdir("Limits");
-  limfolder->cd();
-
-  // Set all parameters at their starting values
-  for (UInt_t i = 0; i < fParams.size(); i++){
-    fCurVals[fParams[i]] = fStartVals[fParams[i]];
-  }
-
-  TDirectory* nomfolder = (TDirectory*) limfolder->mkdir("nominal");
-  nomfolder->cd();
-
-  UpdateRWEngine(fCurVals);
-  fSampleFCN->ReconfigureAllEvents();
-  fSampleFCN->Write();
-
-  limfolder->cd();
-  std::vector<std::string> allfolders;
-
-
-  // Loop through each parameter
-  for (UInt_t i = 0; i < fParams.size(); i++){
-    std::string syst = fParams[i];
-    if (fFixVals[syst]) continue;
-
-    // Loop Downwards
-    while (fCurVals[syst] > fMinVals[syst]){
-      fCurVals[syst] = fCurVals[syst] - fStepVals[syst];
-
-      // Check Limit
-      if (fCurVals[syst] < fMinVals[syst])
-	fCurVals[syst] = fMinVals[syst];
-
-      // Check folder exists
-      std::string curvalstring = std::string( Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
-      if (std::find(allfolders.begin(), allfolders.end(), curvalstring) != allfolders.end())
-	break;
-
-      // Make new folder for variation
-      TDirectory* minfolder = (TDirectory*) limfolder->mkdir(Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
-      minfolder->cd();
-
-      allfolders.push_back(curvalstring);
-
-      // Update Iterations
-      double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
-      fSampleFCN->DoEval( vals );
-      delete vals;
-
-      // Save to folder
-      fSampleFCN->Write();
-    }
-
-    // Reset before next loop
-    fCurVals[syst] = fStartVals[syst];
-
-    // Loop Upwards now
-    while (fCurVals[syst] < fMaxVals[syst]){
-      fCurVals[syst] = fCurVals[syst] + fStepVals[syst];
-
-      // Check Limit
-      if (fCurVals[syst] > fMaxVals[syst])
-	fCurVals[syst] = fMaxVals[syst];
-
-      // Check folder exists
-      std::string curvalstring = std::string( Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
-      if (std::find(allfolders.begin(), allfolders.end(), curvalstring) != allfolders.end())
-	break;
-
-      // Make new folder
-      TDirectory* maxfolder = (TDirectory*) limfolder->mkdir(Form( (syst + "_%f").c_str(), fCurVals[syst] ) );
-      maxfolder->cd();
-
-      allfolders.push_back(curvalstring);
-
-      // Update Iterations
-      double *vals = FitUtils::GetArrayFromMap( fParams, fCurVals );
-      fSampleFCN->DoEval( vals );
-      delete vals;
-
-      // Save to file
-      fSampleFCN->Write();
-    }
-
-    // Reset before leaving
-    fCurVals[syst] = fStartVals[syst];
-    UpdateRWEngine(fCurVals);
-  }
-
-  return;
-}
-
diff --git a/src/Routines/SystematicRoutines.h b/src/Routines/SystematicRoutines.h
index d689b36..97737aa 100755
--- a/src/Routines/SystematicRoutines.h
+++ b/src/Routines/SystematicRoutines.h
@@ -1,256 +1,267 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef SYSTEMATIC_ROUTINES_H
 #define SYSTEMATIC_ROUTINES_H
 
 /*!
  *  \addtogroup Minimizer
  *  @{
  */
 
 #include "TH1.h"
 #include "TF1.h"
 #include "TMatrixD.h"
 #include "TVectorD.h"
 #include "TSystem.h"
 #include "TFile.h"
 #include "TProfile.h"
 
 
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 #include "FitEvent.h"
 #include "JointFCN.h"
 #include "FitParameters.h"
+#include "ParserUtils.h"
 
 enum minstate {
   kErrorStatus = -1,
   kGoodStatus,
   kFitError,
   kNoChange,
   kFitFinished,
   kFitUnfinished,
   kStateChange,
 };
 
 //*************************************
 //! Collects all possible fit routines into a single class to avoid repeated code
 class SystematicRoutines{
 //*************************************
 
 public:
 
   /*
     Constructor/Destructor
   */
 
   //! Constructor reads in arguments given at the command line for the fit here.
   SystematicRoutines(int argc, char* argv[]);
     
   //! Default destructor
   ~SystematicRoutines();
 
   //! Reset everything to default/NULL
   void Init();
   
   /*
     Input Functions
   */
 
   //! Splits the arguments ready for initial setup
   void ParseArgs(int argc, char* argv[]);
 
   //! Sorts out configuration and verbosity right at the very start.
   //! Calls readCard to set everything else up.
   void InitialSetup();
 
   //! Loops through each line of the card file and passes it to other read functions
   void ReadCard(std::string cardfile);
 
   //! Check for parameter string in the line and assign the correct type.
   //! Fills maps for each of the parameters
   int ReadParameters(std::string parstring);
 
   //! Reads in fake parameters and assigns them (Requires the parameter to be included as a normal parameter as well)
   int ReadFakeDataPars(std::string parstring);
 
   //! Read in the samples so we can set up the free normalisation dials if required
   int ReadSamples(std::string sampleString);
 
   /*
     Setup Functions
   */
+void SetupSystematicsFromXML();
 
   //! Setup the configuration given the arguments passed at the commandline and card file
   void SetupConfig();
 
   //! Setups up our custom RW engine with all the parameters passed in the card file
   void SetupRWEngine();
 
   //! Setups up the jointFCN.
   void SetupFCN();
 
   //! Sets up the minimizerObj for ROOT. there are cases where this is called repeatedly, e.g. If you are using a brute force scan before using Migrad.
   void SetupFitter(std::string routine);
 
   //! Set the current data histograms in each sample to the fake data.
   void SetFakeData();
 
   //! Setup the covariances with the correct dimensions. At the start this is either uncorrelated or merged given all the input covariances.
   //! At the end of the fit this produces the blank covariances which can then be filled by the minimizerObj with best fit covariances.
   void SetupCovariance();
 
   void GetCovarFromFCN();
   /*
     Fitting Functions
   */
 
   //! Main function to actually start iterating over the different required fit routines
   void Run();
 
   //! Given a new map change the values that the RW engine is currently set to
   void UpdateRWEngine(std::map<std::string,double>& updateVals);
 
   //! Given a single routine (see tutorial for options) run that fit routine now.
   int RunFitRoutine(std::string routine);
 
   //! Print current value
   void PrintState();
   
   //! Performs a fit routine where the input.maxevents is set to a much lower value to try and move closer to the best fit minimum.
   void LowStatRoutine(std::string routine);
 
   //! Perform a chi2 scan in 1D around the current point
   void Create1DScans();
 
   //! Perform a chi2 scan in 2D around the current point
   void Chi2Scan2D();
 
   //! Currently a placeholder NEEDS UPDATING
   void CreateContours();
 
   //! If any currentVals are close to the limits set them to the limit and fix them
   int FixAtLimit();
 
   //! Throw the current covariance of dial values we have, and fill the thrownVals and thrownNorms maps.
   //! If uniformly is true parameters will be thrown uniformly between their upper and lower limits.
   void ThrowCovariance(bool uniformly);
 
   //! Given the covariance we currently have generate error bands by throwing the covariance.
   //! The FitPar config "error_uniform" defines whether to throw using the covariance or uniformly.
   //! The FitPar config "error_throws" defines how many throws are needed.
   //! Currently only supports TH1D plots.
   void GenerateErrorBands();
-
+  
+  void GenerateThrows();
+  void MergeThrows();
   //! Step through each parameter one by one and create folders containing the MC predictions at each step.
   //! Doesn't handle correlated parameters well
   void PlotLimits();
   
   /*
     Write Functions
   */
 
   //! Save the sample plots for current MC
   //! dir if not empty forces plots to be saved in a subdirectory of outputfile
   void SaveCurrentState(std::string subdir="");
 
   //! Save starting predictions into a seperate folder
   void SaveNominal();
 
   //! Save predictions before the main study is ran into a seperate folder
   void SavePrefit();
 
   //! Save final outputs
   void SaveResults();
   /*
     MISC Functions
   */
 
   //! Get previous fit status from a file
   Int_t GetStatus();
 
 protected:
 
   //! Our Custom ReWeight Object
   FitWeight* rw;
 
   std::string fOutputFile;
   std::string fInputFile;
 
   TFile* fInputRootFile;
   TFile* fOutputRootFile;
 
   //! Flag for whether the fit should be continued if an output file is already found.
   bool fitContinue;
 
   //! Minimizer Object for handling roots different minimizer methods
   JointFCN* fSampleFCN;
 
   int nfreepars;
 
   std::string fCardFile;
 
   std::string fStrategy;
   std::vector<std::string> fRoutines;
   std::string fAllowedRoutines;
   
   std::string fFakeDataInput;
 
   // Input Dial Vals
   //! Vector of dial names
   std::vector<std::string> fParams;
   std::map<std::string, std::string> fStateVals;
   std::map<std::string, double>      fStartVals;
   std::map<std::string, double>      fCurVals;
   std::map<std::string, double>      fErrorVals;
   std::map<std::string, double>      fMinVals;
   std::map<std::string, double>      fMaxVals;
   std::map<std::string, double>      fStepVals;
   std::map<std::string, int>         fTypeVals;
   std::map<std::string, bool>        fFixVals;
   std::map<std::string, bool>        fStartFixVals;
 
   //! Vector of fake parameter names
   std::map<std::string,double> fFakeVals;
 
   //! Map of thrown parameter names and values (After ThrowCovariance)
   std::map<std::string,double> fThrownVals;
 
   TH2D* fCorrel;
   TH2D* fDecomp;
   TH2D* fCovar;
   
   TH2D* fCorrelFree;
   TH2D* fDecompFree;
   TH2D* fCovarFree;
 
   std::list   <ParamPull*>  fInputThrows; //!< Pointers to pull terms
   std::vector <TH1D>        fInputDials; //!< Vector of Input Histograms
   std::vector <TMatrixDSym> fInputCovar; //!< Vector of Input Covariances  
 
+  nuiskey fCompKey;
+  std::vector<std::string> fThrowList;
+  std::string fThrowString;
+
+  int fNThrows;
+  int fStartThrows;
+
 
 };
 
 /*! @} */
 #endif
diff --git a/src/Splines/CMakeLists.txt b/src/Splines/CMakeLists.txt
index 89867ce..6836033 100644
--- a/src/Splines/CMakeLists.txt
+++ b/src/Splines/CMakeLists.txt
@@ -1,53 +1,62 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
-FitSpline.cxx
-FitSplineHead.cxx
+SplineReader.cxx
+SplineWriter.cxx
+SplineMerger.cxx
+SplineUtils.cxx
+Spline.cxx
 )
 
 set(HEADERFILES
-FitSpline.h
-FitSplineHead.h
+SplineReader.h
+SplineWriter.h
+SplineUtils.h
+SplineMerger.h
+Spline.h
 )
 
 set(LIBNAME Splines)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/Splines/Spline.cxx b/src/Splines/Spline.cxx
new file mode 100644
index 0000000..34d6373
--- /dev/null
+++ b/src/Splines/Spline.cxx
@@ -0,0 +1,441 @@
+#include "Spline.h"
+using namespace SplineUtils;
+
+// Setup Functions
+// ----------------------------------------------
+Spline::Spline(std::string splname, std::string form, std::string points) {
+
+  // Save Definition
+  fName = splname;
+  fForm = form;
+  fPoints = points;
+  fROOTFunction = NULL;
+
+
+  // Setup Min Max for each Parameter
+  fSplitNames = GeneralUtils::ParseToStr(splname, ";");
+  std::vector< std::vector<double> > gridvals = SplineUtils::GetSplitDialPoints(fPoints);
+
+  for (size_t i = 0; i < fSplitNames.size(); i++) {
+
+    for (size_t j = 0; j < gridvals.size(); j++) {
+      if (i == 0) fXScan.push_back(gridvals[j][0]);
+      if (i == 1) fXScan.push_back(gridvals[j][1]);
+    }
+
+    double xmin = 9999.9;
+    double xmax = -9999.9;
+    for (size_t j = 0; j < gridvals.size(); j++) {
+      if (gridvals[j][i] < xmin) xmin = gridvals[j][i];
+      if (gridvals[j][i] > xmax) xmax = gridvals[j][i];
+    }
+
+    fVal.push_back(0.0);
+    fValMin.push_back(xmin);
+    fValMax.push_back(xmax);
+
+    // Define TSpline3 1D iterators here
+    if (i == 0) {
+      iter_low = fXScan.begin();
+      iter_high = fXScan.begin();
+      iter_high++;
+      off = 0;
+    }
+  }
+
+  // Set form from list
+  if      (!fForm.compare("1DPol1")) { Setup( k1DPol1, 1, 2 ); }
+  else if (!fForm.compare("1DPol2")) { Setup( k1DPol2, 1, 3 ); }
+  else if (!fForm.compare("1DPol3")) { Setup( k1DPol3, 1, 4 ); }
+  else if (!fForm.compare("1DPol4")) { Setup( k1DPol4, 1, 5 ); }
+  else if (!fForm.compare("1DPol5")) { Setup( k1DPol5, 1, 6 ); }
+  else if (!fForm.compare("1DPol6")) { Setup( k1DPol6, 1, 7 ); }
+  else if (!fForm.compare("1DTSpline3")) { Setup( k1DTSpline3, 1, fXScan.size() * 4 ); }
+  else if (!fForm.compare("2DPol6")) { Setup( k2DPol6, 2, 28 ); }
+  else if (!fForm.compare("2DGaus")) { Setup( k2DGaus, 2, 8 ); }
+  else if (!fForm.compare("2DTSpline3")) { Setup (k2DTSpline3, 2, fXScan.size() * fYScan.size() * 8); }
+  else {
+    ERR(FTL) << "Unknown spline form : " << fForm << std::endl;
+    throw;
+  }
+
+  // Run Checks
+  if ((UInt_t)fNDim != fSplitNames.size()) {
+    ERR(FTL) << "Spline Dim:Names mismatch!" << std::endl;
+    throw;
+  }
+
+  LOG(SAM) << "Setup Spline " << fForm << " = " << fType << " " <<  fNPar << std::endl;
+};
+
+
+void Spline::Setup(int type, int ndim, int npar) {
+  fType = type;
+  fNDim = ndim;
+  fNPar = npar;
+}
+
+
+
+// Reconfigure Functions
+// ----------------------------------------------
+void Spline::Reconfigure(float x, int index) {
+  // std::cout << "Reconfigured spline : " << fName << " : " << fForm << " to be " << x << " " << index << std::endl;
+  fVal[index] = x;
+  fOutsideLimits = false;
+
+  if (fVal[index] > fValMax[index]) fVal[index] = fValMax[index];
+  if (fVal[index] < fValMin[index]) fVal[index] = fValMin[index];
+  // std::cout << "Set at edge = " << fVal[index] << " " << index << std::endl;
+}
+
+void Spline::Reconfigure(std::string name, float x) {
+  for (size_t i = 0; i < fSplitNames.size(); i++) {
+    // std::cout << "-> Comparing in spline " << name << " to " << fSplitNames[i] << " = " << !fSplitNames[i].compare(name.c_str()) << std::endl;
+
+    if (!fSplitNames[i].compare(name.c_str())) {
+      // std::cout << "-> Reconfigured spline  : " << fSplitNames[i] << " " << name << " to be " << x << " " << i << std::endl;
+      Reconfigure(x, i);
+    }
+  }
+
+}
+
+
+// Evaluation Functions
+// ----------------------------------------------
+double Spline::operator()(const Double_t* x, const Double_t* par) {
+
+  Float_t* tempx = new Float_t[fNDim];
+  for (size_t i = 0; i < (UInt_t)fNDim; i++) {
+    tempx[i] = x[i];
+  }
+
+  Float_t* tempp = new Float_t[fNPar];
+  for (size_t i = 0; i < (UInt_t)fNPar; i++) {
+    tempp[i] = par[i];
+  }
+
+  float val = DoEval(tempx, tempp);
+  delete tempp;
+  delete tempx;
+
+  if (val < 0.0) val = 0.0;
+  return val;
+}
+
+double Spline::DoEvalPar(const double* x, const double* p) const{
+ Float_t* tempx = new Float_t[fNDim];
+  for (size_t i = 0; i < (UInt_t)fNDim; i++) {
+    tempx[i] = x[i];
+  }
+
+  Float_t* tempp = new Float_t[fNPar];
+  for (size_t i = 0; i < (UInt_t)fNPar; i++) {
+    tempp[i] = p[i];
+  }
+
+  float val = DoEval(tempx, tempp);
+  delete tempp;
+  delete tempx;
+
+  if (val < 0.0) val = 0.0;
+  return val;
+}
+
+
+float Spline::operator()(const Float_t* x, const Float_t* par) const {
+  float val = DoEval(x, par);
+  if (val < 0.0) val = 0.0;
+  return val;
+}
+
+float Spline::DoEval(const Float_t* x, const Float_t* par) const {
+
+  // Setup current fX to value
+  for (size_t i = 0; i < (UInt_t) fNDim; i++) {
+    fVal[i] = x[i];
+    if (fVal[i] > fValMax[i]) fVal[i] = fValMax[i];
+    if (fVal[i] < fValMin[i]) fVal[i] = fValMin[i];
+  }
+
+  double w = DoEval(&par[0], false);
+
+  if (w < 0.0) w = 0.0;
+
+  // Now evaluate spline how FitWeight will do it.
+  return w;
+}
+
+
+float Spline::DoEval(const Float_t* par, bool checkresponse) const {
+
+  if (!par)
+    return 1.0;
+
+  // std::cout << "Spline::DoEval = " << par << std::endl;
+  // Check response
+  if (checkresponse) {
+    bool hasresponse = false;
+    for (int i = 0; i < fNPar; i++) {
+      if (par[i] != 0.0) {
+        hasresponse = true;
+        break;
+      }
+    }
+
+    if (!hasresponse) {
+      // std::cout << "No Response" << std::endl;
+      return 1.0;
+    }
+  }
+
+  // std::cout << "TYpe = " << fType << " "<< fForm << std::endl;
+  // Now evaluate spline
+  switch (fType) {
+  case k1DPol1:     { return Spline1DPol1(par); }
+  case k1DPol2:     { return Spline1DPol2(par); }
+  case k1DPol3:     { return Spline1DPol3(par); }
+  case k1DPol4:     { return Spline1DPol4(par); }
+  case k1DPol5:     { return Spline1DPol5(par); }
+  case k1DPol6:     { return Spline1DPol6(par); }
+  case k1DTSpline3: { return Spline1DTSpline3(par); }
+  case k2DPol6:     { return Spline2DPol(par, 6); }
+  case k2DGaus:     { return Spline2DGaus(par); }
+  case k2DTSpline3: { return Spline2DTSpline3(par); }
+  }
+
+  // Return nominal weight
+  return 1.0;
+};
+
+
+
+// Spline Functions
+// ----------------------------------------------
+
+// 1D Functions
+// ----------------------------------------------
+float Spline::Spline1DPol1(const Float_t* par) const {
+  float xp = fVal[0];
+  return par[0] + par[1] * xp;
+};
+
+float Spline::Spline1DPol2(const Float_t* par) const {
+  float xp = fVal[0];
+  return par[0] + par[1] * xp + par[2] * xp * xp;
+};
+
+float Spline::Spline1DPol3(const Float_t* par) const {
+  float xp = fVal[0];
+  return par[0] + par[1] * xp + par[2] * xp * xp + par[3] * xp * xp * xp;
+};
+
+float Spline::Spline1DPol4(const Float_t* par) const {
+  float xp = fVal[0];
+  return (par[0] + par[1] * xp + par[2] * xp * xp + par[3] * xp * xp * xp +
+          par[4] * xp * xp * xp * xp);
+};
+
+float Spline::Spline1DPol5(const Float_t* par) const {
+  float xp = fVal[0];
+  return (par[0] + par[1] * xp + par[2] * xp * xp + par[3] * xp * xp * xp +
+          par[4] * xp * xp * xp * xp + par[5] * xp * xp * xp * xp * xp);
+};
+
+float Spline::Spline1DPol6(const Float_t* par) const {
+  float xp = fVal[0];
+
+  float w = 0.0;
+  // std::cout << "Pol Eval " << std::endl;
+  for (int i = fNPar - 1; i > 0; i--) {
+    w = xp * (par[0 + i] + w);
+  }
+  w += par[0];
+  return w;
+};
+
+
+float Spline::Spline1DTSpline3(const Float_t* par) const {
+
+  // Find matching point
+  iter_low  = fXScan.begin();
+  iter_high = fXScan.begin();
+  iter_high++;
+  off = 0;
+  fX = fVal[0];
+
+  while ( iter_high != fXScan.end() and
+          (fX < (*iter_low) or fX >= (*iter_high)) ) {
+    off += 4;
+    iter_low++;
+    iter_high++;
+  }
+
+  float dx   = fX - (*iter_low);
+  float weight = (par[off] + dx * (par[off + 1] + dx * (par[off + 2] + dx * par[off + 3])));
+
+  return weight;
+};
+
+
+// 2D Functions
+// ----------------------------------------------
+float Spline::Spline2DPol(const Float_t* par, int n) const {
+
+  float wx = (fVal[0] - fValMin[0]) / (fValMax[0] - fValMin[0]);
+  float wy = (fVal[1] - fValMin[1]) / (fValMax[1] - fValMin[1]);
+  float w = 0.0;
+  int count = 0;
+
+  w += par[count++];
+  w += par[count++] * wx;
+  w += par[count++] * wy;
+
+  w += par[count++] * wx * wx;
+  w += par[count++] * wx * wy;
+  w += par[count++] * wy * wy;
+
+  w += par[count++] * wx * wx * wx;
+  w += par[count++] * wx * wx * wy;
+  w += par[count++] * wx * wy * wy;
+  w += par[count++] * wy * wy * wy;
+
+
+  w += par[count++] * wx * wx * wx * wx;
+  w += par[count++] * wx * wx * wx * wy;
+  w += par[count++] * wx * wx * wy * wy;
+  w += par[count++] * wx * wy * wy * wy;
+  w += par[count++] * wy * wy * wy * wy;
+
+  w += par[count++] * wx * wx * wx * wx * wx;
+  w += par[count++] * wx * wx * wx * wx * wy;
+  w += par[count++] * wx * wx * wx * wy * wy;
+  w += par[count++] * wx * wx * wy * wy * wy;
+  w += par[count++] * wx * wy * wy * wy * wy;
+  w += par[count++] * wy * wy * wy * wy * wy;
+
+  w += par[count++] * wx * wx * wx * wx * wx * wx;
+  w += par[count++] * wx * wx * wx * wx * wx * wy;
+  w += par[count++] * wx * wx * wx * wx * wy * wy;
+  w += par[count++] * wx * wx * wx * wy * wy * wy;
+  w += par[count++] * wx * wx * wy * wy * wy * wy;
+  w += par[count++] * wx * wy * wy * wy * wy * wy;
+  w += par[count++] * wy * wy * wy * wy * wy * wy;
+
+  return w;
+}
+
+float Spline::Spline2DGaus(const Float_t* par) const {
+
+  double Norm = 5.0 + par[1] * 20.0;
+  double Tilt = par[2] * 10.0;
+  double Pq0  = 1.0 + par[3] * 1.0;
+  double Wq0  = 0.5 + par[4] * 1.0;
+  double Pq3  = 1.0 + par[5] * 1.0;
+  double Wq3  = 0.5 + par[6] * 1.0;
+  double q0 = (fVal[0] - fValMin[0]) / (fValMax[0] - fValMin[0]);
+  double q3 = (fVal[1] - fValMin[1]) / (fValMax[1] - fValMin[1]);
+
+  double a = cos(Tilt) * cos(Tilt) / (2 * Wq0 * Wq0);
+  a += sin(Tilt) * sin(Tilt) / (2 * Wq3 * Wq3);
+
+  double b = - sin(2 * Tilt) / (4 * Wq0 * Wq0);
+  b += sin(2 * Tilt) / (4 * Wq3 * Wq3);
+
+  double c = sin(Tilt) * sin(Tilt) / (2 * Wq0 * Wq0);
+  c += cos(Tilt) * cos(Tilt) / (2 * Wq3 * Wq3);
+
+  double w = Norm;
+  w *= exp(-a  * (q0 - Pq0) * (q0 - Pq0));
+  w *= exp(+2.0 * b * (q0 - Pq0) * (q3 - Pq3));
+  w *= exp(-c  * (q3 - Pq3) * (q3 - Pq3));
+
+  return w;
+}
+
+
+float Spline::Spline2DTSpline3(const Float_t* par) const {
+
+  // Find matching point
+  std::vector<float>::iterator iter_low_x   = fXScan.begin();
+  std::vector<float>::iterator iter_high_x  = fXScan.begin();
+  std::vector<float>::iterator iter_low_y   = fYScan.begin();
+  std::vector<float>::iterator iter_high_y  = fYScan.begin();
+  iter_high_x++;
+  iter_high_y++;
+
+  off = 0;
+  fX = fVal[0];
+  fY = fVal[1];
+
+  while ( (iter_high_x != fXScan.end() and
+           iter_high_y != fYScan.end()) and
+          (fX < (*iter_low_y) or
+           fX >= (*iter_high) or
+           fY < (*iter_low_y) or
+           fY >= (*iter_low_y)) ) {
+    off += 9;
+    iter_low_x++;
+    iter_high_x++;
+
+    if (iter_high_x == fXScan.end()) {
+      iter_low_x  =  fXScan.begin();
+      iter_high_x =  fXScan.begin();
+      iter_low_y++;
+      iter_high_y++;
+      std::cout << "Skipping to next tspline 3 rung " << *iter_low_y << std::endl;
+    }
+  }
+
+  std::cout << "Evaluting TSpline3 at " << fX << " " << (*iter_low_x) << " " << fY << " " << (*iter_low_y) <<  std::endl;
+  // sleep(1.0);
+  float dx   = fX - (*iter_low_x);
+  float dy   = fY - (*iter_low_y);
+
+  float weight = (par[off] + dx * (par[off + 1] + dx * (par[off + 2] + dx * par[off + 3])));
+  float weight2 = (par[off + 4] + dy * (par[off + 5] + dy * (par[off + 6] + dy * par[off + 7])));
+
+  return weight * weight2 * par[off + 8];
+};
+
+TF1* Spline::GetFunction() {
+
+  if (!fROOTFunction) {
+    if (fNDim == 1) {
+      std::cout << "Creating new 1D Function";
+      fROOTFunction = new TF1("f1", this, -30.0, 30.0, this->GetNPar());
+    } 
+
+    if (fNDim == 2) {
+      std::cout << "Creating new 2D Function" << std::endl;
+      // ROOT::Math::IParametricFunctionMultiDim* func; // = new ROOT::Math::IParametricFunctionMultiDim(this);
+      fROOTFunction = new TF2("f2", SplineUtils::Func2DWrapper, -30.0, 30.0, -30.0, -30.0, this->GetNPar());
+    } 
+  }
+
+  // Reset ROOT function before returning.
+  fROOTFunction->SetParameter(0, 1.0);
+  for (int i = 1; i < this->GetNPar(); i++) {
+    fROOTFunction->SetParameter(i, 0.1);
+  }
+
+  if (fNDim == 2){
+    if (SplineUtils::gSpline != this) SplineUtils::gSpline = this;
+  }
+
+  return (TF1*)fROOTFunction;
+}
+
+
+
+namespace SplineUtils {
+  Spline* gSpline = NULL;
+}
+
+double SplineUtils::Func2DWrapper(double * x, double * p) {
+  return (*gSpline)(x,p); 
+}
+
+
+
diff --git a/src/Splines/Spline.h b/src/Splines/Spline.h
new file mode 100644
index 0000000..269ba3a
--- /dev/null
+++ b/src/Splines/Spline.h
@@ -0,0 +1,168 @@
+#ifndef SPLINE_H
+#define SPLINE_H
+#include <vector>
+#include "TObject.h"
+#include "FitParameters.h"
+#include "stdint.h"
+#include "stdlib.h"
+#include "TCanvas.h"
+#include <list>
+#include "TF1.h"
+#include "TSpline.h"
+#include "SplineUtils.h"
+#include "TGraph2D.h"
+#include "TF2.h"
+
+#include "Math/Minimizer.h"
+#include "Math/Factory.h"
+#include "Math/Functor.h"
+#include "TH1D.h"
+#include "Math/IFunction.h"
+#include "Math/IParamFunction.h"
+#include "FitLogger.h"
+
+// Spline Class
+class Spline : public  ROOT::Math::ParamFunctor { 
+private:
+
+   const double* pars;
+ 
+public:
+   double DoEvalPar(const double* x, const double* p) const ;
+ 
+   unsigned int NDim() const{
+      return fNDim;
+   }
+   // ROOT::Math::IParametricFunctionMultiDim* Clone() const{
+   //    return new Spline(this->fName, this->fForm, this->fPoints);
+   // }
+ 
+   const double* Parameters() const{
+      return pars;
+   }
+ 
+   void SetParameters(const double* p){
+      pars = p;
+   }
+ 
+   unsigned int NPar() const{
+      return fNPar;
+   }
+ 
+  Spline(std::string splname, std::string form, std::string points);
+  ~Spline() {};
+
+  void Setup(int type, int ndim, int npar);
+
+  double operator()(const Double_t* x, const Double_t* par);
+  float operator()(const Float_t* x, const Float_t* par) const;
+
+  float DoEval(const Float_t* x, const Float_t* par) const;
+  float DoEval(const Float_t* par, bool checkresponse = true) const;
+
+  //  void FitCoeff(int n, double* x, double* y, double* par, bool draw);
+  void FitCoeff(std::vector< std::vector<double> > v, std::vector<double> w, float* coeff, bool draw);
+
+  inline std::string GetName(void) { return fName; };
+  inline int GetNDim(void) { return fNDim; };
+  inline int GetType(void) { return fType; };
+  inline int GetNPar(void) { return fNPar;  };
+  inline std::string GetForm() {return fForm;};
+
+  //void Reconfigure(double x);
+  void Reconfigure(float x, int index = 0);
+  void Reconfigure(std::string name, float x);
+
+   // Available Spline Functions
+  float Spline1DPol1(const Float_t* par) const;
+  float Spline1DPol2(const Float_t* par) const;
+  float Spline1DPol3(const Float_t* par) const;
+  float Spline1DPol4(const Float_t* par) const;
+  float Spline1DPol5(const Float_t* par) const;
+  float Spline1DPol6(const Float_t* par) const;
+  float Spline2DPol(const Float_t* par, int n) const;
+  float Spline2DGaus(const Float_t* par) const;
+
+  float Spline1DTSpline3(const Float_t* par) const;
+  float Spline2DTSpline3(const Float_t* par) const;
+
+
+  std::string fName;
+  int fType;
+  int fNDim;
+  int fNPar;
+  std::string fForm;
+  std::string fPoints;
+  bool fOutsideLimits;
+
+  std::vector<std::string> fSplitNames;
+  std::vector<std::string> fSplitPoints;
+
+  mutable std::vector<float> fVal;
+  mutable std::vector<float> fValMin;
+  mutable std::vector<float> fValMax;
+
+  mutable std::vector< std::vector<float> > fSplitScan;
+
+  mutable std::vector<float> fXScan;
+  mutable float fX;
+  mutable float fXMin;
+  mutable float fXMax;
+
+  mutable std::vector<float> fYScan;
+  mutable float fY;
+  mutable float fYMin;
+  mutable float fYMax;
+
+  int  fSplineOffset;
+
+  // TSpline3 Objects.
+  mutable std::vector<float>::iterator iter_low;
+  mutable std::vector<float>::iterator iter_high;
+  mutable int off;
+
+  // Create a new function for fitting.
+  ROOT::Math::Minimizer* minimizer;
+
+  TF1* fROOTFunction;
+  TF1* GetFunction();
+
+};
+
+
+namespace SplineUtils {
+
+  double Func2DWrapper(double* x, double* p);
+  extern Spline* gSpline;
+
+}
+
+
+
+namespace SplineUtils {
+
+// Spline List
+enum spline_types {
+  k1DPol1 = 1,
+  k1DPol2,
+  k1DPol3,
+  k1DPol4,
+  k1DPol5,
+  k1DPol6,
+  k1DPol1C,
+  k1DPol2C,
+  k1DPol3C,
+  k1DPol4C,
+  k1DPol5C,
+  k1DPol5C_LX,
+  k1DPol10,
+  k1DTSpline3,
+  k1DPol25,
+  k2DPol6,
+  k2DGaus,
+  k2DTSpline3
+};
+
+}
+
+#endif
diff --git a/src/Splines/SplineMerger.cxx b/src/Splines/SplineMerger.cxx
new file mode 100644
index 0000000..c4e2525
--- /dev/null
+++ b/src/Splines/SplineMerger.cxx
@@ -0,0 +1,96 @@
+#include "SplineMerger.h"
+
+void SplineMerger::AddSplineSetFromFile(TFile* file){
+
+  TTree* tr = (TTree*) file->Get("spline_reader");
+  std::vector<std::string>* tempspline = 0;
+  std::vector<std::string>* temptype = 0;
+  std::vector<std::string>* tempform = 0;
+  std::vector<std::string>* temppoints = 0;
+
+
+  // Loop over all splines and add a TString in the TTree for its inputs                                                                                            
+  tr->SetBranchAddress("Spline", &tempspline);
+  tr->SetBranchAddress("Type",   &temptype);
+  tr->SetBranchAddress("Form",   &tempform);
+  tr->SetBranchAddress("Points", &temppoints);
+  tr->GetEntry(0);
+
+  // Copy over                                                                                                                                                                                                                             
+  for (size_t i = 0; i < tempspline->size(); i++){
+    fSpline.push_back(tempspline->at(i));
+    fType.push_back(temptype->at(i));
+    fForm.push_back(tempform->at(i));
+    fPoints.push_back(temppoints->at(i));
+  }
+
+  delete tr;
+
+
+  // Now Get the coefficients setup.
+  //size_t index = fSplineTreeList.size();
+  fSplineTreeList.push_back( (TTree*) file->Get("spline_tree") );
+
+}
+
+void SplineMerger::SetupSplineSet(){
+
+  // Define NCoEff
+  fNCoEff = 0;
+  for (size_t i = 0; i < fSplineSizeList.size(); i++){
+    fNCoEff += fSplineSizeList[i];
+  }
+
+  // Define Storer
+  fCoEffStorer = new float[fNCoEff];
+
+  // Loop over each TTree and set spline address
+  int off = 0;
+  for (size_t i = 0; i < fSplineSizeList.size(); i++){
+    float* add = &(fCoEffStorer[off]);
+    TTree* tree = (fSplineTreeList[i]);
+    tree->SetBranchAddress("SplineCoeff", add);
+    off += fSplineSizeList[i];
+  }
+
+}
+
+
+void SplineMerger::GetEntry(int entry){
+  for (size_t i = 0; i < fSplineTreeList.size(); i++){
+    fSplineTreeList[i]->GetEntry(entry);
+  }
+}
+
+void SplineMerger::Write(std::string name){
+
+  // Create a TTree with each form and scan points in it.                                                                                                                                                                                  
+  TTree* tr = new TTree(name.c_str(), name.c_str());
+
+  // Loop over all splines and add a TString in the TTree for its inputs                                                                                                                                                                   
+  tr->Branch("Spline", &fSpline);
+  tr->Branch("Type", &fType);
+  tr->Branch("Form", &fForm);
+  tr->Branch("Points", &fPoints);
+  tr->Fill();
+  tr->Write();
+
+  delete tr;
+}
+
+void SplineMerger::AddCoefficientsToTree(TTree* tree){
+  tree->Branch("SplineCoeff", fCoEffStorer, Form("SplineCoeff[%d]/F", fNCoEff));
+}
+
+void SplineMerger::FillMergedSplines(int entry){
+  GetEntry(entry);
+
+  size_t count = 0;
+  for (size_t i = 0; i < fSplineSizeList.size(); i++){
+    for (size_t j = 0; j < (UInt_t)fSplineSizeList[i]; j++){
+      fCoEffStorer[count] = fSplineAddressList[i][j];
+      count++;
+    }
+  }
+}
+
diff --git a/src/Splines/SplineMerger.h b/src/Splines/SplineMerger.h
new file mode 100644
index 0000000..34dff97
--- /dev/null
+++ b/src/Splines/SplineMerger.h
@@ -0,0 +1,38 @@
+#ifndef SPLINEMerger_H
+#define SPLINEMerger_H
+
+#include "FitWeight.h"
+#include "Spline.h"
+#include "FitParameters.h"
+#include "SplineReader.h"
+
+class SplineMerger : public SplineReader {
+ public:
+  SplineMerger(){};
+  ~SplineMerger(){};
+
+  void AddSplineSetFromFile(TFile* file); 
+  void SetupSplineSet();
+
+  void Write(std::string name);
+  void AddCoefficientsToTree(TTree* tree);
+  void GetEntry(int entry);
+
+  void FillMergedSplines(int entry);
+
+  float* fCoEffStorer;
+  int fNCoEff;
+
+  std::vector< float[1000] > fSplineAddressList;
+  std::vector< int > fSplineSizeList;
+  std::vector< TTree* > fSplineTreeList;
+
+  std::vector< std::vector<double> > fParVect;
+  std::vector< int > fSetIndex;
+  std::vector< double > fWeightList;
+  std::vector< double > fValList;
+
+  
+};
+
+#endif
diff --git a/src/Splines/SplineReader.cxx b/src/Splines/SplineReader.cxx
new file mode 100644
index 0000000..dca7ebf
--- /dev/null
+++ b/src/Splines/SplineReader.cxx
@@ -0,0 +1,135 @@
+#include "SplineReader.h"
+
+
+// Spline reader should have access to every spline.
+// Should know when reconfigure is called what its limits are and adjust accordingly.
+// Then should pass it the index required in the stack as &xvals[index], and &pars[parindex]
+
+void SplineReader::AddSpline(nuiskey splinekey) {
+
+  // Read info from key
+  std::string splname     = splinekey.GetS("name");
+  std::string type        = splinekey.GetS("type");
+  std::string form        = splinekey.GetS("form");
+  std::string points      = splinekey.GetS("points");
+  std::string extrapolate = splinekey.GetS("extrapolate");
+
+  //  std::cout << "AddSpline " << splname << " " << type << " " << form << " " << points << std::endl;
+
+  // Add the spline to the list of all forms
+  fAllSplines.push_back( Spline(splname, form, points) );
+  fSpline.push_back(splname);
+  fType.push_back(type);
+  fForm.push_back(form);
+  fPoints.push_back(points);
+
+
+}
+
+
+void SplineReader::Read(TTree* tr) {
+
+  std::vector<std::string>* tempspline = 0;
+  std::vector<std::string>* temptype = 0;
+  std::vector<std::string>* tempform = 0;
+  std::vector<std::string>* temppoints = 0;
+
+
+  // Loop over all splines and add a TString in the TTree for its inputs
+  tr->SetBranchAddress("Spline", &tempspline);
+  tr->SetBranchAddress("Type",   &temptype);
+  tr->SetBranchAddress("Form",   &tempform);
+  tr->SetBranchAddress("Points", &temppoints);
+  tr->GetEntry(0);
+
+  // Copy over
+  for (size_t i = 0; i < tempspline->size(); i++){
+    fSpline.push_back(tempspline->at(i));
+    fType.push_back(temptype->at(i));
+    fForm.push_back(tempform->at(i));
+    fPoints.push_back(temppoints->at(i));
+  }
+
+  // Loop through and add splines from read type.
+  for (size_t i = 0; i < fSpline.size(); i++) {
+    LOG(SAM) << "Registering Input Spline " << fSpline[i] << " " << fForm[i] << " " << fPoints[i] << std::endl;
+    fAllSplines.push_back( Spline(fSpline[i], fForm[i], fPoints[i]) );
+  }
+}
+
+
+void SplineReader::Reconfigure(std::map< std::string, double >& vals) {
+
+  // std::cout << "NEW SPLINE READER =========" << std::endl;
+  for (std::map<std::string, double>::iterator iter = vals.begin(); 
+      iter != vals.end(); iter++){
+
+    // std::cout << "Found " << iter->first << " in map handed to reader." << std::endl;
+    for (size_t i = 0; i < fSpline.size(); i++){
+      // std::cout << "Passing it to : " << fSpline[i] << std::endl;
+      // if (!fSpline[i].compare(iter->first.c_str())){
+	      // std::cout << "Reconfiguring Value inside Reader to be " << fSpline[i] << " " << iter->second << std::endl;
+        fAllSplines[i].Reconfigure(iter->first, iter->second);
+      // }
+    }
+  }
+
+  fNeedsReconfigure = false;
+}
+
+bool SplineReader::NeedsReconfigure() {
+  return fNeedsReconfigure;
+}
+
+void SplineReader::SetNeedsReconfigure(bool val) {
+  fNeedsReconfigure = val;
+}
+
+double SplineReader::CalcWeight(float* coeffs) {
+
+  int off = 0;
+  double rw_weight = 1.0;
+
+  // Form Offset list
+  std::vector<int> offsets;
+  for (size_t i = 0; i < fAllSplines.size(); i++) {
+    offsets.push_back(off);
+    off +=  fAllSplines[i].GetNPar();
+  }
+
+  // #pragma omp parrallel for
+  for (size_t i = 0; i < fAllSplines.size(); i++) {
+
+    // std::cout << "Evaluating spline " << fAllSplines[i].GetName() << " at coeff offset " << off <<  "(" << coeffs << ")" << std::endl;
+    // for (int j = 0; j < fAllSplines[i].GetNPar(); j++){
+    // std::cout << "Coeff " << j+off << " " << coeffs[off+j] << std::endl;
+    // }
+
+    double w = fAllSplines[i].DoEval( &coeffs[offsets[i]] );
+    rw_weight *= w;
+    
+    // std::cout << "Spline RW Weight = " << rw_weight << " " << w << std::endl;
+  }
+
+  if (rw_weight <= 0.0) rw_weight = 1.0;
+  // std::cout << "Returning spline rw_weight = " << rw_weight << std::endl;
+
+  return rw_weight;
+}
+
+
+
+int SplineReader::GetNPar(){
+  int n = 0;
+  for (size_t i = 0; i < fAllSplines.size(); i++){
+    n += fAllSplines[i].GetNPar();
+  }
+  return n;
+}
+
+
+
+
+
+
+
diff --git a/src/Splines/SplineReader.h b/src/Splines/SplineReader.h
new file mode 100644
index 0000000..cc8ae28
--- /dev/null
+++ b/src/Splines/SplineReader.h
@@ -0,0 +1,39 @@
+#ifndef SPLINEREADER_H
+#define SPLINEREADER_H
+// #include "FitWeight.h"
+#include "Spline.h"
+#include "TTree.h"
+#include "FitLogger.h"
+// #include "GeneralUtils.h"
+
+class SplineReader {
+public:
+  SplineReader() {};
+  ~SplineReader() {};
+
+  void AddSpline(nuiskey splkey);
+  void Read(TTree* tr);
+
+  void Reconfigure(std::map< std::string, double >& vals);
+  bool NeedsReconfigure();
+  void SetNeedsReconfigure(bool val = true);
+
+  int GetNPar();
+  double CalcWeight(float* coeffs);
+
+  std::vector<Spline> fAllSplines;
+  std::vector<std::string> fSpline;
+  std::vector<std::string> fType;
+  std::vector<std::string> fForm;
+  std::vector<std::string> fPoints;
+
+  std::vector<double> fDialValues;
+  std::vector<double> fParValues;
+
+  bool fNeedsReconfigure;
+
+
+
+};
+
+#endif
diff --git a/src/Splines/SplineUtils.cxx b/src/Splines/SplineUtils.cxx
new file mode 100644
index 0000000..7b0c188
--- /dev/null
+++ b/src/Splines/SplineUtils.cxx
@@ -0,0 +1,111 @@
+#include "SplineUtils.h"
+
+
+// std::vector<int> SplineUtils::GetSplitDialPositions(FitWeight* rw, std::string names) {
+// 	std::vector<std::string> splitnames = GeneralUtils::ParseToStr(names, ";");
+// 	std::vector<int> splitpos;
+
+// 	for (size_t i = 0; i < splitnames.size(); i++) {
+// 		int pos = fRW->GetDialPos(splitnames[i]);
+// 		splitpos.push_back(pos);
+// 	}
+	
+// 	return splitpos;
+// }
+
+std::vector< std::vector<double> > SplineUtils::GetSplitDialPoints(std::string points) {
+
+	// Determine Type
+	std::vector<std::string> splittype = GeneralUtils::ParseToStr(points, ":");
+	std::string deftype = "";
+	if (splittype.size() == 1) {
+		deftype = "GRID";
+	} else if (splittype.size() > 1) {
+		deftype = splittype[0];
+		splittype.erase(splittype.begin());
+	} else {
+		throw;
+	}
+
+	// Make Grid
+	std::vector<std::vector<double> > gridpoints;
+
+	// Possible Point Types
+	if (!deftype.compare("GRID")) {
+
+		std::vector<std::string> splitpoints = GeneralUtils::ParseToStr(splittype[0], ";");
+
+		// CBA writing an ND iterator to build this grids. 1D, 2D, and 3D are below..
+		if (splitpoints.size() == 1) {
+			std::vector<double> tempcont = std::vector<double>(1, 0.0);
+			std::vector<double> tempsplit = GeneralUtils::ParseToDbl(splitpoints[0], ",");
+
+			for (size_t i = 0; i < tempsplit.size(); i++) {
+				tempcont[0] = tempsplit[i];
+				gridpoints.push_back(tempcont);
+			}
+
+			// 2D
+		} else if (splitpoints.size() == 2) {
+
+			std::vector<double> tempcont = std::vector<double>(2, 0.0);
+			std::vector<double> tempsplit1 = GeneralUtils::ParseToDbl(splitpoints[0],",");
+			std::vector<double> tempsplit2 = GeneralUtils::ParseToDbl(splitpoints[1],",");
+
+			for (size_t i = 0; i < tempsplit1.size(); i++) {
+				for (size_t j = 0; j < tempsplit2.size(); j++) {
+					tempcont[0] = tempsplit1[i];
+					tempcont[1] = tempsplit2[j];
+					gridpoints.push_back(tempcont);
+				}
+			}
+			// 3D
+		} else if (splitpoints.size() == 3) {
+
+			std::vector<double> tempcont = std::vector<double>(3, 0.0);
+			std::vector<double> tempsplit1 = GeneralUtils::ParseToDbl(splitpoints[0],",");
+			std::vector<double> tempsplit2 = GeneralUtils::ParseToDbl(splitpoints[1],",");
+			std::vector<double> tempsplit3 = GeneralUtils::ParseToDbl(splitpoints[2],",");
+
+			for (size_t i = 0; i < tempsplit1.size(); i++) {
+				for (size_t j = 0; j < tempsplit2.size(); j++) {
+					for (size_t k = 0; k < tempsplit3.size(); k++) {
+						tempcont[0] = tempsplit1[i];
+						tempcont[1] = tempsplit2[j];
+						tempcont[2] = tempsplit3[j];
+						gridpoints.push_back(tempcont);
+					}
+				}
+			}
+		}
+	} else if (!deftype.compare("DIAG2D")) {
+		std::vector<std::string> splitpoints = GeneralUtils::ParseToStr(splittype[0], ";");
+		
+		std::vector<double> tempcont = std::vector<double>(2, 0.0);
+		std::vector<double> tempsplit1 = GeneralUtils::ParseToDbl(splitpoints[0],",");
+
+		for (size_t i = 0; i < tempsplit1.size(); i++) {
+			tempcont[0] = tempsplit1[i];
+			tempcont[1] = 0.0;
+			gridpoints.push_back(tempcont);
+		}
+
+		for (size_t i = 0; i < tempsplit1.size(); i++) {
+			tempcont[0] = 0.0;
+			tempcont[1] = tempsplit1[i];
+			gridpoints.push_back(tempcont);
+		}
+		for (size_t i = 0; i < tempsplit1.size(); i++) {
+			tempcont[0] = tempsplit1[i];
+			tempcont[1] = tempsplit1[i];
+			gridpoints.push_back(tempcont);
+		}
+
+		for (size_t i = 0; i < tempsplit1.size(); i++) {
+			tempcont[0] = tempsplit1[i];
+			tempcont[1] = tempsplit1[ tempsplit1.size() - 1 - i];
+			gridpoints.push_back(tempcont);
+		}
+	}
+	return gridpoints;
+}
diff --git a/src/Splines/SplineUtils.h b/src/Splines/SplineUtils.h
new file mode 100644
index 0000000..45fdff4
--- /dev/null
+++ b/src/Splines/SplineUtils.h
@@ -0,0 +1,12 @@
+#ifndef SPLINE_UTILS_H
+#define SPLINE_UTILS_H
+
+//#include "FitWeight.h"
+#include "GeneralUtils.h"
+
+namespace SplineUtils {
+	//std::vector<int> GetSplitDialPositions(FitWeight* rw, std::string names);
+	std::vector< std::vector<double> > GetSplitDialPoints(std::string points);
+};
+
+#endif
diff --git a/src/Splines/SplineWriter.cxx b/src/Splines/SplineWriter.cxx
new file mode 100644
index 0000000..490c901
--- /dev/null
+++ b/src/Splines/SplineWriter.cxx
@@ -0,0 +1,772 @@
+#include "SplineWriter.h"
+using namespace SplineUtils;
+
+// Spline reader should have access to every spline.
+// Should know when reconfigure is called what its limits are and adjust accordingly.
+// Then should pass it the index required in the stack as &xvals[index], and &pars[parindex]
+
+void SplineWriter::Write(std::string name) {
+  // Create a TTree with each form and scan points in it.
+  TTree* tr = new TTree(name.c_str(), name.c_str());
+
+  // Loop over all splines and add a TString in the TTree for its inputs
+  tr->Branch("Spline", &fSpline);
+  tr->Branch("Type", &fType);
+  tr->Branch("Form", &fForm);
+  tr->Branch("Points", &fPoints);
+  tr->Fill();
+  tr->Write();
+
+  delete tr;
+}
+
+void SplineWriter::AddWeightsToTree(TTree* tr) {
+  // Add only the fitted spline coefficients to the ttree
+  std::cout << "Saving Spline Weights to TTree = " << Form("SplineWeights[%d]/F", (int)fValList.size()) << std::endl;
+  //  sleep(1);
+  tr->Branch("SplineWeights", fWeightList, Form("SplineWeights[%d]/D", (int)fValList.size()));
+}
+
+void SplineWriter::ReadWeightsFromTree(TTree* tr) {
+  tr->SetBranchAddress("SplineWeights", fWeightList);
+}
+
+
+void SplineWriter::AddCoefficientsToTree(TTree* tr) {
+  // Add only the fitted spline coefficients to the ttree
+  std::cout << "Saving Spline Coeff to TTree = " << Form("SplineCoeff[%d]/F", fNCoEff) << std::endl;
+  //  sleep(1);
+  tr->Branch("SplineCoeff", fCoEffStorer, Form("SplineCoeff[%d]/F", fNCoEff));
+}
+
+
+void SplineWriter::SetupSplineSet() {
+  std::cout << "Setting up spline set" << std::endl;
+  fDrawSplines = FitPar::Config().GetParB("draw_splines");
+  // Create the coefficients double*
+  fNCoEff = 0;
+  for (size_t i = 0; i < fAllSplines.size(); i++) {
+    fNCoEff += fAllSplines[i].GetNPar();
+  }
+  fCoEffStorer = new float[fNCoEff];
+
+  std::cout << "NCoeff = " << fNCoEff << std::endl;
+
+  // Calculate the grid of parsets
+  // Setup the list of parameter coefficients.
+  std::vector<double> nomvals = fRW->GetDialValues();
+  fParVect.clear();
+  fSetIndex.clear();
+
+  fParVect.push_back(nomvals);
+  fSetIndex.push_back(0);
+  // fWeightList.push_back(1.0);
+  fValList.push_back(std::vector<double>(1, 0.0));
+
+  // Loop over all splines.
+  for (size_t i = 0; i < fAllSplines.size(); i++) {
+
+    // For each dial loop over all points within a given position
+    std::vector<double> newvals = nomvals;
+
+    std::vector<int> pos;   // = SplineUtils::GetSplitDialPositions(fRW, fSpline[i]);
+    std::vector<std::string> splitnames = GeneralUtils::ParseToStr(fSpline[i], ";");
+
+    for (size_t j = 0; j < splitnames.size(); j++) {
+      int temppos = fRW->GetDialPos(splitnames[j]);
+      pos.push_back(temppos);
+    }
+
+    std::vector< std::vector<double> > vals = SplineUtils::GetSplitDialPoints(fPoints[i]);
+
+    for (size_t j = 0; j < vals.size(); j++) {
+
+      for (size_t k = 0; k < pos.size(); k++) {
+        newvals[ pos[k] ] = vals[j][k];
+      }
+      fParVect.push_back(newvals);
+      fValList.push_back(vals[j]);
+      // fWeightList.push_back(1.0);
+      fSetIndex.push_back(i + 1);
+    }
+  }
+
+  fWeightList = new double[fValList.size()];
+  for (int i = 0; i < fValList.size(); i++) {
+    fWeightList[i] = 1.0;
+  }
+
+  // Print out the parameter set
+  LOG(FIT) << "Parset | Index | Pars --- " << std::endl;
+  for (size_t i = 0; i < fSetIndex.size(); i++) {
+    LOG(FIT) << " Set " << i << ". | " << fSetIndex[i] << " | ";
+    if (LOG_LEVEL(FIT)) {
+      for (size_t j = 0; j < fParVect[i].size(); j++) {
+        std::cout << " " << fParVect[i][j];
+      }
+      std::cout << std::endl;
+    }
+  }
+}
+
+void SplineWriter::GetWeightsForEvent(FitEvent* event) {
+  // Get Starting Weight
+  fRW->SetAllDials(&fParVect[0][0], fParVect[0].size());
+  double nomweight = fRW->CalcWeight(event);
+  event->RWWeight = nomweight;
+
+  if (fDrawSplines) {
+    std::cout << "Nominal Spline Weight = " << nomweight << std::endl;
+  }
+  fWeightList[0] = nomweight;
+
+  // Loop over parameter sets
+  for (size_t i = 1; i < fParVect.size(); i++) {
+    // Update FRW
+    fRW->SetAllDials(&fParVect[i][0], fParVect[i].size());
+
+    // Calculate a weight for event
+    double weight = fRW->CalcWeight(event);
+
+
+    if (weight >= 0.0 and weight < 200) {
+      // Fill Weight Set
+      fWeightList[i] = weight / nomweight;
+      if (fDrawSplines) std::cout << "Calculating values from weight set " << i << " " << fParVect[i][0] << " = " << weight << " " << weight / nomweight << std::endl;
+    } else {
+      fWeightList[i] = 1.0;
+    }
+  }
+}
+
+void SplineWriter::GetWeightsForEvent(FitEvent* event, double* weights) {
+  // Get Starting Weight
+  fRW->SetAllDials(&fParVect[0][0], fParVect[0].size());
+  double nomweight = fRW->CalcWeight(event);
+  event->RWWeight = nomweight;
+
+  if (fDrawSplines) {
+    std::cout << "Nominal Spline Weight = " << nomweight << std::endl;
+  }
+  weights[0] = nomweight;
+
+  // Loop over parameter sets
+  for (size_t i = 1; i < fParVect.size(); i++) {
+    // Update FRW
+    fRW->SetAllDials(&fParVect[i][0], fParVect[i].size());
+
+    // Calculate a weight for event
+    double weight = fRW->CalcWeight(event);
+
+
+    if (weight >= 0.0 and weight < 200) {
+      // Fill Weight Set
+      weights[i] = weight / nomweight;
+      if (fDrawSplines) std::cout << "Calculating values from weight set " << i << " " << fParVect[i][0] << " = " << weight << " " << weight / nomweight << std::endl;
+    } else {
+      weights[i] = 1.0;
+    }
+    fWeightList[i] = weights[i];
+  }
+}
+
+void SplineWriter::ReconfigureSet(int iset){
+  fCurrentSet = iset;
+  fRW->SetAllDials(&fParVect[iset][0], fParVect[iset].size());
+}
+
+
+double SplineWriter::GetWeightForThisSet(FitEvent* event, int iset){
+  if (iset != -1 and iset != fCurrentSet){
+    ReconfigureSet(iset);
+  }
+  return fRW->CalcWeight(event);
+}
+
+void SplineWriter::SetWeights(double* weights){
+  for (int i = 0; i < fParVect.size(); i++){
+    fWeightList[i] = weights[i];
+  }
+}
+
+
+void SplineWriter::FitSplinesForEvent(double* inputweights, float* coeff) {
+
+  int n = fAllSplines.size();
+  int coeffcount = 0;
+
+  for (int i = 0; i < n; i++) {
+
+    // DialVals
+    std::vector<std::vector<double> > dialvals;
+    std::vector<double> weightvals;
+    bool hasresponse = false;
+
+    for (size_t j = 0; j <  fSetIndex.size(); j++) {
+      if (fSetIndex[j] != i + 1) continue;
+
+      dialvals.push_back(fValList[j]);
+      double tempw = inputweights[j];
+      weightvals.push_back(tempw);
+
+      if (tempw != 1.0) hasresponse = true;
+    }
+
+    // Perform Fit
+    if (hasresponse) {
+      // std::cout << "Fitting Coeff" << std::endl;
+      FitCoeff(&fAllSplines[i], dialvals, weightvals, &coeff[coeffcount], fDrawSplines);
+    } else {
+      for (int j = 0; coeffcount + j < fNCoEff; j++) {
+        // std::cout << "Setting 0.0 response " << coeffcount + i << " " << fNCoEff <<  std::endl;
+        coeff[coeffcount + j] = 0.0;
+      }
+    }
+
+    // std::cout << "Adding coeffcount" << std::endl;
+    // Offset coeffcount
+    coeffcount += (fAllSplines[i]).GetNPar();
+  }
+// std::cout << "FitEvent" << std::endl;
+  return;
+}
+
+
+void SplineWriter::FitSplinesForEvent(TCanvas * fitcanvas, bool saveplot) {
+
+  // Loop over splines
+  //  int count = 0;
+  int coeffcount = 0;
+  int n = fAllSplines.size();
+
+  std::vector<int> splinecounter;
+  for (int i = 0; i < n; i++) {
+    splinecounter.push_back(coeffcount);
+    coeffcount += fAllSplines[i].GetNPar();
+  }
+
+  //  #pragma omp parallel for
+  for (int i = 0; i < n; i++) {
+
+    // Store X/Y Vals
+    std::vector<std::vector<double> > dialvals;
+    std::vector<double> weightvals;
+    bool hasresponse = false;
+    int npar = (fAllSplines[i]).GetNPar();
+    coeffcount = splinecounter[i];
+
+    for (size_t j = 0; j <  fSetIndex.size(); j++) {
+      if (fSetIndex[j] != i + 1) continue;
+
+      dialvals.push_back(fValList[j]);
+      double tempw = fWeightList[j];
+      weightvals.push_back(tempw);
+
+      if (tempw != 1.0) hasresponse = true;
+    }
+
+    // Make a new graph and fit coeff if response
+    if (hasresponse) {
+      FitCoeff(&fAllSplines[i], dialvals, weightvals, &fCoEffStorer[coeffcount], fDrawSplines);
+    } else {
+      for (int i = 0; i < npar; i++) {
+        fCoEffStorer[coeffcount + i] = 0.0;
+      }
+    }
+  }
+
+
+// Check overrides
+// if (saveplot) {
+//   coeffcount = 0;
+
+//   // Make new canvas to save stuff into
+//   if (fitcanvas) delete fitcanvas;
+//   fitcanvas = new TCanvas("c1", "c1", fAllSplines.size() * 400 , 600);
+//   fitcanvas->Divide(fAllSplines.size(), 1);
+
+//   // Clear out points
+//   for (size_t i = 0; i < fAllDrawnGraphs.size(); i++) {
+//     if (fAllDrawnGraphs[i]) delete fAllDrawnGraphs[i];
+//     if (fAllDrawnHists[i]) delete fAllDrawnHists[i];
+//   }
+//   fAllDrawnGraphs.clear();
+//   fAllDrawnHists.clear();
+
+
+//   for (size_t i = 0; i < fAllSplines.size(); i++) {
+
+//     fitcanvas->cd(i + 1);
+
+//     // Store X/Y Vals
+//     std::vector<std::vector<double> > dialvals;
+//     std::vector<double> weightvals;
+//     bool hasresponse = false;
+//     int npar = (fAllSplines[i]).GetNPar();
+
+//     for (size_t j = 0; j <  fSetIndex.size(); j++) {
+//       if ((UInt_t)fSetIndex[j] != (UInt_t)i + 1) continue;
+//       dialvals.push_back(fValList[j]);
+//       weightvals.push_back(fWeightList[j] - 0.0);
+//       if (fWeightList[j] != 1.0) hasresponse = true;
+//     }
+
+//     if (hasresponse) {
+
+//       TGraph* gr = new TGraph(dialvals.size(), dialvals, weightvals);
+//       fAllDrawnGraphs.push_back(gr);
+
+//       // Get XMax Min
+//       int n = xvals.size();
+//       double xmin = 99999.9;
+//       double xmax = -99999.9;
+//       for (int j = 0; j < n; j++) {
+//         if (xvals[j] > xmax) xmax = xvals[j];
+//         if (xvals[j] < xmin) xmin = xvals[j];
+//       }
+
+//       TH1D* hist = new TH1D("temp", "temp", 100, xmin, xmax);
+//       fAllDrawnHists.push_back(hist);
+
+//       for (int k = 0; k < 100; k++) {
+//         double xtemp = hist->GetXaxis()->GetBinCenter(k + 1);
+//         fAllSplines[i].Reconfigure(xtemp);
+//         double ytemp = fAllSplines[i].DoEval(&fCoEffStorer[coeffcount]);
+//         hist->SetBinContent(k + 1, ytemp);
+//       }
+
+//       // gr->Draw("APL");
+//       hist->SetLineColor(kRed);
+//       hist->Draw("HIST C");
+//       hist->SetTitle("Spline Response");
+//       // hist->GetYaxis()->SetRangeUser(0.0, 3.0);
+
+//       // gStyle->SetOptStat(0);
+//       hist->SetStats(0);
+//       gr->SetMarkerStyle(20);
+//       gr->SetTitle("True Weight Points");
+//       gr->Draw("P SAME");
+//       gPad->BuildLegend(0.6, 0.6, 0.85, 0.85);
+//       gPad->Update();
+
+//       hist->SetTitle(fSpline[i].c_str());
+//       hist->GetXaxis()->SetTitle("Dial Variation");
+//       hist->GetYaxis()->SetTitle("Event Weight");
+//       fitcanvas->Update();
+//     }
+//     coeffcount += npar;
+//   }
+// }
+}
+
+
+
+
+// Fitting
+// ----------------------------------------------
+void SplineWriter::FitCoeff(Spline * spl, std::vector< std::vector<double> >& v, std::vector<double>& w, float * coeff, bool draw) {
+
+  std::vector<double> x;
+  std::vector<double> y;
+  std::vector<double> z;
+  for (size_t i = 0; i < v.size(); i++) {
+    x.push_back(v[i][0]);
+    if (v[i].size() > 1) y.push_back(v[i][1]);
+    if (v[i].size() > 2) z.push_back(v[i][2]);
+  }
+
+  switch (spl->GetType()) {
+
+  // Polynominal Graph Fits
+  case k1DPol1:
+  case k1DPol2:
+  case k1DPol3:
+  case k1DPol4:
+  case k1DPol5:
+  case k1DPol6:
+
+
+
+    FitCoeff1DGraph(spl, v.size(), &x[0], &w[0], coeff, draw);
+    break;
+
+  case k1DTSpline3:
+
+    GetCoeff1DTSpline3(spl, x.size(), &x[0], &w[0], coeff, draw);
+    break;
+
+  case k2DPol6:
+  case k2DGaus:
+  case k2DTSpline3:
+    FitCoeff2DGraph(spl, v.size(), &x[0], &y[0], &w[0], coeff, draw);
+    break;
+
+  default:
+    break;
+  }
+
+  if (fDrawSplines){
+    fSplineFCNs[spl] = new SplineFCN(spl, v, w);
+    fSplineFCNs[spl]->SaveAs("mysplinetest_" + spl->GetName() + ".pdf", coeff);
+    sleep(1);
+    delete fSplineFCNs[spl];
+  }
+
+}
+
+void SplineWriter::FitCoeff1DGraph(Spline * spl, int n, double * x, double * y, float * coeff, bool draw) {
+
+  TGraph* gr = new TGraph(n, x, y);
+  double xmin = 99999.9;
+  double xmax = -99999.9;
+  for (int i = 0; i < n; i++) {
+    if (x[i] > xmax) xmax = x[i];
+    if (x[i] < xmin) xmin = x[i];
+  }
+
+  double xwidth = xmax - xmin;
+  xmin = xmin - xwidth * 0.01;
+  xmax = xmax + xwidth * 0.01;
+
+  // Create a new function for fitting.
+  TF1* func = spl->GetFunction(); 
+
+  // Run the actual spline fit
+  StopTalking();
+
+  
+  // If linear fit with two points
+  if (n == 2 and spl->GetType() == k1DPol1) {
+
+    float m = (y[1] - y[0]) / (x[1] - x[0]);
+    float c = y[0] - (0.0 - x[0]) * m;
+
+    func->SetParameter(0, c);
+    func->SetParameter(1, m);
+
+  } else if (spl->GetType() == k1DPol1) {
+    gr->Fit(func, "WQ");
+  } else {
+    gr->Fit(func, "FMWQ");
+  }
+  
+
+  StartTalking();
+
+  for (int i = 0; i < spl->GetNPar(); i++) {
+    coeff[i] = func->GetParameter(i);
+  }
+
+  if (draw) {
+    gr->Draw("APL");
+    gPad->Update();
+    gPad->SaveAs(("plot_test_" + spl->GetName() + ".pdf").c_str());
+    std::cout << "Saving Graph" << std::endl;
+    sleep(3);
+  }
+
+  // delete func;
+  delete gr;
+}
+
+double SplineFCN::operator()(const double * x) const {
+  return DoEval(x);
+}
+
+double SplineFCN::DoEval(const double * x) const {
+
+  float* fx = new float[fSpl->GetNPar()];
+  for (int i = 0; i < fSpl->GetNPar(); i++) {
+    fx[i] = x[i];
+  }//
+
+  double tot = 0;
+  for (size_t i = 0; i < fVal.size(); i++) {
+
+    int nonzero = 0;
+    for (size_t j = 0; j < fVal[i].size(); j++) {
+      fSpl->Reconfigure(fVal[i][j], j);
+      // std::cout << "Reconfiguring " << fVal[i][j] << " " << j << std::endl;
+      if (fVal[i][j] != 0.0) nonzero++;
+    }
+    if (uncorrelated and nonzero > 1) continue;
+
+    double w = fSpl->DoEval(fx);
+    double wdif = (w - fWeight[i]);// / (fWeight[i] * 0.05);
+    tot += sqrt(wdif * wdif);
+  }
+
+  // delete fx;
+
+  return tot;
+}
+
+void SplineFCN::UpdateWeights(std::vector<double>& w) {
+  for (int i = 0; i < w.size(); i++) {
+    fWeight[i] = w[i];
+  }
+}
+
+void SplineFCN::SetCorrelated(bool state) {
+  uncorrelated = !state;
+}
+
+
+
+void SplineFCN::SaveAs(std::string name, const float * fx) {
+
+
+  if (fVal[0].size() > 2) {
+    TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
+    c1->Divide(2, 1);
+    TH1D* histmc = new TH1D("hist", "hist", fVal.size(), 0.0, double(fVal.size()));
+    TH1D* histdt = new TH1D("histdt", "histdt", fVal.size(), 0.0, double(fVal.size()));
+
+    for (size_t i = 0; i < fVal.size(); i++) {
+      for (size_t j = 0; j < fVal[i].size(); j++) {
+        fSpl->Reconfigure(fVal[i][j], j);
+      }
+
+      histmc->SetBinContent( i + 1, fSpl->DoEval(fx) );
+      histdt->SetBinContent( i + 1, fWeight[i] );
+    }
+
+    // histmc->Add(histdt,-1.0);
+
+    c1->cd(1);
+    histmc->SetTitle("Spline;Parameter Set;Weight");
+    histmc->Draw("HIST");
+    histdt->SetLineColor(kRed);
+    histdt->Draw("SAME HIST");
+
+    c1->cd(2);
+    TH1D* histdif = (TH1D*) histmc->Clone();
+    histdif->Add(histdt, -1.0);
+    histdif->Draw("HIST");
+
+    c1->Update();
+    c1->SaveAs(name.c_str());
+    delete c1;
+  } else if (fVal[0].size() == 2){
+
+    TGraph2D* histmc = new TGraph2D();
+    TGraph2D* histdt = new TGraph2D();
+    TGraph2D* histdif = new TGraph2D();
+
+    for (size_t i = 0; i < fVal.size(); i++) {
+      for (size_t j = 0; j < fVal[i].size(); j++) {
+        fSpl->Reconfigure(fVal[i][j], j);
+      }
+
+      histmc->SetPoint(histmc->GetN(), fVal[i][0], fVal[i][1], fSpl->DoEval(fx));
+      histdt->SetPoint(histdt->GetN(), fVal[i][0], fVal[i][1], fWeight[i]);
+      histdif->SetPoint(histdif->GetN(), fVal[i][0], fVal[i][1], fabs(fSpl->DoEval(fx) - fWeight[i]));
+
+
+    }
+    TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
+    c1->Divide(3, 1);
+    c1->cd(1);
+    histmc->SetTitle(("Spline;" + fSpl->GetName()).c_str());
+    histmc->Draw("COLZ");
+    gPad->Update();
+    c1->cd(2);
+    histdt->SetTitle(("Raw;" + fSpl->GetName()).c_str());
+    histdt->Draw("COLZ");
+    c1->cd(3);
+    histdif->SetTitle(("Dif;" + fSpl->GetName()).c_str());
+    histdif->Draw("COLZ");
+    gPad->SetRightMargin(0.15);
+    // gPad->SetLogz(1);
+
+    gPad->Update();
+    c1->SaveAs(name.c_str());
+    delete c1;
+  } else if (fVal[0].size() == 1){
+    
+    TGraph* histmc = new TGraph();
+    TGraph* histdt = new TGraph();
+    TGraph* histdif = new TGraph();
+
+    for (size_t i = 0; i < fVal.size(); i++) {
+      for (size_t j = 0; j < fVal[i].size(); j++) {
+        fSpl->Reconfigure(fVal[i][j], j);
+      }
+
+      histmc->SetPoint(histmc->GetN(), fVal[i][0], fSpl->DoEval(fx));
+      histdt->SetPoint(histdt->GetN(), fVal[i][0], fWeight[i]);
+      histdif->SetPoint(histdif->GetN(), fVal[i][0], fabs(fSpl->DoEval(fx) - fWeight[i]));
+
+    }
+    TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);
+    c1->Divide(2, 1);
+    c1->cd(1);
+    histmc->SetTitle(("Spline;" + fSpl->GetName()).c_str());
+    histmc->Draw("AC");
+    histmc->SetLineColor(kRed);
+
+    histdt->SetTitle(("Raw;" + fSpl->GetName()).c_str());
+    histdt->Draw("SAME P");
+    histdt->SetMarkerStyle(20);
+    gPad->Update();
+
+    c1->cd(2);
+    histdif->SetTitle(("Dif;" + fSpl->GetName()).c_str());
+    histdif->Draw("APL");
+ 
+    gPad->Update();
+    c1->SaveAs(name.c_str());
+    delete c1;
+
+  }
+
+
+
+
+  // gPad->SaveAs(name.c_str());
+}
+
+
+
+void SplineWriter::FitCoeff2DGraph(Spline * spl, int n, double * x, double * y, double * w, float * coeff, bool draw) {
+
+  #pragma omp critical
+  {
+
+  TF2* f2 = (TF2*) spl->GetFunction();
+
+  TGraph2D* histmc = new TGraph2D(n, x, y, w);
+  f2->SetNpx(400);
+
+  StopTalking();
+  histmc->Fit(f2, "FMWQ");
+  StartTalking();
+  
+  for (int i = 0; i < spl->GetNPar(); i++) {
+    coeff[i] = f2->GetParameter(i);
+  }
+
+  // delete f2;
+  delete histmc;
+  }
+}
+
+
+void SplineWriter::FitCoeffNDGraph(Spline * spl, std::vector< std::vector<double> >& v, std::vector<double>& w, float * coeff, bool draw) {
+
+  if (fSplineFunctors.find(spl) != fSplineFunctors.end()) {
+    delete fSplineFunctors[spl];
+    fSplineFunctors.erase(spl);
+  }
+
+  if (fSplineFCNs.find(spl) != fSplineFCNs.end()) {
+    delete fSplineFCNs[spl];
+    fSplineFCNs.erase(spl);
+  }
+
+  if (fSplineMinimizers.find(spl) != fSplineMinimizers.end()) {
+    delete fSplineMinimizers[spl];
+    fSplineMinimizers.erase(spl);
+  }
+
+
+  if  (fSplineMinimizers.find(spl) == fSplineMinimizers.end()) {
+    std::cout << "Building new ND minimizer for " << spl << std::endl;
+    fSplineFCNs[spl] = new SplineFCN(spl, v, w);
+
+    // fSplineFCNs[spl] = new SplineFCN(spl, v, w);
+    fSplineFunctors[spl] = new ROOT::Math::Functor( *fSplineFCNs[spl], spl->GetNPar() );
+    fSplineMinimizers[spl] = ROOT::Math::Factory::CreateMinimizer("Minuit2", "Combined");
+    fSplineMinimizers[spl]->SetMaxFunctionCalls(1E8);
+    fSplineMinimizers[spl]->SetMaxIterations(1E8);
+    fSplineMinimizers[spl]->SetTolerance(1.E-6);
+    fSplineMinimizers[spl]->SetStrategy(2);
+
+    for (int j = 0; j < spl->GetNPar(); j++) {
+        fSplineMinimizers[spl]->SetVariable(j, Form("Par_%i", j), 0.1, 0.1);
+    }
+  }
+  // Create a new function for fitting.
+  // StopTalking();
+
+  // Update FCN
+  fSplineFCNs[spl]->UpdateWeights(w);
+  // fSplineMinimizers[spl]->SetDefaultOptions();
+  // fSplineMinimizers[spl]->Clear();
+  for (int j = 0; j < spl->GetNPar(); j++) {
+    if (j != 0) {
+      fSplineMinimizers[spl]->SetVariableValue(j, 0.1);
+      // fSplineMinimizers[spl]->SetParameter(j, Form("Par_%i", j), 0.1, 0.1, -100.0, 100.0 );
+
+      // fSplineMinimizers[spl]->SetVariableValue(j, 0.1);
+    }
+  }
+  // fSplineFCNs[spl]->SetCorrelated(false);
+  // fSplineFunctors[spl] = new ROOT::Math::Functor( *fSplineFCNs[spl], spl->GetNPar() );
+  // fSplineMinimizers[spl]->SetFunction(*fSplineFunctors[spl]);
+  // fSplineMinimizers[spl]->Minimize();
+
+  fSplineFCNs[spl]->SetCorrelated(true);
+  delete fSplineFunctors[spl];
+  fSplineFunctors[spl] = new ROOT::Math::Functor( *fSplineFCNs[spl], spl->GetNPar() );
+  fSplineMinimizers[spl]->SetFunction(*fSplineFunctors[spl]);
+  // ((TFitterMinuit*)fSplineMinimizers[spl])->CreateMinimizer(TFitterMinuit::kMigrad);
+  fSplineMinimizers[spl]->Minimize();
+  fSplineMinimizers[spl]->Minimize();
+
+  // ((TFitterMinuit*)fSplineMinimizers[spl])->CreateMinimizer(TFitterMinuit::kMigrad);
+  // fSplineMinimizers[spl]->Minimize();
+
+  // delete minimizer;
+  // StartTalking();
+
+  // Now Get Parameters
+  const double *values = fSplineMinimizers[spl]->X();
+  for (int i = 0; i < spl->GetNPar(); i++) {
+
+    std::cout << "Updated Coeff " << i << " " << values[i] << std::endl;
+    coeff[i] = values[i];
+  }
+
+  // Save a sample
+  fSplineFCNs[spl]->SaveAs("mysplinetest_" + spl->GetName() + ".pdf", coeff);
+  sleep(1);
+
+  // delete values;
+  // delete minimizer;
+}
+
+
+
+// Spline extraction Functions
+void SplineWriter::GetCoeff1DTSpline3(Spline * spl, int n, double * x, double * y, float * coeff, bool draw) {
+
+  StopTalking();
+  TSpline3 temp_spline = TSpline3("temp_spline", x, y, n);
+  StartTalking();
+
+  for (size_t i = 0; i < (UInt_t)n; i++) {
+
+    double a, b, c, d, e;
+    temp_spline.GetCoeff(i, a, b, c, d, e);
+
+    coeff[i * 4]   = y[i];
+    coeff[i * 4 + 1] = c;
+    coeff[i * 4 + 2] = d;
+    coeff[i * 4 + 3] = e;
+
+  }
+
+  if (draw) {
+    TGraph* gr = new TGraph(n, x, y);
+    temp_spline.Draw("CA");
+    gr->Draw("PL SAME");
+    gPad->Update();
+    gPad->SaveAs(("plot_test_" + spl->GetName() + ".pdf").c_str());
+
+    delete gr;
+  }
+
+  return;
+}
+
diff --git a/src/Splines/SplineWriter.h b/src/Splines/SplineWriter.h
new file mode 100644
index 0000000..9943442
--- /dev/null
+++ b/src/Splines/SplineWriter.h
@@ -0,0 +1,87 @@
+#ifndef SPLINEWRITER_H
+#define SPLINEWRITER_H
+#include "FitWeight.h"
+#include "Spline.h"
+#include "FitParameters.h"
+#include "SplineUtils.h"
+#include "TFitterMinuit.h"
+
+class SplineFCN {
+public:
+
+  SplineFCN(Spline* spl, std::vector<std::vector<double> > v, std::vector<double> w) { fSpl = spl; fVal = v; fWeight = w; };
+  ~SplineFCN() {};
+
+  double operator()(const double* x) const;
+  double DoEval(const double *x) const;
+  void SaveAs(std::string name, const float* fx);
+  void UpdateWeights(std::vector<double>& w);
+  void SetCorrelated(bool state = true);
+
+  bool uncorrelated;
+  std::vector< std::vector<double> > fVal;
+  std::vector< double > fWeight;
+  Spline* fSpl;
+
+};
+
+
+class SplineWriter : public SplineReader {
+public:
+  SplineWriter(FitWeight* fw) {
+    fRW = fw;
+    fDrawSplines = FitPar::Config().GetParB("drawsplines");
+  };
+  ~SplineWriter() {};
+
+  void SetupSplineSet();
+  void Write(std::string name);
+  void AddCoefficientsToTree(TTree* tree);
+  void FitSplinesForEvent(TCanvas* fitcanvas = NULL, bool saveplot = false);
+  void AddWeightsToTree(TTree* tr);
+  void ReadWeightsFromTree(TTree* tr);
+  void FitSplinesForEvent(double* weightvals, float* coeff);
+
+  void GetWeightsForEvent(FitEvent* event, double* weights);
+  void GetWeightsForEvent(FitEvent* event);
+  void ReconfigureSet(int iset);
+  double GetWeightForThisSet(FitEvent* event, int iset=-1);
+  void SetWeights(double* weights);
+
+  inline int GetNWeights(){return fParVect.size();};
+  inline int GetNPars(){ return fNCoEff;};
+
+  int fNCoEff;
+  //  double* fCoEffStorer;
+  float* fCoEffStorer;
+
+  std::vector< std::vector<double> > fParVect;
+  std::vector< int > fSetIndex;
+  double* fWeightList;
+  std::vector< std::vector<double> > fValList;
+  int fCurrentSet;
+  FitWeight* fRW;
+  bool fDrawSplines;
+
+  std::vector<TH1D*> fAllDrawnHists;
+  std::vector<TGraph*> fAllDrawnGraphs;
+
+  std::map<Spline*, SplineFCN*> fSplineFCNs;
+  std::map<Spline*, ROOT::Math::Functor*> fSplineFunctors;
+  std::map<Spline*, ROOT::Math::Minimizer*> fSplineMinimizers;
+  //  Spline* gSpline;
+
+  // Available Fitting Functions
+  void FitCoeff(Spline* spl, std::vector< std::vector<double> >& v, std::vector<double>& w, float* coeff, bool draw);
+  void FitCoeff1DGraph(Spline* spl, int n, double* x, double* y, float* coeff, bool draw);
+  void GetCoeff1DTSpline3(Spline* spl, int n, double* x, double* y, float* coeff, bool draw);
+  // void FitCoeff2DGraph(Spline* spl, std::vector< std::vector<double> >& v, std::vector<double>& w, float* coeff, bool draw);
+  void FitCoeffNDGraph(Spline* spl, std::vector< std::vector<double> >& v, std::vector<double>& w, float* coeff, bool draw);
+  void FitCoeff2DGraph(Spline* spl,  int n,  double* x,  double* y,  double* w, float* coeff, bool draw);
+  //double Func2DWrapper(double* x, double* p);
+
+};
+
+
+
+#endif
diff --git a/src/Splines/allsplines_mb.xml b/src/Splines/allsplines_mb.xml
new file mode 100644
index 0000000..ec94e7c
--- /dev/null
+++ b/src/Splines/allsplines_mb.xml
@@ -0,0 +1,60 @@
+<nuisance>
+
+<!-- Example Card File for spline generation -->
+<!-- Should be run with
+$ nuissplines -c allsplines_mb.xml -f GenerateEventSplines
+-->
+
+<!-- Parameter Defintion: Need to set starting points here and tell fitweight what type each dial is.. Can include extra fixed dials. -->
+<!-- CCQE -->
+<parameter name="NXSec_VecFFCCQE" nominal="2.0" type="t2k_parameter" /> <!-- FIXED -->
+<parameter name="NXSec_AxlFFCCQE" nominal="0.0" type="t2k_parameter" /> <!-- FIXED -->
+
+<parameter name="NXSec_MaCCQE"      nominal="0.0" type="t2k_parameter"     />
+<parameter name="NIWGMEC_Norm_C12"  nominal="0.0" type="t2k_parameter" />
+<parameter name="NIWG_rpaCCQE_norm" nominal="1.0" type="t2k_parameter"/> <!-- FIXED -->
+<parameter name="NIWG2014a_pF_C12"  nominal="0.0" type="t2k_parameter" />
+
+<!-- RES -->
+<parameter name="NXSec_MaNFFRES"  nominal="0.0" type="t2k_parameter"/>
+<parameter name="NXSec_CA5RES"    nominal="0.0" type="t2k_parameter"/>
+<parameter name="NXSec_BgSclRES"  nominal="0.0" type="t2k_parameter"/>
+
+<!-- FSI -->
+<parameter name="NCasc_FrAbs_pi"      nominal="0.0" type="t2k_parameter"/>
+<parameter name="NCasc_FrInelLow_pi"  nominal="0.0" type="t2k_parameter"/>
+<parameter name="NCasc_FrCExLow_pi"   nominal="0.0" type="t2k_parameter"/>
+<parameter name="NCasc_FrInelHigh_pi" nominal="0.0" type="t2k_parameter"/>
+<parameter name="NCasc_FrCExHigh_pi"  nominal="0.0" type="t2k_parameter"/>
+<parameter name="NCasc_FrPiProd_pi"   nominal="0.0" type="t2k_parameter"/>
+
+
+<!-- Spline Definition : Names must match those given in the parameter list -->
+<!-- CCQE -->
+<spline name="NXSec_MaCCQE"     form="1DTSpline3" points="-5.0,-3.0,-1.0,0.0,1.0,3.0,5.0" />
+<spline name="NIWGMEC_Norm_C12" form="1DTPol1"    points="-1.0,0.0,1.0,3.0,5.0"           />
+<spline name="NIWG2014a_pF_C12" form="1DTSpline3" points="-5.0,-3.0,-1.0,0.0,1.0,3.0,5.0" />
+
+<!-- RES -->
+<spline name="NXSec_MaNFFRES"  form="1DTSpline3" points="-5.0,-3.0,-1.0,0.0,1.0,3.0,5.0" />
+<spline name="NXSec_CA5RES"    form="1DTSpline3" points="-5.0,-3.0,-1.0,0.0,1.0,3.0,5.0" />
+<spline name="NXSec_BgSclRES"  form="1DTSpline3" points="-5.0,-3.0,-1.0,0.0,1.0,3.0,5.0" />
+
+<!-- FSI -->
+<spline name="NCasc_FrAbs_pi"      form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+<spline name="NCasc_FrInelLow_pi"  form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+<spline name="NCasc_FrCExLow_pi"   form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+<spline name="NCasc_FrInelHigh_pi" form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+<spline name="NCasc_FrCExHigh_pi"  form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+<spline name="NCasc_FrPiProd_pi"   form="1DTSpline3" points="-2.0,-1.0,0.0,1.0,2.0"/>
+
+
+<!-- Setup Event Inputs and ouputs -->
+<events input="NEUT:/data/stowell/NIWG/NuisanceEvents/Winter2016/neut/MB_numu_fhc_trunk_merge.root" output="largesplineset_mb.root" />
+
+
+<!-- Draw Splines : When set to 1 GenerateEventSplines will pause every event and generate a set of plots for that event.
+     its a pretty crude validation system. Will put something better in place soon. -->
+<config drawsplines="1"/>
+
+</nuisance>
diff --git a/src/Splines/bnl_splines.xml b/src/Splines/bnl_splines.xml
new file mode 100644
index 0000000..be42d04
--- /dev/null
+++ b/src/Splines/bnl_splines.xml
@@ -0,0 +1,20 @@
+<nuisance>
+
+<!-- Parameter Nominal Set Definition -->
+<parameter name="VecFFCCQE"  type="neut_parameter"  nominal="2"   /> <!--FIXED-->
+<parameter name="AxlFFCCQE"  type="neut_parameter"  nominal="0"   /> <!--FIXED-->
+<parameter name="MaCCQE"     type="neut_parameter"  nominal="0.0" low="-3.0" high="3.0" step="0.20"/>
+<parameter name="CA5RES"     type="neut_parameter"  nominal="0.0" low="-3.0" high="3.0" step="0.20"/>
+<parameter name="MaNFFRES"   type="neut_parameter"  nominal="0.0" low="-3.0" high="3.0" step="0.20"/>
+<parameter name="BgSclRES"   type="neut_parameter"  nominal="0.0" low="-3.0" high="3.0" step="0.20"/>
+
+<!-- Spline Definition -->
+<spline name="MaCCQE"     form="1DTSpline3" points="-3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0" />
+<spline name="CA5RES"     form="1DTSpline3" points="-3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0" />
+<spline name="MaNFFRES"   form="1DTSpline3" points="-3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0" />
+<spline name="BgSclRES"   form="1DTSpline3" points="-3.0,-2.0,-1.5,-1.0,-0.5,0.0,0.5,1.0,1.5,2.0,3.0" />
+
+<!-- Event I/O Definition -->
+<events input="NEUT:/home/stowell/DataStorage/NEUT/freenucleons_dipole_neut_trunk_NUISANCE_BNL_fhc_numu_D2_numu.root" output="bnl_neut_splines.root" />
+
+</nuisance>
diff --git a/src/Splines/make1dsplinereport.py b/src/Splines/make1dsplinereport.py
new file mode 100644
index 0000000..60530e7
--- /dev/null
+++ b/src/Splines/make1dsplinereport.py
@@ -0,0 +1,58 @@
+from ROOT import *
+import sys
+
+
+c1 = TCanvas("c1","c1",900,300)
+c1.Divide(3,1)
+
+infile = TFile(sys.argv[1],"READ")
+maxn = len(infile.GetListOfKeys())
+print maxn
+
+for i, key in enumerate(infile.GetListOfKeys()):
+    if ("Paramater_Set" not in key.GetName()): continue
+
+    gStyle.SetOptTitle(1)
+
+    c1.cd(1)
+    parset = infile.Get(key.GetName())
+    parset.SetTitle(key.GetName().replace("_"," "))
+    parset.Draw()
+
+    c1.cd(2)
+    weightscan.Draw(key.GetName().replace("Paramater","RawWeights") + " >> temphist")
+    weighthist = temphist.Clone("weighthist")
+    temphist.Delete()
+    del temphist
+
+    weightscan.Draw(key.GetName().replace("Paramater","SplineWeights") + " >> temphist")
+    splinehist = temphist.Clone("splinehist")
+    temphist.Delete()
+    del temphist
+
+    splinehist.SetLineColor(kRed)
+    weighthist.SetTitle("Raw Weights")
+    splinehist.SetTitle("Spline Weights")
+    weighthist.Draw()
+    splinehist.Draw("SAME")
+    gPad.BuildLegend()
+    weighthist.SetTitle("Event Weights")
+    gPad.SetLogy(1)
+    gPad.Update()
+
+    c1.cd(3)
+    weightscan.Draw(key.GetName().replace("Paramater","DifWeights") + " >> temphist")
+    difhist = temphist.Clone("difhist")
+    temphist.Delete()
+    del temphist
+    
+    difhist.SetTitle("Difference")
+    difhist.Draw("HIST")
+    gPad.SetLogy(1)
+    gPad.Update()
+
+    if (i == 0): savestring = (sys.argv[1].replace(".root.splinetest.1DEventScan.root","_splinetest_1DEventScan.pdf("))
+    elif (i == (maxn)-2): savestring = (sys.argv[1].replace(".root.splinetest.1DEventScan.root","_splinetest_1DEventScan.pdf)"))
+    else: savestring = (sys.argv[1].replace(".root.splinetest.1DEventScan.root","_splinetest_1DEventScan.pdf"))
+
+    c1.SaveAs(savestring)
diff --git a/src/T2K/CMakeLists.txt b/src/T2K/CMakeLists.txt
index b61cea6..88d6e4f 100644
--- a/src/T2K/CMakeLists.txt
+++ b/src/T2K/CMakeLists.txt
@@ -1,86 +1,91 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(IMPLFILES
 T2K_CC0pi_XSec_2DPcos_nu.cxx
 T2K_CC1pip_CH_XSec_1DQ2_nu.cxx
 T2K_CC1pip_CH_XSec_1DWrec_nu.cxx
 T2K_CC1pip_CH_XSec_1Dpmu_nu.cxx
 T2K_CC1pip_CH_XSec_1Dppi_nu.cxx
 T2K_CC1pip_CH_XSec_1Dq3_nu.cxx
 T2K_CC1pip_CH_XSec_1Dthmupi_nu.cxx
 T2K_CC1pip_CH_XSec_1Dthpi_nu.cxx
 T2K_CC1pip_CH_XSec_1Dthq3pi_nu.cxx
 T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.cxx
 T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx
 T2K_CC1pip_H2O_XSec_1Dcosmu_nu.cxx
 T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.cxx
 T2K_CC1pip_H2O_XSec_1Dcospi_nu.cxx
 T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx
 T2K_CC1pip_H2O_XSec_1Dppi_nu.cxx
 T2K_CC0pinp_STV_XSec_1Ddpt_nu.cxx
+T2K_CC0pi_XSec_2DPcos_nu_nonuniform.cxx
 T2K_SignalDef.cxx
 )
 
 set(HEADERFILES
 T2K_CC0pi_XSec_2DPcos_nu.h
 T2K_CC1pip_CH_XSec_1DQ2_nu.h
 T2K_CC1pip_CH_XSec_1DWrec_nu.h
 T2K_CC1pip_CH_XSec_1Dpmu_nu.h
 T2K_CC1pip_CH_XSec_1Dppi_nu.h
 T2K_CC1pip_CH_XSec_1Dq3_nu.h
 T2K_CC1pip_CH_XSec_1Dthmupi_nu.h
 T2K_CC1pip_CH_XSec_1Dthpi_nu.h
 T2K_CC1pip_CH_XSec_1Dthq3pi_nu.h
 T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h
 T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h
 T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h
 T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h
 T2K_CC1pip_H2O_XSec_1Dcospi_nu.h
 T2K_CC1pip_H2O_XSec_1Dpmu_nu.h
 T2K_CC1pip_H2O_XSec_1Dppi_nu.h
 T2K_CC0pinp_STV_XSec_1Ddpt_nu.h
+T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h
 T2K_SignalDef.h
 )
 
 set(LIBNAME expT2K)
 
 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(${RWENGINE_INCLUDE_DIRECTORIES})
 
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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/T2K/T2K_CC0pi_XSec_2DPcos_nu.cxx b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.cxx
index 65da088..e1ed1d0 100644
--- a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.cxx
+++ b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.cxx
@@ -1,254 +1,275 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "T2K_SignalDef.h"
 
 #include "T2K_CC0pi_XSec_2DPcos_nu.h"
 
-T2K_CC0pi_XSec_2DPcos_nu::T2K_CC0pi_XSec_2DPcos_nu(std::string name,
-						   std::string inputfile,
-						   FitWeight *rw,
-						   std::string type){
 
-  fName = name;
-  if (fName == "T2K_CC0pi_XSec_2DPcos_nu_I") fAnalysis = 1;
+
+//********************************************************************
+T2K_CC0pi_XSec_2DPcos_nu::T2K_CC0pi_XSec_2DPcos_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC0pi_XSec_2DPcos_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Medium Energy FHC numu  \n" \
+                        "Signal: CC-inclusive with theta < 20deg \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("P_{#mu} (GeV)");
+  fSettings.SetYTitle("cos#theta_{#mu}");
+  fSettings.SetZTitle("d^{2}#sigma/dP_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)");
+  fSettings.SetAllowedTypes("DIAG,FULL/FREE,SHAPE,FIX/SYSTCOV/STATCOV","FIX");
+  fSettings.SetEnuRange(0.0, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+ if (fName == "T2K_CC0pi_XSec_2DPcos_nu_I") fAnalysis = 1;
   else fAnalysis = 2;
 
-  forwardgoing = (type.find("REST") != std::string::npos);
-  EnuMin = 0;
-  EnuMax = 10.0;
-  fBeamDistance = 0.280;
-  fDefaultTypes = "FIX";
-  fAllowedTypes = "DIAG,FULL/FREE,SHAPE,FIX/SYSTCOV/STATCOV";
-  fNDataPointsX = 12;
-  fNDataPointsY = 10;
-  Measurement2D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-  fIsSystCov = type.find("SYSTCOV") != std::string::npos;
-  fIsStatCov = type.find("STATCOV") != std::string::npos;
-  fIsNormCov = type.find("NORMCOV") != std::string::npos;
 
-  fPlotTitles = "; P_{#mu} (GeV); cos#theta_{#mu}; d^{2}#sigma/dP_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)";
-  SetHistograms();
-  SetupDefaultHist();
+  // CCQELike plot information
+  fSettings.SetTitle("T2K_CC0pi_XSec_2DPcos_nu");
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Diagonal covar setup
-  if (!fIsShape) fAddNormPen = true;
-  fNormError = 0.089; // Set from covar mat instead...
+  forwardgoing = (fSettings.GetS("type").find("REST") != std::string::npos);
 
-  // Get Scaling
-  fScaleFactor = ((GetEventHistogram()->Integral("width")/(fNEvents+0.)) * 1E-38 /
-		  (TotalIntegratedFlux()));
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = ((GetEventHistogram()->Integral("width")/(fNEvents+0.)) * 1E-38 / (TotalIntegratedFlux()));
+
+  // Setup Histograms
+  SetHistograms();
+  StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, fMapHist, 1E-38);
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
 };
 
 
 bool T2K_CC0pi_XSec_2DPcos_nu::isSignal(FitEvent *event){
   return SignalDef::isT2K_CC0pi(event, EnuMin, EnuMax, forwardgoing);
 };
 
 void T2K_CC0pi_XSec_2DPcos_nu::FillEventVariables(FitEvent* event){
 
   if (event->NumFSParticle(13) == 0)
     return;
 
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
 
   double pmu = Pmu.Vect().Mag()/1000.;
   double CosThetaMu = cos(Pnu.Vect().Angle(Pmu.Vect()));
 
   fXVar = pmu;
   fYVar = CosThetaMu;
 
   return;
 };
 
 // Modification is needed after the full reconfigure to move bins around
 // Otherwise this would need to be replaced by a TH2Poly which is too awkward.
 void T2K_CC0pi_XSec_2DPcos_nu::ConvertEventRates(){
 
   // Do standard conversion.
   Measurement2D::ConvertEventRates();
 
   if (fAnalysis == 1){
 
     // Following code handles weird ND280 Binning
     int nbins = this->fMCHist->GetNbinsX() + 1;
     double total = 0.0;
 
     // Y = 1
     total = 0.0;
     for (int i = 3; i < nbins; i++){
 
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(1);
       total += this->fMCHist->GetBinContent(i, 1) * width;
       this->fMCHist->SetBinContent(i,1,0);
     }
     this->fMCHist->SetBinContent(3, 1, total / (1.0 * 29.6));
 
     // Y = 2
     total = 0.0;
     for (int i = 5; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(2);
       total += this->fMCHist->GetBinContent(i, 2)* width;
       this->fMCHist->SetBinContent(i,2,0);
     }
     this->fMCHist->SetBinContent(5, 2, total / (0.6 *29.4));
 
     // Y = 3
     total = 0.0;
     for (int i = 7; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(3);
       total += this->fMCHist->GetBinContent(i, 3)* width;
       this->fMCHist->SetBinContent(i, 3,0);
     }
     this->fMCHist->SetBinContent(7, 3, total/ (0.1 * 29.2));
 
     // Y = 4
     total = 0.0;
     for (int i = 7; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(4);
       total += this->fMCHist->GetBinContent(i, 4)* width;
       this->fMCHist->SetBinContent(i, 4,0);
     }
     this->fMCHist->SetBinContent(7, 4, total / (0.1 * 29.2));
 
     // Y = 5
     total = 0.0;
     for (int i = 8; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(5);
       total += this->fMCHist->GetBinContent(i, 5)* width;
       this->fMCHist->SetBinContent(i,5,0);
     }
     this->fMCHist->SetBinContent(8, 5, total / (0.05 * 29.0));
 
     // Y = 6
     total = 0.0;
     for (int i = 9; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(6);
       total += this->fMCHist->GetBinContent(i, 6)* width;
       this->fMCHist->SetBinContent(i, 6,0);
     }
     this->fMCHist->SetBinContent(9, 6, total / (0.05 * 28.5));
 
     // Y = 7
     total = 0.0;
     for (int i = 8; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(7);
       total += this->fMCHist->GetBinContent(i, 7)* width;
       this->fMCHist->SetBinContent(i, 7,0);
     }
     this->fMCHist->SetBinContent(8, 7, total/ (0.04 * 28.0));
 
     // Y = 8
     total = 0.0;
     for (int i = 11; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(8);
       total += this->fMCHist->GetBinContent(i, 8)* width;
       this->fMCHist->SetBinContent(i, 8,0);
     }
     this->fMCHist->SetBinContent(11, 8, total / (0.4 * 27.0));
 
     // Y = 9
     total = 0.0;
     for (int i = 9; i < nbins; i++){
       double width = this->fMCHist->GetXaxis()->GetBinWidth(i) * this->fMCHist->GetYaxis()->GetBinWidth(9);
       total += this->fMCHist->GetBinContent(i, 9)* width;
       this->fMCHist->SetBinContent(i,9,0);
     }
     this->fMCHist->SetBinContent(9, 9, total / (0.02 * 25.0));
   }
 
   return;
 }
 
 
 void T2K_CC0pi_XSec_2DPcos_nu::SetHistograms(){
 
+  fIsSystCov = fSettings.GetS("type").find("SYSTCOV") != std::string::npos;
+  fIsStatCov = fSettings.GetS("type").find("STATCOV") != std::string::npos;
+  fIsNormCov = fSettings.GetS("type").find("NORMCOV") != std::string::npos;
+  fNDataPointsX = 12;
+  fNDataPointsY = 10;
+
   // Open file
   std::string infile = FitPar::GetDataBase()+"/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root";
   TFile* rootfile = new TFile(infile.c_str(), "READ");
-  TH2D* tempcov;
+  TH2D* tempcov = NULL;
 
   // ANALYSIS 2
   if (fAnalysis == 2){
 
     // Get Data
     fDataHist = (TH2D*) rootfile->Get("analysis2_data");
     fDataHist->SetDirectory(0);
     fDataHist->SetNameTitle((fName + "_data").c_str(),
 			    (fName + "_data" + fPlotTitles).c_str());
 
     // Get Map
     fMapHist = (TH2I*) rootfile->Get("analysis2_map");
     fMapHist->SetDirectory(0);
     fMapHist->SetNameTitle((fName + "_map").c_str(),
 			    (fName + "_map" + fPlotTitles).c_str());
 
     // Get Syst/Stat Covar
     TH2D* tempsyst = (TH2D*) rootfile->Get("analysis2_systcov");
     TH2D* tempstat = (TH2D*) rootfile->Get("analysis2_statcov");
     TH2D* tempnorm = (TH2D*) rootfile->Get("analysis2_normcov");
 
     // Create covar [Default is both]
     tempcov = (TH2D*) tempsyst->Clone();
     tempcov->Reset();
 
     if (fIsSystCov) tempcov->Add(tempsyst);
     if (fIsStatCov) tempcov->Add(tempstat);
     if (fIsNormCov) tempcov->Add(tempnorm);
 
     if (!fIsSystCov && !fIsStatCov && !fIsNormCov){
       tempcov->Add(tempsyst);
       tempcov->Add(tempstat);
       tempcov->Add(tempnorm);
     }
 
     // SARAS ANALYSIS
   } else if (fAnalysis == 1){
 
     //TODO (P.Stowell) Add a TH2Poly Measurement class
-    ERR(FTL) << "T2K CC0Pi Analysis 1 is not yet available due to its awkward binning!" << endl;
-    ERR(FTL) << "If you want to use it, add a TH2Poly Class!" << endl;
+    ERR(FTL) << "T2K CC0Pi Analysis 1 is not yet available due to its awkward binning!" << std::endl;
+    ERR(FTL) << "If you want to use it, add a TH2Poly Class!" << std::endl;
     throw;
 
   }
 
+  if (!tempcov){
+    ERR(FTL) << "TEMPCOV NOT SET" << std::endl;
+    throw;
+  }
 
   // Setup Covar
   int nbins = tempcov->GetNbinsX();
   fFullCovar = new TMatrixDSym(nbins);
 
   for (int i = 0; i < nbins; i++){
     for (int j = 0; j < nbins; j++){
 
       (*fFullCovar)(i,j) = tempcov->GetBinContent(i+1,j+1);
 
     }
   }
   covar = StatUtils::GetInvert(fFullCovar);
   fDecomp = StatUtils::GetDecomp(covar);
 
   // Set Data Errors
   StatUtils::SetDataErrorFromCov(fDataHist, fFullCovar, fMapHist, 1E-38);
 
   // Remove root file
   rootfile->Close();
   return;
 };
diff --git a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h
index 0dee264..a856cef 100644
--- a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h
+++ b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h
@@ -1,67 +1,67 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 #ifndef T2K_CC0PI_2DPCOS_NU_H_SEEN
 #define T2K_CC0PI_2DPCOS_NU_H_SEEN
 
 #include "Measurement2D.h"
 
 class T2K_CC0pi_XSec_2DPcos_nu : public Measurement2D {
 public:
 
   /// Basic Constructor.
   /// /brief Parses two different measurements.
   ///
   /// T2K_CC0pi_XSec_2DPcos_nu    -> T2K CC0PI Analysis 2
   /// T2K_CC0pi_XSec_2DPcos_nu_I  -> T2K CC0PI Analysis 1
   /// T2K_CC0pi_XSec_2DPcos_nu_II -> T2K CC0PI Analysis 2
-  T2K_CC0pi_XSec_2DPcos_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type);
+  T2K_CC0pi_XSec_2DPcos_nu(nuiskey samplekey);
 
   /// Virtual Destructor
   ~T2K_CC0pi_XSec_2DPcos_nu() {};
 
   /// Numu CC0PI Signal Definition
   ///
   /// /item 
   bool isSignal(FitEvent *nvect);
 
   /// Read histograms in a special way because format is different.
   /// Read from FitPar::GetDataBase()+"/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root"
   void SetHistograms();
 
   /// Bin Tmu CosThetaMu
   void FillEventVariables(FitEvent* customEvent);
 
   /// Have to do a weird event scaling for analysis 1
   void ConvertEventRates();
 
  private:
 
   bool forwardgoing;
   bool only_allowed_particles;
   bool numu_event;
   double numu_energy;
   int particle_pdg;
   double pmu, CosThetaMu;
   int fAnalysis;
 
   bool fIsSystCov, fIsStatCov, fIsNormCov;
   
 };
   
 #endif
diff --git a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.cxx b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.cxx
new file mode 100644
index 0000000..9f83362
--- /dev/null
+++ b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.cxx
@@ -0,0 +1,210 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#include "T2K_SignalDef.h"
+
+#include "T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h"
+
+
+
+//********************************************************************
+T2K_CC0pi_XSec_2DPcos_nu_nonuniform::T2K_CC0pi_XSec_2DPcos_nu_nonuniform(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC0pi_XSec_2DPcos_nu_nonuniform sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Medium Energy FHC numu  \n" \
+                        "Signal: CC-inclusive with theta < 20deg \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("P_{#mu} (GeV)");
+  fSettings.SetYTitle("cos#theta_{#mu}");
+  fSettings.SetZTitle("d^{2}#sigma/dP_{#mu}dcos#theta_{#mu} (cm^{2}/GeV)");
+  fSettings.SetAllowedTypes("FULL,DIAG/FREE,SHAPE,FIX/SYSTCOV/STATCOV","FIX/FULL");
+  fSettings.SetEnuRange(0.0, 10.0);
+  fSettings.DefineAllowedTargets("C,H");
+
+  fAnalysis = 1;
+ 
+
+  // CCQELike plot information
+  fSettings.SetTitle("T2K_CC0pi_XSec_2DPcos_nu_nonuniform");
+  fSettings.DefineAllowedSpecies("numu");
+
+  forwardgoing = (fSettings.GetS("type").find("REST") != std::string::npos);
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = ((GetEventHistogram()->Integral("width")/(fNEvents+0.)) * 1E-38 / (TotalIntegratedFlux()));
+
+  // Setup Histograms
+  SetHistograms();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
+};
+
+
+bool T2K_CC0pi_XSec_2DPcos_nu_nonuniform::isSignal(FitEvent *event){
+  return SignalDef::isT2K_CC0pi(event, EnuMin, EnuMax, forwardgoing);
+};
+
+void T2K_CC0pi_XSec_2DPcos_nu_nonuniform::FillEventVariables(FitEvent* event){
+
+  if (event->NumFSParticle(13) == 0)
+    return;
+
+  TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
+  TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
+
+  double pmu = Pmu.Vect().Mag()/1000.;
+  double CosThetaMu = cos(Pnu.Vect().Angle(Pmu.Vect()));
+
+  fXVar = pmu;
+  fYVar = CosThetaMu;
+
+  return;
+};
+
+void T2K_CC0pi_XSec_2DPcos_nu_nonuniform::FillHistograms(){
+
+  Measurement1D::FillHistograms();
+  if (Signal){
+    fMCHist_Fine2D->Fill( fXVar, fYVar, Weight );
+    FillMCSlice( fXVar, fYVar, Weight );
+
+  }
+
+}
+
+
+// Modification is needed after the full reconfigure to move bins around
+// Otherwise this would need to be replaced by a TH2Poly which is too awkward.
+void T2K_CC0pi_XSec_2DPcos_nu_nonuniform::ConvertEventRates(){
+
+  // Do standard conversion.
+  Measurement1D::ConvertEventRates();
+
+  // First scale MC slices also by their width in Y
+  fMCHist_Slices[0]->Scale(1.0 / 1.00);
+  fMCHist_Slices[1]->Scale(1.0 / 0.60);
+  fMCHist_Slices[2]->Scale(1.0 / 0.10);
+  fMCHist_Slices[3]->Scale(1.0 / 0.10);
+  fMCHist_Slices[4]->Scale(1.0 / 0.05);
+  fMCHist_Slices[5]->Scale(1.0 / 0.05);
+  fMCHist_Slices[6]->Scale(1.0 / 0.04);
+  fMCHist_Slices[7]->Scale(1.0 / 0.04);
+  fMCHist_Slices[8]->Scale(1.0 / 0.02);
+
+
+  // Now Convert into 1D list
+  fMCHist->Reset();
+  int bincount = 0;
+  for (int i = 0; i < 9; i++){
+    for (int j = 0; j < fDataHist_Slices[i]->GetNbinsX(); j++){
+      fMCHist->SetBinContent(bincount+1, fMCHist_Slices[i]->GetBinContent(j+1));
+      bincount++;
+    }
+  }
+
+  return;
+}
+
+void T2K_CC0pi_XSec_2DPcos_nu_nonuniform::FillMCSlice(double x, double y, double w){
+
+  if (y >= -1.0 and y < 0.0) fMCHist_Slices[0]->Fill(x,w);
+  else if (y >= 0.0 and y < 0.6) fMCHist_Slices[1]->Fill(x,w);
+  else if (y >= 0.6 and y < 0.7) fMCHist_Slices[2]->Fill(x,w);
+  else if (y >= 0.7 and y < 0.8) fMCHist_Slices[3]->Fill(x,w);
+  else if (y >= 0.8 and y < 0.85) fMCHist_Slices[4]->Fill(x,w);
+  else if (y >= 0.85 and y < 0.90) fMCHist_Slices[5]->Fill(x,w);
+  else if (y >= 0.90 and y < 0.94) fMCHist_Slices[6]->Fill(x,w);
+  else if (y >= 0.94 and y < 0.98) fMCHist_Slices[7]->Fill(x,w);
+  else if (y >= 0.98 and y <= 1.00) fMCHist_Slices[8]->Fill(x,w);
+}
+
+
+void T2K_CC0pi_XSec_2DPcos_nu_nonuniform::SetHistograms(){
+
+  // Read in 1D Data Histograms
+  fInputFile = new TFile( (FitPar::GetDataBase() + "/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root").c_str(),"READ");
+  fInputFile->ls();
+  
+  // Read in 1D Data
+  fDataHist = (TH1D*) fInputFile->Get("datahist");
+
+  fMCHist_Fine2D = new TH2D("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_Fine2D","T2K_CC0pi_XSec_2DPcos_nu_nonuniform_Fine2D", 400, 0.0,30.0,100,-1.0,1.0);
+  SetAutoProcessTH1(fMCHist_Fine2D);
+  
+  TH2D* tempcov = (TH2D*) fInputFile->Get("analysis1_totcov");
+
+  fFullCovar = new TMatrixDSym(fDataHist->GetNbinsX());
+  for (int i = 0; i < fDataHist->GetNbinsX(); i++){
+    for (int j = 0; j < fDataHist->GetNbinsX(); j++){
+      (*fFullCovar)(i,j) = tempcov->GetBinContent(i+1, j+1);
+    }
+  }
+  covar = StatUtils::GetInvert(fFullCovar);
+  fDecomp = StatUtils::GetDecomp(fFullCovar);
+  
+  // Read in 2D Data
+  fDataPoly = (TH2Poly*) fInputFile->Get("datapoly");
+  fDataPoly->SetNameTitle("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_datapoly","T2K_CC0pi_XSec_2DPcos_nu_nonuniform_datapoly");
+  SetAutoProcessTH1(fDataPoly, kCMD_Write);
+  fDataHist->Reset();
+
+  // Read in 2D Data Slices and Make MC Slices
+  int bincount = 0;
+  for (int i = 0; i < 9; i++){
+  
+    // Get Data Histogram
+    fInputFile->ls();
+    fDataHist_Slices.push_back((TH1D*)fInputFile->Get(Form("dataslice_%i",i))->Clone());
+    fDataHist_Slices[i]->SetNameTitle(Form("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_data_Slice%i",i),
+				      (Form("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_data_Slice%i",i)));
+
+    // Loop over nbins and set errors from covar
+    for (int j = 0; j < fDataHist_Slices[i]->GetNbinsX(); j++){
+      fDataHist_Slices[i]->SetBinError(j+1, sqrt((*fFullCovar)(bincount,bincount)) * 1E-38);
+
+      std::cout << "Setting data hist " <<  fDataHist_Slices[i]->GetBinContent(j+1) << " " << fDataHist_Slices[i]->GetBinError(j+1) << std::endl;
+      fDataHist->SetBinContent(bincount+1, fDataHist_Slices[i]->GetBinContent(j+1) );
+      fDataHist->SetBinError(bincount+1, fDataHist_Slices[i]->GetBinError(j+1) );
+
+      bincount++;
+    }
+
+    // Make MC Clones
+    fMCHist_Slices.push_back((TH1D*) fDataHist_Slices[i]->Clone());
+    fMCHist_Slices[i]->SetNameTitle(Form("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_MC_Slice%i",i),
+                                      (Form("T2K_CC0pi_XSec_2DPcos_nu_nonuniform_MC_Slice%i",i)));
+
+    SetAutoProcessTH1(fDataHist_Slices[i],kCMD_Write);
+    SetAutoProcessTH1(fMCHist_Slices[i]);
+    //    fMCHist_Slices[i]->Reset();
+  }
+  
+  return;
+};
diff --git a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h
similarity index 68%
copy from src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h
copy to src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h
index 0dee264..e3b2d00 100644
--- a/src/T2K/T2K_CC0pi_XSec_2DPcos_nu.h
+++ b/src/T2K/T2K_CC0pi_XSec_2DPcos_nu_nonuniform.h
@@ -1,67 +1,82 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-#ifndef T2K_CC0PI_2DPCOS_NU_H_SEEN
-#define T2K_CC0PI_2DPCOS_NU_H_SEEN
+#ifndef T2K_CC0PI_2DPCOS_NU_NONUNIFORM_H_SEEN
+#define T2K_CC0PI_2DPCOS_NU_NONUNIFORM_H_SEEN
 
-#include "Measurement2D.h"
+#include "Measurement1D.h"
+#include "TH2Poly.h"
 
-class T2K_CC0pi_XSec_2DPcos_nu : public Measurement2D {
+class T2K_CC0pi_XSec_2DPcos_nu_nonuniform : public Measurement1D {
 public:
 
   /// Basic Constructor.
   /// /brief Parses two different measurements.
   ///
-  /// T2K_CC0pi_XSec_2DPcos_nu    -> T2K CC0PI Analysis 2
-  /// T2K_CC0pi_XSec_2DPcos_nu_I  -> T2K CC0PI Analysis 1
-  /// T2K_CC0pi_XSec_2DPcos_nu_II -> T2K CC0PI Analysis 2
-  T2K_CC0pi_XSec_2DPcos_nu(std::string name, std::string inputfile, FitWeight *rw, std::string type);
+  /// T2K_CC0pi_XSec_2DPcos_nu_nonuniform    -> T2K CC0PI Analysis 2
+  /// T2K_CC0pi_XSec_2DPcos_nu_nonuniform_I  -> T2K CC0PI Analysis 1
+  /// T2K_CC0pi_XSec_2DPcos_nu_nonuniform_II -> T2K CC0PI Analysis 2
+  T2K_CC0pi_XSec_2DPcos_nu_nonuniform(nuiskey samplekey);
 
   /// Virtual Destructor
-  ~T2K_CC0pi_XSec_2DPcos_nu() {};
+  ~T2K_CC0pi_XSec_2DPcos_nu_nonuniform() {};
 
   /// Numu CC0PI Signal Definition
   ///
   /// /item 
   bool isSignal(FitEvent *nvect);
 
   /// Read histograms in a special way because format is different.
   /// Read from FitPar::GetDataBase()+"/T2K/CC0pi/T2K_CC0PI_2DPmuCosmu_Data.root"
   void SetHistograms();
 
   /// Bin Tmu CosThetaMu
   void FillEventVariables(FitEvent* customEvent);
 
+  // Fill Histograms
+  void FillHistograms();
+
   /// Have to do a weird event scaling for analysis 1
   void ConvertEventRates();
 
  private:
 
   bool forwardgoing;
   bool only_allowed_particles;
   bool numu_event;
   double numu_energy;
   int particle_pdg;
   double pmu, CosThetaMu;
   int fAnalysis;
 
   bool fIsSystCov, fIsStatCov, fIsNormCov;
+
+  TH2Poly* fDataPoly;
+  TH2Poly* fMCPoly;
+
+  TFile* fInputFile;
+  TH2D* fMCHist_Fine2D;
+
+  std::vector<TH1D*> fMCHist_Slices;
+  std::vector<TH1D*> fDataHist_Slices;
+
+  void FillMCSlice(double x, double y, double w);
   
 };
   
 #endif
diff --git a/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.cxx b/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.cxx
index af433c2..0673030 100644
--- a/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.cxx
+++ b/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.cxx
@@ -1,63 +1,80 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "T2K_SignalDef.h"
 
 #include "T2K_CC0pinp_STV_XSec_1Ddpt_nu.h"
 
+
 //********************************************************************
-T2K_CC0pinp_STV_XSec_1Ddpt_nu::T2K_CC0pinp_STV_XSec_1Ddpt_nu(
-    std::string inputfile, FitWeight *rw, std::string type,
-    std::string fakeDataFile)
+T2K_CC0pinp_STV_XSec_1Ddpt_nu::T2K_CC0pinp_STV_XSec_1Ddpt_nu(nuiskey samplekey) {
 //********************************************************************
-{
-  fName = "T2K_CC0pinp_STV_XSec_1Ddpt_nu";
-  fDefaultTypes = "FIX/DIAG/CHI2";
-  fPlotTitles =
-      "; #delta#it{p}_{T} (GeV c^{-1}); #frac{d#sigma}{d#delta#it{p}_{T}} "
-      "(cm^{2} neutron^{-1} GeV^{-1} c)";
-  EnuMin = 0;
-  EnuMax = 50;
-  fIsDiag = true;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
 
-  SetDataValues(GeneralUtils::GetTopLevelDir() +
-                "/data/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.dat");
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC0pinp_STV_XSec_1Ddpt_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: MINERvA Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("#delta#it{p}_{T} (GeV c^{-1})");
+  fSettings.SetYTitle("#frac{d#sigma}{d#delta#it{p}_{T}} (cm^{2} neutron^{-1} GeV^{-1} c)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 50.0);
+  fSettings.DefineAllowedTargets("C,H");
 
-  fDataHist->Scale(1E-38);
-  fDataTrue->Scale(1E-38);
+  // CCQELike plot information
+  fSettings.SetTitle("T2K_CC0pinp_STV_XSec_1Ddpt_nu");
+  fSettings.SetDataInput(  GeneralUtils::GetTopLevelDir() + "/data/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.dat");
+  fSettings.DefineAllowedSpecies("numu");
 
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
   fScaleFactor = GetEventHistogram()->Integral("width") * double(1E-38) *
-                (13.0 / 6.0 /*Data is /neutron */) /
-                (double(fNEvents) * TotalIntegratedFlux("width"));
+                 (13.0 / 6.0 /*Data is /neutron */) /
+                 (double(fNEvents) * TotalIntegratedFlux("width"));
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromTextFile( fSettings.GetDataInput() );
+  ScaleData(1E-38);
+  SetCovarFromDiagonal();
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
+
+
+
 void T2K_CC0pinp_STV_XSec_1Ddpt_nu::FillEventVariables(FitEvent *event) {
   fXVar = FitUtils::Get_STV_dpt(event, 14, true) / 1000.0;
   return;
 };
 
 //********************************************************************
 bool T2K_CC0pinp_STV_XSec_1Ddpt_nu::isSignal(FitEvent *event)
 //********************************************************************
 {
   return SignalDef::isT2K_CC0pi_STV(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.h b/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.h
index 5acc0ae..51e61dd 100644
--- a/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.h
+++ b/src/T2K/T2K_CC0pinp_STV_XSec_1Ddpt_nu.h
@@ -1,36 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef T2K_CC0pinp_STV_XSec_1Ddpt_nu_H_SEEN
 #define T2K_CC0pinp_STV_XSec_1Ddpt_nu_H_SEEN
 
 #include "Measurement1D.h"
 
 class T2K_CC0pinp_STV_XSec_1Ddpt_nu : public Measurement1D {
 public:
-  T2K_CC0pinp_STV_XSec_1Ddpt_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC0pinp_STV_XSec_1Ddpt_nu(nuiskey samplekey);
   virtual ~T2K_CC0pinp_STV_XSec_1Ddpt_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.cxx b/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.cxx
index c49baf4..b56e2b7 100644
--- a/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.cxx
+++ b/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.cxx
@@ -1,134 +1,156 @@
 #include "T2K_CC1pip_CH_XSec_1Dpmu_nu.h"
 #include <iomanip>
 
-// The constructor
-T2K_CC1pip_CH_XSec_1Dpmu_nu::T2K_CC1pip_CH_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "T2K_CC1pip_CH_XSec_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV/c); d#sigma/dp_{#mu} (cm^{2}/(GeV/c)/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+T2K_CC1pip_CH_XSec_1Dpmu_nu::T2K_CC1pip_CH_XSec_1Dpmu_nu(nuiskey samplekey) {
+//********************************************************************
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_CH_XSec_1Dpmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#mu} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#mu} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
 
-  // Currently the data is given in individual root files
-  // This will likely change when results become official
-  this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Pmu.root");
-  this->SetCovarMatrix(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Pmu.root");
+  // CCQELike plot information
+  fSettings.SetTitle("T2K_CC1pip_CH_XSec_1Dpmu_nu");
+  fSettings.SetDataInput( GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Pmu.root" );
+  fSettings.SetCovarInput( GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Pmu.root" );
+  fSettings.DefineAllowedSpecies("numu");
 
-  this->SetupDefaultHist();
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataValues(  fSettings.GetDataInput() );
+  SetCovarMatrix( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
 // Override this for now
 // Should really have Measurement1D do this properly though
 void T2K_CC1pip_CH_XSec_1Dpmu_nu::SetDataValues(std::string fileLocation) {
   LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
   TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
 
   // Don't want the last bin of dataCopy
   TH1D *dataCopy = (TH1D*)(dataFile->Get("hResult_sliced_0_1"))->Clone();
   LOG(DEB) << "nbins = " << dataCopy->GetNbinsX() << std::endl;
 
   double *binEdges = new double[dataCopy->GetNbinsX()-1];
   for (int i = 0; i < dataCopy->GetNbinsX()-1; i++) {
     binEdges[i] = dataCopy->GetBinLowEdge(i+1);
   }
   binEdges[dataCopy->GetNbinsX()-1] = dataCopy->GetBinLowEdge(dataCopy->GetNbinsX());
 
   for (int i = 0; i < dataCopy->GetNbinsX()+5; i++) {
     LOG(DEB) << "binEdges[" << i << "] = " << binEdges[i] << std::endl;
   }
 
   fDataHist = new TH1D((fName+"_data").c_str(), (fName+"_data"+fPlotTitles).c_str(), dataCopy->GetNbinsX()-1, binEdges);
 
   for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
     fDataHist->SetBinContent(i+1, dataCopy->GetBinContent(i+1)*1E-38);
     fDataHist->SetBinError(i+1, dataCopy->GetBinError(i+1)*1E-38);
     LOG(DEB) << fDataHist->GetBinLowEdge(i+1) << " " << fDataHist->GetBinContent(i+1) << std::endl;
   }
 
   fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
   fDataHist->SetNameTitle((fName+"_data").c_str(), (fName+"_MC"+fPlotTitles).c_str());
 
 
   dataFile->Close();
 };
 
 // Override this for now
 // Should really have Measurement1D do this properly though
 void T2K_CC1pip_CH_XSec_1Dpmu_nu::SetCovarMatrix(std::string fileLocation) {
   LOG(DEB) << "Covariance: " << fileLocation.c_str() << std::endl;
   TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
 
   TH2D *covarMatrix = (TH2D*)(dataFile->Get("TMatrixDBase;1"))->Clone();
 
   int nBinsX = covarMatrix->GetXaxis()->GetNbins();
   int nBinsY = covarMatrix->GetYaxis()->GetNbins();
 
   if ((nBinsX != nBinsY)) ERR(WRN) << "covariance matrix not square!" << std::endl;
 
   this->covar = new TMatrixDSym(nBinsX-2);
   this->fFullCovar = new TMatrixDSym(nBinsX-2);
 
   // First two entries are BS
   // Last entry is BS
   for (int i = 1; i < nBinsX-1; i++) {
     for (int j = 1; j < nBinsY-1; j++) {
       (*this->covar)(i-1, j-1) = covarMatrix->GetBinContent(i+1, j+1); //adds syst+stat covariances
       (*this->fFullCovar)(i-1, j-1) = covarMatrix->GetBinContent(i+1, j+1); //adds syst+stat covariances
       LOG(DEB) << "covar(" << i-1 << ", " << j-1 << ") = " << (*this->covar)(i-1,j-1) << std::endl;
     }
   } //should now have set covariance, I hope
 
   TDecompChol tempMat = TDecompChol(*this->covar);
   this->covar = new TMatrixDSym(nBinsX, tempMat.Invert().GetMatrixArray(), "");
   //  *this->covar *= 1E-38*1E-38;
 
   return;
 };
 
 
 void T2K_CC1pip_CH_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(13) == 0 ||
       event->NumFSParticle(211) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double pmu = FitUtils::p(Pmu);
 
   fXVar = pmu;
 
   return;
 };
 
 //********************************************************************
 bool T2K_CC1pip_CH_XSec_1Dpmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
 // Warning: The CH analysis has different signal definition to the H2O analysis!
 //
 // If Michel e- is used for pion PID we don't have directional info on pion; set the bool to true
 // The bool is if we use Michel e- or not
 // Also, for events binned in muon momentum/angle there's no cut on the pion kinematics
 //
 // Additionally, the 2D distribution uses 0.8 > cos th mu > 0 and no pion phase space reduction applied
 // Also no muon momentum reduction applied
 //
 // This uses a slightly custom signal definition where a cut is only placed on the muon angle, not the momentum
 
   if (!SignalDef::isCC1pi(event, 14, 211, EnuMin, EnuMax)) return false;
 
   TLorentzVector Pnu = event->GetHMISParticle(14)->fP;
   TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
 
   double cos_th_mu = cos(FitUtils::th(Pnu,Pmu));
 
   if (cos_th_mu >= 0.2) return true;
   return false;
 };
 
diff --git a/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.h b/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.h
index b21b4fe..79f1606 100644
--- a/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.h
+++ b/src/T2K/T2K_CC1pip_CH_XSec_1Dpmu_nu.h
@@ -1,21 +1,21 @@
 #ifndef T2K_CC1PIP_CH_XSEC_1DPMU_NU_H_SEEN
 #define T2K_CC1PIP_CH_XSEC_1DPMU_NU_H_SEEN 
 
 #include "Measurement1D.h"
 
 class T2K_CC1pip_CH_XSec_1Dpmu_nu : public Measurement1D {
 public:
-  T2K_CC1pip_CH_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_CH_XSec_1Dpmu_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_CH_XSec_1Dpmu_nu() {};
 
   // Functions to deal with the input data and covariance
   void SetDataValues(std::string fileLocation);
   void SetCovarMatrix(std::string covarFile);
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.cxx b/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.cxx
index 4dfa1ae..423d9c1 100644
--- a/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.cxx
+++ b/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.cxx
@@ -1,161 +1,179 @@
 #include <iomanip>
 
 #include "T2K_SignalDef.h"
-
 #include "T2K_CC1pip_CH_XSec_1Dppi_nu.h"
 
-// The constructor
-T2K_CC1pip_CH_XSec_1Dppi_nu::T2K_CC1pip_CH_XSec_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
 
-  fName = "T2K_CC1pip_CH_XSec_1Dppi_nu";
-  fPlotTitles = "; p_{#pi} (GeV/c); d#sigma/dW_{rec} (cm^{2}/(GeV/c)/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  fIsDiag = false;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+//********************************************************************
+T2K_CC1pip_CH_XSec_1Dppi_nu::T2K_CC1pip_CH_XSec_1Dppi_nu(nuiskey samplekey) {
+//********************************************************************
 
-  if (type.find("Michel") != std::string::npos) {
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_CH_XSec_1Dppi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_CH_XSec_1Dppi_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dW_{rec} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents) / TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  if (fSettings.GetS("type").find("Michel") != std::string::npos) {
     useMichel = true;
     fName += "_Michel";
-    this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Ppi.root");
-    this->SetCovarMatrix(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Ppi.root");
+    SetDataValues(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/CH/Ppi.root");
+    SetCovarMatrix(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/CH/Ppi.root");
   } else {
     useMichel = false;
     fName += "_kin";
-    this->SetDataValues(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Ppi_noME.root");
-    this->SetCovarMatrix(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/CH/Ppi_noME.root");
+    SetDataValues(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/CH/Ppi_noME.root");
+    SetCovarMatrix(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/CH/Ppi_noME.root");
   }
 
-  this->SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  this->fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
 // Override this for now
 // Should really have Measurement1D do this properly though
 void T2K_CC1pip_CH_XSec_1Dppi_nu::SetDataValues(std::string fileLocation) {
   LOG(DEB) << "Reading: " << this->fName << "\nData: " << fileLocation.c_str() << std::endl;
   TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
 
   // Don't want the last bin of dataCopy
   TH1D *dataCopy = (TH1D*)(dataFile->Get("hResult_sliced_0_1"))->Clone();
   LOG(DEB) << dataCopy->GetNbinsX() << std::endl;
 
-  double *binEdges = new double[dataCopy->GetNbinsX()-1];
-  for (int i = 0; i < dataCopy->GetNbinsX()-1; i++) {
-    binEdges[i] = dataCopy->GetBinLowEdge(i+1);
+  double *binEdges = new double[dataCopy->GetNbinsX() - 1];
+  for (int i = 0; i < dataCopy->GetNbinsX() - 1; i++) {
+    binEdges[i] = dataCopy->GetBinLowEdge(i + 1);
   }
-  binEdges[dataCopy->GetNbinsX()-1] = dataCopy->GetBinLowEdge(dataCopy->GetNbinsX());
+  binEdges[dataCopy->GetNbinsX() - 1] = dataCopy->GetBinLowEdge(dataCopy->GetNbinsX());
 
-  fDataHist = new TH1D((fName+"_data").c_str(), (fName+"_data"+fPlotTitles).c_str(), dataCopy->GetNbinsX()-2, binEdges);
+  fDataHist = new TH1D((fName + "_data").c_str(), (fName + "_data" + fPlotTitles).c_str(), dataCopy->GetNbinsX() - 2, binEdges);
 
   for (int i = 0; i < fDataHist->GetNbinsX(); i++) {
-    fDataHist->SetBinContent(i+1, dataCopy->GetBinContent(i+1)*1E-38);
-    fDataHist->SetBinError(i+1, dataCopy->GetBinError(i+1)*1E-38);
-    LOG(DEB) << fDataHist->GetBinLowEdge(i+1) << " " << fDataHist->GetBinContent(i+1) << std::endl;
+    fDataHist->SetBinContent(i + 1, dataCopy->GetBinContent(i + 1) * 1E-38);
+    fDataHist->SetBinError(i + 1, dataCopy->GetBinError(i + 1) * 1E-38);
+    LOG(DEB) << fDataHist->GetBinLowEdge(i + 1) << " " << fDataHist->GetBinContent(i + 1) << std::endl;
   }
 
   fDataHist->SetDirectory(0); //should disassociate fDataHist with dataFile
-  fDataHist->SetNameTitle((fName+"_data").c_str(), (fName+"_MC"+fPlotTitles).c_str());
+  fDataHist->SetNameTitle((fName + "_data").c_str(), (fName + "_MC" + fPlotTitles).c_str());
 
 
   dataFile->Close();
 };
 
 // Override this for now
 // Should really have Measurement1D do this properly though
 void T2K_CC1pip_CH_XSec_1Dppi_nu::SetCovarMatrix(std::string fileLocation) {
   LOG(DEB) << "Covariance: " << fileLocation.c_str() << std::endl;
   TFile *dataFile = new TFile(fileLocation.c_str()); //truly great .root file!
 
   TH2D *covarMatrix = (TH2D*)(dataFile->Get("TMatrixDBase;1"))->Clone();
 
   int nBinsX = covarMatrix->GetXaxis()->GetNbins();
   int nBinsY = covarMatrix->GetYaxis()->GetNbins();
 
   if ((nBinsX != nBinsY)) ERR(WRN) << "covariance matrix not square!" << std::endl;
 
-  this->covar = new TMatrixDSym(nBinsX-2);
-  this->fFullCovar = new TMatrixDSym(nBinsX-2);
+  this->covar = new TMatrixDSym(nBinsX - 2);
+  this->fFullCovar = new TMatrixDSym(nBinsX - 2);
 
   // First two entries are BS
   // Last entry is BS
-  for (int i = 1; i < nBinsX-1; i++) {
-    for (int j = 1; j < nBinsY-1; j++) {
-      LOG(DEB) << "(" << i << ", " << j << ") = " << covarMatrix->GetBinContent(i+1,j+1) << std::endl;
-      (*this->covar)(i-1, j-1) = covarMatrix->GetBinContent(i, j); //adds syst+stat covariances
-      (*this->fFullCovar)(i-1, j-1) = covarMatrix->GetBinContent(i, j); //adds syst+stat covariances
+  for (int i = 1; i < nBinsX - 1; i++) {
+    for (int j = 1; j < nBinsY - 1; j++) {
+      LOG(DEB) << "(" << i << ", " << j << ") = " << covarMatrix->GetBinContent(i + 1, j + 1) << std::endl;
+      (*this->covar)(i - 1, j - 1) = covarMatrix->GetBinContent(i, j); //adds syst+stat covariances
+      (*this->fFullCovar)(i - 1, j - 1) = covarMatrix->GetBinContent(i, j); //adds syst+stat covariances
     }
   } //should now have set covariance, I hope
 
   TDecompChol tempMat = TDecompChol(*this->covar);
   this->covar = new TMatrixDSym(nBinsX, tempMat.Invert().GetMatrixArray(), "");
   //  *this->covar *= 1E-38*1E-38;
 
   return;
 };
 
 
 void T2K_CC1pip_CH_XSec_1Dppi_nu::FillEventVariables(FitEvent *event) {
 
   if (event->NumFSParticle(13) == 0 ||
       event->NumFSParticle(211) == 0)
     return;
 
   TLorentzVector Pnu  = event->GetNeutrinoIn()->fP;
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double ppip = FitUtils::p(Ppip);
 
   fXVar = ppip;
 
   return;
 };
 
 //********************************************************************
 bool T2K_CC1pip_CH_XSec_1Dppi_nu::isSignal(FitEvent *event) {
 //********************************************************************
 // This distribution uses a somewhat different signal definition so might as well implement it separately here
 
   // If we use Michel tag sample we don't cut into the pion phase space, only the muon phase space
   // The last bool refers to if we have Michel e or not
   if (useMichel) {
     return SignalDef::isCC1pip_T2K_CH(event, EnuMin, EnuMax, true);
   } else { // Custom signal definition if we aren't using Michel tag; cut on muon and cut only on pion angle
 
     // does the event pass the muon cut?
     bool muonPass = SignalDef::isCC1pip_T2K_CH(event, EnuMin, EnuMax, true);
 
     // If the event doesn't pass the muon cut return false
     if (!muonPass) {
       return false;
     }
 
     // does the event pass the pion angle cut?
     // we already know there's just one muon in the event if it passes muonPass so don't need to make an event loop rejection
     // Need the neutrino four-vector to get the angle between pion and neutrino
     TLorentzVector Pnu = event->PartInfo(0)->fP;
     TLorentzVector Ppip;
     for (unsigned int j = 2; j < event->Npart(); j++) {
       if (!((event->PartInfo(j))->fIsAlive) && (event->PartInfo(j))->fNEUTStatusCode != 0) continue; //move on if NOT ALIVE and NOT NORMAL
       int PID = (event->PartInfo(j))->fPID;
       if (PID == 211) {
         Ppip = event->PartInfo(j)->fP; // Once the pion is found we can break
         break;
       }
     }
 
     double cos_th_pi = cos(FitUtils::th(Pnu, Ppip));
     // Now check the angle of the pion
     if (cos_th_pi <= 0.2) {
       return false;
     } else {
       return true;
     }
   }
 
   // Unnecessary default to false
   return false;
 }
 
diff --git a/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.h b/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.h
index ab5fa28..8649e4a 100644
--- a/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.h
+++ b/src/T2K/T2K_CC1pip_CH_XSec_1Dppi_nu.h
@@ -1,22 +1,22 @@
 #ifndef T2K_CC1PIP_CH_XSEC_1DPPI_NU_H_SEEN
 #define T2K_CC1PIP_CH_XSEC_1DPPI_NU_H_SEEN 
 
 #include "Measurement1D.h"
 
 class T2K_CC1pip_CH_XSec_1Dppi_nu : public Measurement1D {
 public:
-  T2K_CC1pip_CH_XSec_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_CH_XSec_1Dppi_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_CH_XSec_1Dppi_nu() {};
 
   // Functions to deal with the input data and covariance
   void SetDataValues(std::string fileLocation);
   void SetCovarMatrix(std::string covarFile);
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
   bool useMichel;
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.cxx
index b726e8f..c058c03 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.cxx
@@ -1,55 +1,73 @@
 #include "T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h"
 
 // The derived neutrino energy assuming a Delta resonance and a nucleon at rest; so only requires the outgoing muon to derive (and information on the angle between the muon and the neutrino)
 // Please beware that this is NOT THE "TRUE" NEUTRINO ENERGY; IT'S A PROXY FOR THE TRUE NEUTRINO ENERGY
 // Also, this is flux-integrated cross-section, not flux averaged
 
+
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1DEnuDelta_nu::T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1DEnuDelta_nu::T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(nuiskey samplekey) {
 //********************************************************************
-  fName = "T2K_CC1pip_H2O_XSec_1DEnuDelta_nu";
-  fPlotTitles = "; E^{#Delta}_{#nu} (GeV); #sigma(E^{#Delta}_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
-
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","EnuRec_Delta/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "EnuRec_Delta/TotalCovariance", true);
-
-  SetupDefaultHist();
-
-  fScaleFactor = GetEventHistogram()->Integral("width")*1E-38/double(fNEvents);
+
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1DEnuDelta_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1DEnuDelta_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;EnuRec_Delta/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;EnuRec_Delta/TotalCovariance");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents);
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 
 //********************************************************************
 // Find the muon whows kinematics we use to derive the "neutrino energy"
 void T2K_CC1pip_H2O_XSec_1DEnuDelta_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(13) == 0) return;
 
   // Get the incoming neutrino
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   // Get the muon
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double Enu = FitUtils::EnuCC1piprecDelta(Pnu, Pmu);
 
   fXVar = Enu;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1DEnuDelta_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h
index 5d1d9f4..a7b8c9e 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuDelta_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DENUDELTA_NU_H_SEEN
 #define T2K_CC1PIP_H2O_XSEC_1DENUDELTA_NU_H_SEEN 
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1DEnuDelta_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1DEnuDelta_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1DEnuDelta_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx
index 8a5a927..cd97a9a 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx
@@ -1,62 +1,79 @@
 #include "T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h"
 
 // The derived neutrino energy using the "MiniBooNE formula" (see paper)
 // Essentially this is a proxy for the neutrino energy, using the outgoing pion and muon to get the reconstructed neutrino energy, assuming the struck nucleon was at rest
 // Again, THIS IS NOT A "TRUE" NEUTRINO ENERGY!
 
+
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1DEnuMB_nu::T2K_CC1pip_H2O_XSec_1DEnuMB_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1DEnuMB_nu::T2K_CC1pip_H2O_XSec_1DEnuMB_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "T2K_CC1pip_H2O_XSec_1DEnuMB_nu";
-  fPlotTitles = "; E_{#nu} (GeV); #sigma(E_{#nu}) (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1DEnuMB_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1DEnuMB_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;EnuRec_MB/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;EnuRec_MB/TotalCovariance");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width") * 1E-38) / double(fNEvents);
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","EnuRec_MB/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "EnuRec_MB/TotalCovariance", true);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
 
-  SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents);
 };
 
 //********************************************************************
 // Find the derived neutrino energy using the "MiniBooNE formula" (see paper)
 // Essentially uses the pion and muon kinematics to derive a pseudo-neutrino energy, assuming the struck nucleon is at rest
 // We also need the incoming neutrino to get the muon/neutrino and pion/neutrino angles
 void T2K_CC1pip_H2O_XSec_1DEnuMB_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(13) == 0) return;
   // Need to make sure there's a pion
   if (event->NumFSParticle(211) == 0) return;
 
   // Get the incoming neutrino
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   // Get the muon
   TLorentzVector Pmu = event->GetHMFSParticle(13)->fP;
   // Get the pion
   TLorentzVector Ppip = event->GetHMFSParticle(211)->fP;
 
   double Enu = FitUtils::EnuCC1piprec(Pnu, Pmu, Ppip);
 
   fXVar = Enu;
 
   return;
 };
 
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1DEnuMB_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h
index 6d0ab53..173e1fe 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_XSEC_1DENUMB_NU_H_SEEN
 #define T2K_CC1PIP_XSEC_1DENUMB_NU_H_SEEN 
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1DEnuMB_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1DEnuMB_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1DEnuMB_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1DEnuMB_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.cxx
index 2bb1ad5..4156798 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.cxx
@@ -1,56 +1,72 @@
 #include "T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h"
 
 // The cos of the angle between the neutrino and the muon
 
+
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1Dcosmu_nu::T2K_CC1pip_H2O_XSec_1Dcosmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1Dcosmu_nu::T2K_CC1pip_H2O_XSec_1Dcosmu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "T2K_CC1pip_H2O_XSec_1Dcosmu_nu";
-  fPlotTitles = "; cos#theta_{#mu}; d#sigma/dcos#theta_{#mu} (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1Dcosmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1Dcosmu_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi,#mu}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi#mu} (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","MuCos/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "MuCos/TotalCovariance", true);
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuCos/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuCos/TotalCovariance");
 
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
   fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
 //********************************************************************
 // Find the cos theta of the angle between muon and neutrino
 void T2K_CC1pip_H2O_XSec_1Dcosmu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(13) == 0) return;
 
   // Get the incoming neutrino
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   // Get the muon
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   // Do the cos of the angle between the two
   double cos_th = cos(FitUtils::th(Pnu, Pmu));
 
   fXVar = cos_th;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1Dcosmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
 
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h
index a3246ac..80bd03b 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmu_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DCOSMU_NU_H_SEEN
 #define T2K_CC1PIP_H2O_XSEC_1DCOSMU_NU_H_SEEN 
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1Dcosmu_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1Dcosmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1Dcosmu_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1Dcosmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.cxx
index e969f20..5b6264a 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.cxx
@@ -1,55 +1,70 @@
 #include "T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h"
 
-// The cosine of the angle between the muon and pion
 
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1Dcosmupi_nu::T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1Dcosmupi_nu::T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "T2K_CC1pip_H2O_XSec_1Dcosmupi_nu";
-  fPlotTitles = "; cos#theta_{#pi,#mu}; d#sigma/dcos#theta_{#pi#mu} (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1Dcosmupi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","MuPiCos/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "MuPiCos/TotalCovariance", true);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1Dcosmupi_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi,#mu}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi#mu} (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
 
-  SetupDefaultHist();
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuPiCos/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuPiCos/TotalCovariance");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  GetEventHistogram()->Integral("width")*1E-38/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*1E-38/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 //********************************************************************
 // Find the cos theta of the angle between muon and pion
 void T2K_CC1pip_H2O_XSec_1Dcosmupi_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(13) == 0) return;
   // Need to make sure there's a pion
   if (event->NumFSParticle(211) == 0) return;
 
   // Get the muon
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
   // Get the pion
   TLorentzVector Ppip  = event->GetHMFSParticle(211)->fP;
 
   double cos_th = cos(FitUtils::th(Pmu, Ppip));
 
   fXVar = cos_th;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1Dcosmupi_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h
index 8248a73..6b790b8 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcosmupi_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DCOSMUPI_NU_H_SEEN
 #define T2K_CC1PIP_H2O_XSEC_1DCOSMUPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1Dcosmupi_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1Dcosmupi_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1Dcosmupi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.cxx
index db6714e..51ccaf4 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.cxx
@@ -1,53 +1,67 @@
 #include "T2K_CC1pip_H2O_XSec_1Dcospi_nu.h"
 
-// The cos of the angle between the pion and the neutrino
-
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1Dcospi_nu::T2K_CC1pip_H2O_XSec_1Dcospi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1Dcospi_nu::T2K_CC1pip_H2O_XSec_1Dcospi_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "T2K_CC1pip_H2O_XSec_1Dcospi_nu";
-  fPlotTitles = "; cos#theta_{#pi}; d#sigma/dcos#theta_{#pi} (cm^{2}/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1Dcospi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1Dcospi_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("cos#theta_{#pi}");
+  fSettings.SetYTitle("d#sigma/dcos#theta_{#pi} (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
+
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;PosPionCos/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;PosPionCos/TotalCovariance");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor =  (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","PosPionCos/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "PosPionCos/TotalCovariance", true);
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
 
-  SetupDefaultHist();
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
 //********************************************************************
 // Find the cos theta of the angle between pion and neutrino
 void T2K_CC1pip_H2O_XSec_1Dcospi_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a pion
   if (event->NumFSParticle(211) == 0) return;
 
   // Get the incoming neutrino
   TLorentzVector Pnu = event->GetNeutrinoIn()->fP;
   // Get the pion
   TLorentzVector Ppip  = event->GetHMFSParticle(211)->fP;
 
   double cos_th = cos(FitUtils::th(Pnu, Ppip));
 
   fXVar = cos_th;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1Dcospi_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.h
index 3bddbf2..7e07a7f 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dcospi_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DCOSPI_NU_H_SEEN
 #define T2K_CC1PIP_H2O_XSEC_1DCOSPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1Dcospi_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1Dcospi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1Dcospi_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1Dcospi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx
index 98368f3..d653511 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx
@@ -1,52 +1,69 @@
 #include "T2K_CC1pip_H2O_XSec_1Dpmu_nu.h"
 
 // The muon momentum
 
+
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1Dpmu_nu::T2K_CC1pip_H2O_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1Dpmu_nu::T2K_CC1pip_H2O_XSec_1Dpmu_nu(nuiskey samplekey) {
 //********************************************************************
 
-  //
-  fName = "T2K_CC1pip_H2O_XSec_1Dpmu_nu";
-  fPlotTitles = "; p_{#mu} (GeV/c); d#sigma/dp_{#mu} (cm^{2}/(GeV/c)/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1Dpmu_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
+
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1Dpmu_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("E_{#nu} (GeV)");
+  fSettings.SetYTitle("#sigma(E_{#nu}) (cm^{2}/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/DIAG");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","MuMom/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "MuMom/TotalCovariance", true);
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuMom/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;MuMom/TotalCovariance");
 
-  SetupDefaultHist();
+  FinaliseSampleSettings();
 
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
   fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
+
 };
 
+
 //********************************************************************
 // Find the momentum of the muon
 void T2K_CC1pip_H2O_XSec_1Dpmu_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(13) == 0) return;
 
   // Get the muon
   TLorentzVector Pmu  = event->GetHMFSParticle(13)->fP;
 
   double p_mu = FitUtils::p(Pmu);
 
   fXVar = p_mu;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1Dpmu_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.h
index 5e9dfcf..4c186a9 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DPMU_NU_H_SEEN 
 #define T2K_CC1PIP_H2O_XSEC_1DPMU_NU_H_SEEN
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1Dpmu_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1Dpmu_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1Dpmu_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.cxx b/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.cxx
index 34fbdbe..beb9357 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.cxx
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.cxx
@@ -1,51 +1,68 @@
 #include "T2K_CC1pip_H2O_XSec_1Dppi_nu.h"
 
 // The momentum of the (positive) pion
 
 //********************************************************************
-T2K_CC1pip_H2O_XSec_1Dppi_nu::T2K_CC1pip_H2O_XSec_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile){
+T2K_CC1pip_H2O_XSec_1Dppi_nu::T2K_CC1pip_H2O_XSec_1Dppi_nu(nuiskey samplekey) {
 //********************************************************************
 
-  fName = "T2K_CC1pip_H2O_XSec_1Dppi_nu";
-  fPlotTitles = "; p_{#pi^{+}} (GeV/c); d#sigma/dp_{#pi^{+}} (cm^{2}/(GeV/c)/nucleon)";
-  EnuMin = 0.;
-  EnuMax = 100.;
-  Measurement1D::SetupMeasurement(inputfile, type, rw, fakeDataFile);
+  // Sample overview ---------------------------------------------------
+  std::string descrip = "T2K_CC1pip_H2O_XSec_1Dppi_nu sample. \n" \
+                        "Target: CH \n" \
+                        "Flux: T2k Forward Horn Current nue + nuebar \n" \
+                        "Signal: Any event with 1 electron, any nucleons, and no other FS particles \n";
 
-  // Data comes in ROOT file
-  // hResultTot is cross-section with all errors
-  // hResultStat is cross-section with stats-only errors
-  // hTruthNEUT is the NEUT cross-section given by experimenter
-  // hTruthGENIE is the GENIE cross-section given by experimenter
-  SetDataFromFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root","PosPionMom/hResultTot");
-  SetCovarFromDataFile(GeneralUtils::GetTopLevelDir()+"/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root", "PosPionMom/TotalCovariance", true);
+  // Setup common settings
+  fSettings = LoadSampleSettings(samplekey);
+  fSettings.SetTitle("T2K_CC1pip_H2O_XSec_1Dppi_nu");
+  fSettings.SetDescription(descrip);
+  fSettings.SetXTitle("p_{#pi^{+}} (GeV/c)");
+  fSettings.SetYTitle("d#sigma/dp_{#pi^{+}} (cm^{2}/(GeV/c)/nucleon)");
+  fSettings.SetAllowedTypes("FIX,FREE,SHAPE/DIAG,FULL/NORM/MASK", "FIX/FULL");
+  fSettings.SetEnuRange(0.0, 100.0);
+  fSettings.DefineAllowedTargets("C,H");
+  fSettings.DefineAllowedSpecies("numu");
 
-  SetupDefaultHist();
+  fSettings.SetDataInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;PosPionMom/hResultTot");
+  fSettings.SetCovarInput(GeneralUtils::GetTopLevelDir() + "/data/T2K/CC1pip/H2O/nd280data-numu-cc1pi-xs-on-h2o-2015.root;PosPionMom/TotalCovariance");
+
+  FinaliseSampleSettings();
+
+  // Scaling Setup ---------------------------------------------------
+  // ScaleFactor automatically setup for DiffXSec/cm2/Nucleon
+  fScaleFactor = (GetEventHistogram()->Integral("width")*1E-38)/double(fNEvents)/TotalIntegratedFlux("width");
+
+  // Plot Setup -------------------------------------------------------
+  SetDataFromRootFile(  fSettings.GetDataInput() );
+  SetCovarFromRootFile( fSettings.GetCovarInput() );
+
+  // Final setup  ---------------------------------------------------
+  FinaliseMeasurement();
 
-  fScaleFactor = GetEventHistogram()->Integral("width")*1E-38/double(fNEvents)/TotalIntegratedFlux("width");
 };
 
+
 //********************************************************************
 // Find the momentum of the (positively charged) pion
 void T2K_CC1pip_H2O_XSec_1Dppi_nu::FillEventVariables(FitEvent *event) {
 //********************************************************************
 
   // Need to make sure there's a muon
   if (event->NumFSParticle(211) == 0) return;
 
   // Get the pion
   TLorentzVector Ppip  = event->GetHMFSParticle(211)->fP;
 
   double p_pi = FitUtils::p(Ppip);
 
   fXVar = p_pi;
 
   return;
 };
 
 //********************************************************************
 // Beware: The H2O analysis has different signal definition to the CH analysis!
 bool T2K_CC1pip_H2O_XSec_1Dppi_nu::isSignal(FitEvent *event) {
 //********************************************************************
   return SignalDef::isCC1pip_T2K_H2O(event, EnuMin, EnuMax);
 }
diff --git a/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.h b/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.h
index 6938c7d..77134ec 100644
--- a/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.h
+++ b/src/T2K/T2K_CC1pip_H2O_XSec_1Dppi_nu.h
@@ -1,18 +1,18 @@
 #ifndef T2K_CC1PIP_H2O_XSEC_1DPPI_NU_H_SEEN
 #define T2K_CC1PIP_H2O_XSEC_1DPPI_NU_H_SEEN
 
 #include "Measurement1D.h"
 #include "T2K_SignalDef.h"
 
 class T2K_CC1pip_H2O_XSec_1Dppi_nu : public Measurement1D {
 public:
-  T2K_CC1pip_H2O_XSec_1Dppi_nu(std::string inputfile, FitWeight *rw, std::string  type, std::string fakeDataFile);
+  T2K_CC1pip_H2O_XSec_1Dppi_nu(nuiskey samplekey);
   virtual ~T2K_CC1pip_H2O_XSec_1Dppi_nu() {};
 
   void FillEventVariables(FitEvent *event);
   bool isSignal(FitEvent *event);
 
   private:
 };
 
 #endif
diff --git a/src/Tests/CMakeLists.txt b/src/Tests/CMakeLists.txt
index c5aa084..f830fb7 100644
--- a/src/Tests/CMakeLists.txt
+++ b/src/Tests/CMakeLists.txt
@@ -1,42 +1,45 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 
 include_directories(${RWENGINE_INCLUDE_DIRECTORIES})
 include_directories(${CMAKE_SOURCE_DIR}/src/Routines)
 include_directories(${CMAKE_SOURCE_DIR}/src/FitBase)
+include_directories(${CMAKE_SOURCE_DIR}/src/InputHandler)
+include_directories(${CMAKE_SOURCE_DIR}/src/Genie)
 include_directories(${CMAKE_SOURCE_DIR}/src/Utils)
+include_directories(${CMAKE_SOURCE_DIR}/src/Reweight)
 include_directories(${CMAKE_SOURCE_DIR}/src/Splines)
 include_directories(${CMAKE_SOURCE_DIR}/src/FCN)
 include_directories(${CMAKE_SOURCE_DIR}/src/MCStudies)
 include_directories(${EXP_INCLUDE_DIRECTORIES})
 
 SET(TESTAPPS SignalDefTests ParserTests)
 
 foreach(appimpl ${TESTAPPS})
   add_executable(${appimpl} ${appimpl}.cxx)
   set(TARGETS_TO_BUILD ${TARGETS_TO_BUILD};${appimpl})
   target_link_libraries(${appimpl} ${MODULETargets})
   target_link_libraries(${appimpl} ${CMAKE_DEPENDLIB_FLAGS})
   target_link_libraries(${appimpl} ${ROOT_LIBS})
   if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
     set_target_properties(${appimpl} PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
   endif()
   install(TARGETS ${appimpl} DESTINATION tests)
   add_test(${appimpl} ${appimpl} 1)
 endforeach()
diff --git a/src/Utils/BeamUtils.cxx b/src/Utils/BeamUtils.cxx
new file mode 100644
index 0000000..b4a32b7
--- /dev/null
+++ b/src/Utils/BeamUtils.cxx
@@ -0,0 +1,47 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "BeamUtils.h"
+
+std::vector<int> BeamUtils::ParseSpeciesToIntVect(std::string spc){
+
+  // Split by comma
+  std::vector<std::string> splitspc = GeneralUtils::ParseToStr(spc,",");
+  std::vector<int> convspc;
+  
+  // Run through hard coded list
+  for (size_t i = 0; i < splitspc.size(); i++){
+    
+    std::string type = splitspc[i];
+    
+    if      (!type.compare("electron")) convspc.push_back(11);
+    else if (!type.compare("positron")) convspc.push_back(-11);
+    else if (!type.compare("muon"))     convspc.push_back(13);
+    else if (!type.compare("antimuon")) convspc.push_back(-13);
+    
+    else if (!type.compare("nue"))      convspc.push_back(12);
+    else if (!type.compare("numu"))     convspc.push_back(14);
+    else if (!type.compare("antinue"))  convspc.push_back(12);
+    else if (!type.compare("antinumu")) convspc.push_back(14);
+    else{
+      convspc.push_back( GeneralUtils::StrToInt(type) );
+    }
+  }
+  
+  return convspc;
+}
diff --git a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h b/src/Utils/BeamUtils.h
similarity index 67%
copy from src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h
copy to src/Utils/BeamUtils.h
index 99e0312..5b29104 100644
--- a/src/MiniBooNE/MiniBooNE_CC1pi0_XSec_1DTu_nu.h
+++ b/src/Utils/BeamUtils.h
@@ -1,37 +1,40 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#ifndef MINIBOONE_CC1PI0_XSEC_1DTU_NU_H_SEEN
-#define MINIBOONE_CC1PI0_XSEC_1DTU_NU_H_SEEN
-
-#include "Measurement1D.h"
-
-class MiniBooNE_CC1pi0_XSec_1DTu_nu : public Measurement1D {
-public:
-
-  MiniBooNE_CC1pi0_XSec_1DTu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~MiniBooNE_CC1pi0_XSec_1DTu_nu() {};
-
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
-
-private:
-};
-
+#ifndef BEAM_UTILS_H
+#define BEAM_UTILS_H
+
+#include <vector>
+#include "FitLogger.h"
+#include "GeneralUtils.h"
+
+/*!
+ *  \addtogroup Utils
+ *  @{
+ */
+
+/// Namespace for any global util functions related to beam simulation
+namespace BeamUtils{
+
+  /// @brief Converts comma seperated string of beam ids into PDG vector
+  /// 
+  /// e.g. 'numu,nue,numub,e,16' = <14,12,-14,11,16>
+  std::vector<int> ParseSpeciesToIntVect(std::string spc);
+}
+/*! @} */
 #endif
diff --git a/src/Utils/CMakeLists.txt b/src/Utils/CMakeLists.txt
index 53f2bc0..b2dcfca 100644
--- a/src/Utils/CMakeLists.txt
+++ b/src/Utils/CMakeLists.txt
@@ -1,78 +1,98 @@
 # Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 ################################################################################
 #    This file is part of NUISANCE.
 #
 #    NUISANCE is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
 #    the Free Software Foundation, either version 3 of the License, or
 #    (at your option) any later version.
 #
 #    NUISANCE is distributed in the hope that it will be useful,
 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #    GNU General Public License for more details.
 #
 #    You should have received a copy of the GNU General Public License
 #    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 ################################################################################
 set(HEADERFILES
 FitLogger.h
 FitParameters.h
 FitUtils.h
 GeneralUtils.h
+ParserUtils.h
 PlotUtils.h
 StatUtils.h
 SignalDef.h
+NuisConfig.h
+NuisKey.h
+BeamUtils.h
+TargetUtils.h
+StackBase.h
+StandardStacks.h
+OpenMPWrapper.h
+PhysConst.h
+Initialiser.h
 )
 
 set(IMPLFILES
 PythiaQuiet.f
 FitLogger.cxx
 FitParameters.cxx
 FitUtils.cxx
 GeneralUtils.cxx
 PlotUtils.cxx
 StatUtils.cxx
 SignalDef.cxx
+NuisConfig.cxx
+NuisKey.cxx
+BeamUtils.cxx
+TargetUtils.cxx
+StackBase.cxx
+ParserUtils.cxx
+StandardStacks.cxx
+Initialiser.cxx
 )
 
 set(LIBNAME Utils)
 
 if(CMAKE_BUILD_TYPE MATCHES DEBUG)
   add_library(${LIBNAME} STATIC ${IMPLFILES})
 else(CMAKE_BUILD_TYPE MATCHES RELEASE)
   add_library(${LIBNAME} SHARED ${IMPLFILES})
 endif()
 
 target_include_directories(${LIBNAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
+target_include_directories(${LIBNAME} PUBLIC ${CMAKE_SOURCE_DIR}/src/Splines)
+target_include_directories(${LIBNAME} PUBLIC ${CMAKE_SOURCE_DIR}/src/InputHandler)
 target_include_directories(${LIBNAME} PUBLIC ${CMAKE_SOURCE_DIR}/src/FitBase)
 target_include_directories(${LIBNAME} PUBLIC ${RWENGINE_INCLUDE_DIRECTORIES})
 
 # if(USE_NuWro AND NUWRO_BUILT_FROM_FILE)
 #   target_include_directories(${LIBNAME} PUBLIC ${CMAKE_BINARY_DIR}/NuWro_event1)
 # endif()
 
 set_target_properties(${LIBNAME} PROPERTIES VERSION
   "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_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)
 
-add_executable(DumpROOTClassesFromVector DumpROOTClassesFromVector.cxx GeneralUtils.cxx FitLogger.cxx PythiaQuiet.f)
+#add_executable(DumpROOTClassesFromVector DumpROOTClassesFromVector.cxx GeneralUtils.cxx FitLogger.cxx PythiaQuiet.f)
 
-target_link_libraries(DumpROOTClassesFromVector ${ROOT_LIBS})
-if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
-  set_target_properties(DumpROOTClassesFromVector PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
-endif()
-set_target_properties(DumpROOTClassesFromVector PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS})
+#target_link_libraries(DumpROOTClassesFromVector ${ROOT_LIBS})
+#if(NOT "${CMAKE_LINK_FLAGS}" STREQUAL "")
+#  set_target_properties(DumpROOTClassesFromVector PROPERTIES LINK_FLAGS ${CMAKE_LINK_FLAGS})
+#endif()
+#set_target_properties(DumpROOTClassesFromVector PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS})
 
-install(TARGETS DumpROOTClassesFromVector DESTINATION bin)
+#install(TARGETS DumpROOTClassesFromVector DESTINATION bin)
diff --git a/src/Utils/FitLogger.cxx b/src/Utils/FitLogger.cxx
index 876b133..a44a95d 100644
--- a/src/Utils/FitLogger.cxx
+++ b/src/Utils/FitLogger.cxx
@@ -1,180 +1,310 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FitLogger.h"
 #include <fcntl.h>
 #include <unistd.h>
 
-namespace FitPar{
-  unsigned int log_verb = 0; //!< Current VERBOSITY
-  unsigned int err_verb = 0; //!< Current ERROR VERBOSITY
-  bool use_colors = true; //!< Use BASH Terminal Colors Flag
-  bool super_rainbow_mode = true; //!< For when fitting gets boring.
-  unsigned int super_rainbow_mode_colour = 0;
-
-  // For redirecting various print outs
-  std::streambuf *default_cout = std::cout.rdbuf();
-  std::streambuf *default_cerr = std::cerr.rdbuf();
-  std::ofstream redirect_stream("/dev/null");
-  int silentfd = open("/dev/null",O_WRONLY);
-  int savedstdoutfd = dup(fileno(stdout));
-  int savedstderrfd = dup(fileno(stderr));
-}
 
-std::ostream* logStream(&std::cout);
-std::ostream* errStream(&std::cerr);
-std::ofstream nullStream;
+namespace Logger {
 
-//******************************************
-void LOG_VERB(std::string verb){
-//******************************************
+// Logger Variables
+uint log_verb   = 4;
+bool use_colors = true;
+bool showtrace  = false;
+std::ostream* __LOG_outstream(&std::cout);
+std::ofstream __LOG_nullstream;
 
-  if      (!verb.compare("DEB")) FitPar::log_verb=-1;
-  else if (!verb.compare("QUIET")) FitPar::log_verb=0;
-  else if (!verb.compare("FIT"))  FitPar::log_verb=1;
-  else if (!verb.compare("MIN"))   FitPar::log_verb=2;
-  else if (!verb.compare("SAM"))   FitPar::log_verb=3;
-  else if (!verb.compare("REC"))   FitPar::log_verb=4;
-  else if (!verb.compare("SIG"))   FitPar::log_verb=5;
-  else if (!verb.compare("EVT"))   FitPar::log_verb=6;
-  else FitPar::log_verb = GeneralUtils::StrToInt(verb);
-  
-  return;
-}
+// Error Variables
+unsigned int err_verb = 0;
+std::ostream* __ERR_outstream(&std::cerr);
 
-//******************************************
-void ERR_VERB(std::string verb){
-//******************************************
+// Extra Variables
+bool external_verb = false;
 
+bool super_rainbow_mode = true; //!< For when fitting gets boring.
+unsigned int super_rainbow_mode_colour = 0;
 
-  if    (!verb.compare("ERRQUIET")) FitPar::err_verb=0;
-  else if (!verb.compare("FTL")) FitPar::err_verb=1;
-  else if (!verb.compare("WRN")) FitPar::err_verb=2;
-  else FitPar::log_verb = GeneralUtils::StrToInt(verb);
+std::streambuf *default_cout = std::cout.rdbuf();
+std::streambuf *default_cerr = std::cerr.rdbuf();
+std::ofstream redirect_stream("/dev/null");
+int silentfd = open("/dev/null", O_WRONLY);
+int savedstdoutfd = dup(fileno(stdout));
+int savedstderrfd = dup(fileno(stderr));
+
+int nloggercalls = 0;
+int timelastlog = 0;
 
-  return;
 }
 
-//******************************************
-bool LOG_LEVEL(int level){
-//******************************************
 
-  if (FitPar::log_verb == (unsigned int) DEB){
-    return true;
-  }
 
-  if (FitPar::log_verb <  (unsigned int) level){
-    return false;
+// -------- Logging Functions --------- //
+
+
+bool LOGGING(int level) {
+  // std::cout << "LOGGING : " << __FILENAME__ << " " << __FUNCTION__ << std::endl;
+  return (Logger::log_verb >= (uint)__GETLOG_LEVEL(level, __FILENAME__, __FUNCTION__));
+};
+
+int __GETLOG_LEVEL(int level, const char* filename, const char* funct) {
+
+#ifdef __DEBUG__
+  int logfile = FitPar::Config().GetParI("logging." + std::string(filename));
+  if (logfile >= DEB and logfile <= EVT) {
+    level = logfile;
   }
 
-  return true;
-}
+  int logfunc = FitPar::Config().GetParI("logging." + std::string(funct));
+  if (logfunc >= DEB and logfunc <= EVT) {
+    level = logfunc;
+  }
+#endif
 
-//******************************************
-std::ostream& LOG(int level)
-//******************************************
-{
+  return level;
+};
 
-  if (FitPar::log_verb < (unsigned int)level && 
-      FitPar::log_verb != (unsigned int)DEB){
-    return nullStream;
-  } else {
+std::ostream& __OUTLOG(int level, const char* filename, const char* funct, int line) {
 
-    if (FitPar::super_rainbow_mode and FitPar::use_colors){
-      switch(FitPar::super_rainbow_mode_colour){
-      case 1:  std::cout<<RED;
-      case 2:  std::cout<<GREEN;
-      case 3:  std::cout<<YELLOW;
-      case 4:  std::cout<<BLUE;
-      case 5:  std::cout<<MAGENTA;
-      case 6:  std::cout<<CYAN;
-      default: FitPar::super_rainbow_mode_colour = 0;
-      }
+  if (Logger::log_verb < (unsigned int)level &&
+      Logger::log_verb != (unsigned int)DEB) {
+    return (Logger::__LOG_nullstream);
 
-      FitPar::super_rainbow_mode_colour++;
-    }
+  } else {
 
-    if (FitPar::use_colors){
-      switch(level){
+    if (Logger::use_colors) {
+      switch (level) {
       case FIT: std::cout << BOLDGREEN; break;
       case MIN: std::cout << BOLDBLUE;  break;
       case SAM: std::cout << MAGENTA;   break;
       case REC: std::cout << BLUE;      break;
       case SIG: std::cout << GREEN;     break;
       case DEB: std::cout << CYAN;      break;
       default: break;
       }
     }
 
-    switch(level){
-    case FIT: std::cout << "[LOG Fitter]: "; break;
-    case MIN: std::cout << "[LOG Minmzr]: "; break;
-    case SAM: std::cout << "[LOG Sample]: - "; break;
-    case REC: std::cout << "[LOG Reconf]: -- "; break;
-    case SIG: std::cout << "[LOG Signal]: --- "; break;
-    case EVT: std::cout << "[LOG Event ]: ---- "; break;
-    case DEB: std::cout << "[LOG DEBUG ]: "; break;
-    default: std::cout << "Log : "; break;
+    switch (level) {
+    case FIT: std::cout << "[LOG Fitter]"; break;
+    case MIN: std::cout << "[LOG Minmzr]"; break;
+    case SAM: std::cout << "[LOG Sample]"; break;
+    case REC: std::cout << "[LOG Reconf]"; break;
+    case SIG: std::cout << "[LOG Signal]"; break;
+    case EVT: std::cout << "[LOG Event ]"; break;
+    case DEB: std::cout << "[LOG DEBUG ]"; break;
+    default:  std::cout << "[LOG INFO  ]"; break;
     }
 
-    if (FitPar::use_colors or FitPar::super_rainbow_mode) std::cout << RESET;
+    // Apply indent
+    if (true) {
+      switch (level) {
+      case FIT: std::cout << ": "; break;
+      case MIN: std::cout << ":- "; break;
+      case SAM: std::cout << ":-- "; break;
+      case REC: std::cout << ":--- "; break;
+      case SIG: std::cout << ":---- "; break;
+      case EVT: std::cout << ":----- "; break;
+      case DEB: std::cout << ":------ "; break;
+      default:  std::cout << " "; break;
+      }
+    }
 
-    return *logStream;
+    if (Logger::use_colors) std::cout << RESET;
+
+    if (Logger::showtrace) {
+      std::cout << " : " << filename << "::" << funct << "[l. " << line << "] : ";
+    }
+
+    return *(Logger::__LOG_outstream);
   }
 }
-//******************************************
-std::ostream& ERR(int level)
-//******************************************
-{
 
-  if (FitPar::use_colors) std::cerr << RED;
-  
-  switch(level){
+void SETVERBOSITY(int level) {
+  Logger::log_verb = level;
+}
+
+void SETVERBOSITY(std::string verb) {
+  if      (!verb.compare("DEB"))   Logger::log_verb = -1;
+  else if (!verb.compare("QUIET")) Logger::log_verb = 0;
+  else if (!verb.compare("FIT"))   Logger::log_verb = 1;
+  else if (!verb.compare("MIN"))   Logger::log_verb = 2;
+  else if (!verb.compare("SAM"))   Logger::log_verb = 3;
+  else if (!verb.compare("REC"))   Logger::log_verb = 4;
+  else if (!verb.compare("SIG"))   Logger::log_verb = 5;
+  else if (!verb.compare("EVT"))   Logger::log_verb = 6;
+  else Logger::log_verb = std::atoi(verb.c_str());
+}
+
+/// Set Trace Option
+void SETTRACE(bool val) {
+  Logger::showtrace = val;
+}
+
+// ------ ERROR FUNCTIONS ---------- //
+std::ostream& __OUTERR(int level, const char* filename, const char* funct, int line) {
+  if (Logger::use_colors) std::cerr << RED;
+
+  switch (level) {
   case FTL: std::cerr << "[ERR FATAL ]: "; break;
-  case WRN: std::cerr << "[ERR WARN  ] : "; break;
+  case WRN: std::cerr << "[ERR WARN  ]: "; break;
   }
 
-  if (FitPar::use_colors) std::cerr << RESET;
-  
-  return *errStream;
+  if (Logger::use_colors) std::cerr << RESET;
+
+  // Allows enable error debugging trace
+  if (true or Logger::showtrace) {
+    std::cout << filename << "::" << funct << "[l. " << line << "] : ";
+  }
+
+  return *(Logger::__ERR_outstream);
+}
+
+// ----------- External Logging ----------- //
+void SETEXTERNALVERBOSITY(int level) {
+  Logger::external_verb = (level > 0);
 }
 
+void StopTalking() {
+
+  // Check verbosity set correctly
+  if (!Logger::external_verb) return;
 
-void StopTalking(){
   // Only redirect if we're not debugging
-  if (FitPar::log_verb == (unsigned int)DEB) return;
-  std::cout.rdbuf(FitPar::redirect_stream.rdbuf());
-  std::cerr.rdbuf(FitPar::redirect_stream.rdbuf());
-  shhpythiaitokay_();
-  fflush(stdout); 
+  if (Logger::log_verb == (unsigned int)DEB) return;
+
+  std::cout.rdbuf(Logger::redirect_stream.rdbuf());
+  std::cerr.rdbuf(Logger::redirect_stream.rdbuf());
+  shhnuisancepythiaitokay_();
+  fflush(stdout);
   fflush(stderr);
-  dup2(FitPar::silentfd, fileno(stdout));
-  dup2(FitPar::silentfd, fileno(stderr));
+  dup2(Logger::silentfd, fileno(stdout));
+  dup2(Logger::silentfd, fileno(stderr));
 }
 
-void StartTalking(){
-  std::cout.rdbuf(FitPar::default_cout);
-  std::cerr.rdbuf(FitPar::default_cerr);
-  canihazpythia_();
-  fflush(stdout); 
+void StartTalking() {
+
+  // Check verbosity set correctly
+  if (!Logger::external_verb) return;
+
+  std::cout.rdbuf(Logger::default_cout);
+  std::cerr.rdbuf(Logger::default_cerr);
+  canihaznuisancepythia_();
+  fflush(stdout);
   fflush(stderr);
-  dup2(FitPar::savedstdoutfd, fileno(stdout));
-  dup2(FitPar::savedstderrfd, fileno(stderr));
+  dup2(Logger::savedstdoutfd, fileno(stdout));
+  dup2(Logger::savedstderrfd, fileno(stderr));
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//******************************************
+void LOG_VERB(std::string verb) {
+//******************************************
+
+  if      (!verb.compare("DEB")) Logger::log_verb = -1;
+  else if (!verb.compare("QUIET")) Logger::log_verb = 0;
+  else if (!verb.compare("FIT"))  Logger::log_verb = 1;
+  else if (!verb.compare("MIN"))   Logger::log_verb = 2;
+  else if (!verb.compare("SAM"))   Logger::log_verb = 3;
+  else if (!verb.compare("REC"))   Logger::log_verb = 4;
+  else if (!verb.compare("SIG"))   Logger::log_verb = 5;
+  else if (!verb.compare("EVT"))   Logger::log_verb = 6;
+  // else Logger::log_verb = GeneralUtils::StrToInt(verb);
+
+  std::cout << "Set logging verbosity to : " << Logger::log_verb << std::endl;
+  return;
 }
 
+//******************************************
+void ERR_VERB(std::string verb) {
+//******************************************
+  std::cout << "Setting ERROR VERB" << std::endl;
+
+  if    (!verb.compare("ERRQUIET")) Logger::err_verb = 0;
+  else if (!verb.compare("FTL")) Logger::err_verb = 1;
+  else if (!verb.compare("WRN")) Logger::err_verb = 2;
+  // else Logger::err_verb = GeneralUtils::StrToInt(verb);
+
+  std::cout << "Set error verbosity to : " << Logger::err_verb << std::endl;
+  return;
+}
+
+//******************************************
+bool LOG_LEVEL(int level) {
+//******************************************
+
+  if (Logger::log_verb == (unsigned int) DEB) {
+    return true;
+  }
+
+  if (Logger::log_verb <  (unsigned int) level) {
+    return false;
+  }
+
+  return true;
+}
+
+void SET_TRACE(bool val) {
+  Logger::showtrace = val;
+}
+
+
+//******************************************
+std::ostream& _LOG(int level, const char* filename, const char* func, int line)
+//******************************************
+{
+  return __OUTLOG(level, filename, func, line);
+}
+
+//******************************************
+std::ostream& _ERR(int level, const char* filename, const char* func, int line)
+//******************************************
+{
+
+  if (Logger::use_colors) std::cerr << RED;
+
+  if (Logger::showtrace) {
+    std::cout << filename << "::" << func << "[l. " << line << "] : ";
+  }
+
+  switch (level) {
+  case FTL: std::cerr << "[ERR FATAL ]: "; break;
+  case WRN: std::cerr << "[ERR WARN  ] : "; break;
+  }
+
+  if (Logger::use_colors) std::cerr << RESET;
+
+  return *Logger::__ERR_outstream;
+}
+
+
diff --git a/src/Utils/FitLogger.h b/src/Utils/FitLogger.h
index b48f94a..ac007f6 100644
--- a/src/Utils/FitLogger.h
+++ b/src/Utils/FitLogger.h
@@ -1,118 +1,207 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef FITLOGGER_HPP
 #define FITLOGGER_HPP
+/*!
+ *  \addtogroup FitBase
+ *  @{
+ */
 
-// We still need a forward declaration of 'ostream' in order to
-// swallow templated manipulators such as 'endl'.
 #include <iosfwd>
 #include <iostream>
 #include <fstream>
 #include <sstream>
-#include "GeneralUtils.h"
+#include "Initialiser.h"
+#include "FitParameters.h"
+#include "TRandom3.h"
 
 #define RESET   "\033[0m"
 #define BLACK   "\033[30m"      /* Black */
 #define RED     "\033[31m"      /* Red */
 #define GREEN   "\033[32m"      /* Green */
 #define YELLOW  "\033[33m"      /* Yellow */
 #define BLUE    "\033[34m"      /* Blue */
 #define MAGENTA "\033[35m"      /* Magenta */
 #define CYAN    "\033[36m"      /* Cyan */
 #define WHITE   "\033[37m"      /* White */
 #define BOLDBLACK   "\033[1m\033[30m"      /* Bold Black */
 #define BOLDRED     "\033[1m\033[31m"      /* Bold Red */
 #define BOLDGREEN   "\033[1m\033[32m"      /* Bold Green */
 #define BOLDYELLOW  "\033[1m\033[33m"      /* Bold Yellow */
 #define BOLDBLUE    "\033[1m\033[34m"      /* Bold Blue */
 #define BOLDMAGENTA "\033[1m\033[35m"      /* Bold Magenta */
 #define BOLDCYAN    "\033[1m\033[36m"      /* Bold Cyan */
 #define BOLDWHITE   "\033[1m\033[37m"      /* Bold White */
 
-/*!
- *  \addtogroup FitBase
- *  @{
- */
-
-namespace FitPar{
-  extern unsigned int log_verb; //!< Current VERBOSITY
-  extern unsigned int err_verb; //!< Current ERROR VERBOSITY
-  extern bool use_colors; //!< Use BASH Terminal Colors Flag
-  extern bool super_rainbow_mode; //!< For when fitting gets boring.
-  extern unsigned int super_rainbow_mode_colour;
 
-  extern std::streambuf *default_cout; //!< Where the STDOUT stream is currently directed
-  extern std::streambuf *default_cerr; //!< Where the STDERR stream is currently directed
-  extern std::ofstream  redirect_stream; //!< Where should unwanted messages be thrown
+namespace Logger {
+extern unsigned int log_verb; //!< Current VERBOSITY
+extern unsigned int err_verb; //!< Current ERROR VERBOSITY
+extern bool external_verb;
+extern bool use_colors; //!< Use BASH Terminal Colors Flag
+extern bool super_rainbow_mode; //!< For when fitting gets boring.
+extern unsigned int super_rainbow_mode_colour;
+
+extern bool showtrace; // Quick Tracing for debugging
+extern int nloggercalls;
+extern int timelastlog;
+extern std::streambuf *default_cout; //!< Where the STDOUT stream is currently directed
+extern std::streambuf *default_cerr; //!< Where the STDERR stream is currently directed
+extern std::ofstream  redirect_stream; //!< Where should unwanted messages be thrown
 }
 
+/// Returns full path to file currently in
+#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
-extern std::ostream* logStream;
-extern std::ostream* errStream;
-extern std::ofstream nullStream;
+
+// ------ LOGGER FUNCTIONS ------------ //
+namespace Logger {
+  /// NULL Output Stream
+  extern std::ofstream __LOG_nullstream;
+
+  /// Logging Stream
+  extern std::ostream* __LOG_outstream;
+}
 
 /// Fitter VERBOSITY Enumerations
 /// These go through the different depths of the fitter.
 ///
 /// 0 QUIET - Little output.
 /// 1 FIT - Top Level Minimizer Status
 /// 2 MIN - Output from the FCN Minimizer Functions
 /// 3 SAM - Output from each of the samples during setup etc
 /// 4 REC - Output during each reconfigure. Percentage progress etc.
 /// 5 SIG - Output during every signal event that is found.
 /// 6 EVT - Output during every event.
 /// -1 DEB - Will print only debugging info wherever a LOG(DEB) statement was made
-enum log_levels { DEB=-1, QUIET, FIT, MIN, SAM, REC, SIG, EVT };
+enum __LOG_levels { DEB = -1, QUIET, FIT, MIN, SAM, REC, SIG, EVT };
+
+/// Returns log level for a given file/function
+int __GETLOG_LEVEL(int level, const char* filename, const char* funct);
+
+/// Actually runs the logger
+std::ostream& __OUTLOG(int level, const char* filename, const char* funct, int line);
+
+/// Global Logging Definitions
+#define QLOG(level, stream)                                                       \
+{                                                                                 \
+if (Logger::log_verb >= __GETLOG_LEVEL(level, __FILENAME__, __FUNCTION__)){       \
+    __OUTLOG(level, __FILENAME__, __FUNCTION__, __LINE__) << stream << std::endl; \
+}                                                                                 \
+};
+
+#define BREAK(level) \
+{                                        \                       \
+ if (Logger::log_verb >= __GETLOG_LEVEL(level, __FILENAME__, __FUNCTION__)){ \
+  __OUTLOG(level, __FILENAME__, __FUNCTION__, __LINE__) << std::endl; \
+ }\
+};
+
+
+/// Return whether logging level is valid
+bool LOGGING(int level);
+
+/// Set Global Verbosity
+void SETVERBOSITY(int level);
+
+/// Set Global Verbosity from String
+void SETVERBOSITY(std::string verb);
+
+/// Set Trace Option
+void SETTRACE(bool val);
+
+// ----------- ERROR FUNCTIONS ---------- //
+
+/// Error Stream
+extern std::ostream* __ERR_outstream;
 
 /// Fitter ERROR VERBOSITY Enumerations
 ///
 /// 0 QUIET - No Error Output
 /// 1 FTL - Show errors only if fatal
 /// 2 WRN - Show Warning messages
-enum err_levels { ERRQUIET=0, FTL, WRN };
+enum __ERR_levels { ERRQUIET = 0, FTL, WRN };
+
+/// Actually runs the error messager
+std::ostream& __OUTERR(int level, const char* filename, const char* funct, int line);
+
+/// Error Logging Function
+#define ERROR(level, stream)                                                      \
+{                                                                                 \
+    __OUTERR(level, __FILENAME__, __FUNCTION__, __LINE__) << stream << std::endl; \
+};
+
+// ----------- ERROR HANDLING ------------- //
+/// Exit the program with given error message stream
+#define THROW(stream) \
+{ \
+  __OUTERR(FTL, __FILENAME__, __FUNCTION__, __LINE__) << stream << std::endl; \
+  __OUTERR(FTL, __FILENAME__, __FUNCTION__, __LINE__) << "Exiting!" << std::endl; \
+   std::abort(); \
+}
+
+
+// ----------- External Logging ----------- //
+void SETEXTERNALVERBOSITY(int level);
+
+void StopTalking();
+void StartTalking();
+
+extern "C" {
+  void shhnuisancepythiaitokay_(void);
+  void canihaznuisancepythia_(void);
+}
+
+
+
+
+
+
+
+
+
+
+// ---------- LEGACY FUNCTIONS -------------- //
 
 bool LOG_LEVEL(int level);
 
 //! Set LOG VERBOSITY from a string
 void LOG_VERB(std::string verb);
-inline void LOG_VERB(int verb){ FitPar::log_verb = verb; };
+inline void LOG_VERB(int verb) { Logger::log_verb = verb; };
+
+void SET_TRACE(bool val);
 
 //! Set ERROR VERBOSITY from a string
 void ERR_VERB(std::string verb);
-inline void ERR_VERB(int verb){ FitPar::err_verb = verb; };
+inline void ERR_VERB(int verb) { Logger::err_verb = verb; };
 
-/// Logging Function. Use as a string stream.  e.g. LOG(SAM) << "This sample is dope." << std::endl;
-std::ostream& LOG(int level);
 
-//! Error Function. Use as a string stream.  e.g. ERR(FTL) << "The fit is completely buggered." << std::endl;
-std::ostream& ERR(int level);
+/// Logging Function. Use as a string stream.  e.g. LOG(SAM) << "This sample is dope." << std::endl;
+std::ostream& _LOG(int level, const char* filename, const char* funct, int line);
+#define LOG(level) _LOG(level, __FILENAME__, __FUNCTION__, __LINE__)
 
-void StopTalking();
 
-void StartTalking();
+//! Error Function. Use as a string stream.  e.g. ERR(FTL) << "The fit is completely buggered." << std::endl;
+std::ostream& _ERR(int level, const char* filename, const char* funct, int line);
+#define ERR(level) _ERR(level, __FILENAME__, __FUNCTION__, __LINE__)
 
-extern "C" {
-  void shhpythiaitokay_(void);
-  void canihazpythia_(void);
-}
 
 /*! @} */
-#endif // FILELOGGER_HPP
+#endif 
 
diff --git a/src/Utils/FitParameters.cxx b/src/Utils/FitParameters.cxx
index 907801b..ead4c12 100644
--- a/src/Utils/FitParameters.cxx
+++ b/src/Utils/FitParameters.cxx
@@ -1,318 +1,231 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FitParameters.h"
 
 // Initialise the static members for the parameters class
 FitParameters* FitParameters::m_fitparameterInstance = NULL;
 
 FitParameters& FitParameters::GetParams(void) {
   if (!m_fitparameterInstance) {
     m_fitparameterInstance = new FitParameters;
   }
 
   return *m_fitparameterInstance;
 };
 
 FitParameters::~FitParameters() { parameterMap_all.clear(); };
 
 FitParameters::FitParameters() {
   this->iteration = 0;
 
   std::string ext_fit_dir = GeneralUtils::GetTopLevelDir();
   this->ReadParamFile( ext_fit_dir + "/parameters/fitter.config.dat" );
 };
 
 void FitParameters::SetParamFile(std::string fileName) {
   parFileName = fileName;
   return;
 }
 
 // Parameter File Parser
 void FitParameters::ReadParamFile(std::string fileName) {
   std::string line;
   std::ifstream card(fileName.c_str(), ifstream::in);
 
   while (std::getline(card >> std::ws, line, '\n')) {
 
     std::vector<std::string> inputlist = GeneralUtils::ParseToStr(line, " ");
 
     // Check the line length
     if (inputlist.size() < 3) continue;
 
     // Check whether this is a comment
     if (inputlist[0].c_str()[0] == '#') continue;
 
     // Check whether this is a relevant line
     if (inputlist[0].compare("config") != 0) continue;
 
     std::string parName  = inputlist[1];
     std::string parEntry = inputlist[2];
     if (parameterMap_all.find(parName) == parameterMap_all.end())
       parameterMap_all.insert(
-			      std::map<std::string, std::string>::value_type(parName, parEntry));
+        std::map<std::string, std::string>::value_type(parName, parEntry));
     else
       parameterMap_all[parName] = parEntry;
 
   }
   card.close();
   return;
 }
 
 // Used to override a parameter by the command line
 void FitParameters::ForceParam(std::string parOption) {
   unsigned first = parOption.find("=");
   std::string parName = parOption.substr(0, first);
   std::string parEntry = parOption.substr(first + 1, parOption.size());
 
-  LOG(REC) << "Read in Parameter Override : " << parName << " = " << parEntry
-            << std::endl;
+  // LOG(REC) << "Read in Parameter Override : " << parName << " = " << parEntry
+  // << std::endl;
 
   parameterMap_all.insert(
-      std::map<std::string, std::string>::value_type(parName, parEntry));
+    std::map<std::string, std::string>::value_type(parName, parEntry));
   if (parameterMap_all.find(parName) == parameterMap_all.end())
     parameterMap_all.insert(
       std::map<std::string, std::string>::value_type(parName, parEntry));
   else
     parameterMap_all[parName] = parEntry;
 
   return;
 };
 
 void FitParameters::SetParB(std::string parName, bool val) {
   if (parameterMap_bool.find(parName) != parameterMap_bool.end()) {
     parameterMap_bool[parName] = val;
   } else {
     parameterMap_bool.insert(std::map<std::string, bool>::value_type(parName, val));
   }
 
   return;
 }
 
 void FitParameters::SetParD(std::string parName, double val) {
   // Check if it is saved in int map
   if (parameterMap_double.find(parName) != parameterMap_double.end()) {
     parameterMap_double[parName] = val;
   } else {
     parameterMap_double.insert(
-       std::map<std::string, double>::value_type(parName, val));
+      std::map<std::string, double>::value_type(parName, val));
   }
   return;
 }
 
 void FitParameters::SetParI(std::string parName, int val) {
   // Check if it is saved in int map
   if (parameterMap_int.find(parName) != parameterMap_int.end()) {
     parameterMap_int[parName] = val;
   } else {
     parameterMap_int.insert(std::map<std::string, int>::value_type(parName, val));
   }
   return;
 }
 
 // Parameter fetch commands
 int FitParameters::GetParI(std::string parName) {
-  if (parName == "VERBOSITY") {
-    if (parameterMap_all.find(parName) != parameterMap_all.end()) {
-      int tempVal = 1;
-      std::string verb = parameterMap_all.at(parName);
-
-      if (!verb.compare("DEB"))
-        tempVal = -1;
-      else if (!verb.compare("QUIET"))
-        tempVal = 0;
-      else if (!verb.compare("FIT"))
-        tempVal = 1;
-      else if (!verb.compare("MIN"))
-        tempVal = 2;
-      else if (!verb.compare("SAM"))
-        tempVal = 3;
-      else if (!verb.compare("REC"))
-        tempVal = 4;
-      else if (!verb.compare("SIG"))
-        tempVal = 5;
-      else if (!verb.compare("EVT"))
-        tempVal = 6;
-      else
-	tempVal = GeneralUtils::StrToInt(parameterMap_all[parName]);
-
-      // Convert.
-      parameterMap_int.insert(
-	std::map<std::string, int>::value_type(parName, tempVal));
-
-    } else {
-      return 1;  // If no parameter set for verbosity assume FIT
-    }
-  }
-
-  // Check if it is saved in int map
-  if (parameterMap_int.find(parName) != parameterMap_int.end()) {
-    return parameterMap_int[parName];
-
-    // Check if it is in the entire map
-  } else if (parameterMap_all.find(parName) != parameterMap_all.end()) {
-    int tempVal = GeneralUtils::StrToInt(parameterMap_all[parName]);
-
-    parameterMap_int.insert(
-	std::map<std::string, int>::value_type(parName, tempVal));
-    return tempVal;
-
-  } else {
-    LOG(DEB)<<"Parameter: "<<parName<<" not found in requirements file."<<std::endl;
-    return -999;
-  }
+  return Config::Get().ConfI(parName);
 };
 
 // Parameter fetch commands
 bool FitParameters::GetParB(std::string parName) {
-  // Check if it is saved in bool map
-  if (parameterMap_bool.find(parName) != parameterMap_bool.end()) {
-    return parameterMap_bool[parName];
-
-    // Check if it is in the entire map
-  } else if (parameterMap_all.find(parName) != parameterMap_all.end()) {
-
-    bool tempVal = GeneralUtils::StrToBool(parameterMap_all[parName]);
-
-    parameterMap_bool.insert(
-        std::map<std::string, bool>::value_type(parName, tempVal));
-    return tempVal;
-
-  } else {
-    LOG(DEB)<<"Parameter: "<<parName<<" not found in requirements file."<<std::endl;
-    parameterMap_bool.insert(
-	std::map<std::string, bool>::value_type(parName, false));
-    return false;
-  }
+  return Config::Get().ConfB(parName);
 };
 
 double FitParameters::GetParD(std::string parName) {
-  // Check if it is saved in int map
-  if (parameterMap_double.find(parName) != parameterMap_double.end()) {
-    return parameterMap_double[parName];
-
-    // Check if it is in the entire map
-  } else if (parameterMap_all.find(parName) != parameterMap_all.end()) {
-    double tempVal = GeneralUtils::StrToDbl(parameterMap_all[parName]);
-
-    parameterMap_double.insert(
-        std::map<std::string, double>::value_type(parName, tempVal));
-    return tempVal;
-
-  } else {
-    LOG(DEB)<<"Parameter: "<<parName<<" not found in requirements file."<<std::endl;
-    return -999.9;
-  }
+  return Config::Get().ConfD(parName);
 };
 
 std::string FitParameters::GetParS(std::string parName) {
-  // Check if it is saved in int map
-  if (parameterMap_all.find(parName) != parameterMap_all.end()) {
-    return parameterMap_all[parName];
-
-  } else {
-    LOG(DEB)<<"Parameter: "<<parName<<" not found in requirements file."<<std::endl;
-    return "";
-  }
+  return Config::Get().ConfS(parName);
 };
 
 
-std::string FitParameters::GetParDIR(std::string parName){
+std::string FitParameters::GetParDIR(std::string parName) {
 
   std::string outstr = this->GetParS(parName);
 
   // Make replacements in the string
   const int nfiletypes = 2;
-  const std::string filetypes[nfiletypes] = {"@data","@nuisance"};
+  const std::string filetypes[nfiletypes] = {"@data", "@nuisance"};
   std::string filerepl[nfiletypes] = { FitPar::GetDataBase(),
-				       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;
 };
 
 
 std::string FitParameters::GetAllParametersArg() {
   std::map<std::string, std::string>::iterator mystr = parameterMap_all.begin();
   std::string longlist = "";
 
   for (; mystr != parameterMap_all.end(); mystr++) {
     longlist += "-q " + mystr->first + "=" + mystr->second + " ";
   }
 
   return longlist;
 }
 
 void FitParameters::MakeParameterCard(std::string filename) {
   ofstream parcard;
   parcard.open((filename).c_str(), std::ios::out);
   std::map<std::string, std::string>::iterator mystr = parameterMap_all.begin();
 
   for (; mystr != parameterMap_all.end(); mystr++) {
     std::string name = (mystr->first);
     parcard << "config " << name << " ";
 
     if (parameterMap_int.find(name) != parameterMap_int.end())
       parcard << parameterMap_int.at(name);
     else if (parameterMap_double.find(name) != parameterMap_double.end())
       parcard << parameterMap_double.at(name);
     else if (parameterMap_string.find(name) != parameterMap_string.end())
       parcard << parameterMap_string.at(name);
     else if (parameterMap_all.find(name) != parameterMap_all.end())
       parcard << parameterMap_all.at(name);
     parcard << "\n";
   }
 
   parcard.close();
 
   return;
 }
 
-void FitParameters::Write(){
+void FitParameters::Write() {
 
   // Loop through parameters
   /*  TTree* tr = new TTree("fit_header","fit_header");
   tr->Branch("par_name",  &parNames);
   tr->Branch("par_value", &parValues);
   tr->Branch("card_input", &cardLines);
   tr->Fill();
 
   tr->Write();
   */
   return;
 }
 
 // Global Access Namespace
 //! Namespace to allow singletons to be accessed easily
 namespace FitPar {
 
 //! Returns FitParameters singleton. Usually used for parameters,
 //! e.g. FitPar::Config().GetParI("input.maxevents")
 FitParameters& Config() { return FitParameters::GetParams(); };
 
-  std::string GetDataBase(){ return GeneralUtils::GetTopLevelDir() + "/data/"; };
+std::string GetDataBase() { return GeneralUtils::GetTopLevelDir() + "/data/"; };
 }
diff --git a/src/Utils/FitParameters.h b/src/Utils/FitParameters.h
index 3e808f0..b7261a5 100644
--- a/src/Utils/FitParameters.h
+++ b/src/Utils/FitParameters.h
@@ -1,125 +1,128 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef FITPARAMETERS_H_SEEN
 #define FITPARAMETERS_H_SEEN
 
 #include <math.h>
 #include <stdlib.h>
 #include <cstring>
 #include <fstream>
 #include <iostream>
 #include <map>
 #include <numeric>
 #include <sstream>
 #include <sstream>
 #include <string>
 #include <vector>
 
 #include "TTree.h"
 #include "TFile.h"
 #include "TGraph.h"
 
 #include "GeneralUtils.h"
-#include "FitLogger.h"
-
+// #include "FitLogger.h"
+#include "NuisConfig.h"
+#include "NuisKey.h"
 //using namespace std;
 
 /*!
  *  \addtogroup FitBase
  *  @{
  */
 
 //! Singleton class to allow easy reading and modification of configuration
 //! parameters
 class FitParameters {
  public:
   static FitParameters& GetParams(void);
 
   virtual ~FitParameters();
 
   FitParameters();
 
   void SetParamFile(std::string fileName);
   // Parameter File Parser
   void ReadParamFile(std::string fileName);
 
   // Used to override a parameter by the command line
   void ForceParam(std::string parOption);
 
   void SetParB(std::string parName, bool val);
 
   void SetParD(std::string parName, double val);
 
   void SetParI(std::string parName, int val);
 
   // Parameter fetch commands
   int GetParI(std::string parName);
 
   // Parameter fetch commands
   bool GetParB(std::string parName);
 
   double GetParD(std::string parName);
 
   std::string GetParS(std::string parName);
 
   std::string GetParDIR(std::string parName);
   
   // Variables
   std::string parFileName;
   std::map<std::string, std::string> parameterMap_all;
 
   std::string GetAllParametersArg();
 
   void MakeParameterCard(std::string filename);
   
   void Write();
 
   TFile* out;  // pointer to output file
   std::string outputname;
   std::map<std::string, int> parameterMap_int;
   std::map<std::string, double> parameterMap_double;
   std::map<std::string, std::string> parameterMap_string;
   std::map<std::string, bool> parameterMap_bool;
 
   std::vector<std::string> parNames;
   std::vector<std::string> parValues;
   std::vector<std::string> cardLines;
   int iteration;
 
  protected:
   static FitParameters* m_fitparameterInstance;
 };
 
 
 // Global Access Namespace
 //! Namespace to allow singletons to be accessed easily
 namespace FitPar {
 
 //! Returns FitParameters singleton. Usually used for parameters,
 //! e.g. FitPar::Config().GetParI("input.maxevents")
 FitParameters& Config();
 
-
 //! Return Fitter DataBase
 std::string GetDataBase();
 }
 
+
 /*! @} */
 #endif
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret  
+
diff --git a/src/Utils/FitUtils.cxx b/src/Utils/FitUtils.cxx
index 97a0081..16b0802 100644
--- a/src/Utils/FitUtils.cxx
+++ b/src/Utils/FitUtils.cxx
@@ -1,804 +1,782 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #include "FitUtils.h"
 
 /*
   MISC Functions
 */
 
-
 //********************************************************************
 double *FitUtils::GetArrayFromMap(std::vector<std::string> invals,
                                   std::map<std::string, double> inmap) {
   //********************************************************************
 
   double *outarr = new double[invals.size()];
   int count = 0;
 
   for (size_t i = 0; i < invals.size(); i++) {
     outarr[count++] = inmap[invals.at(i)];
   }
 
   return outarr;
 }
 /*
   MISC Event
 */
 
 //********************************************************************
 // Returns the kinetic energy of a particle in GeV
 double FitUtils::T(TLorentzVector part) {
   //********************************************************************
   double E_part = part.E() / 1000.;
   double p_part = part.Vect().Mag() / 1000.;
   double m_part = sqrt(E_part * E_part - p_part * p_part);
 
   double KE_part = E_part - m_part;
   return KE_part;
 };
 
 //********************************************************************
 // Returns the momentum of a particle in GeV
 double FitUtils::p(TLorentzVector part) {
   //********************************************************************
   double p_part = part.Vect().Mag() / 1000.;
   return p_part;
 };
 
 double FitUtils::p(FitParticle* part) {
   return FitUtils::p(part->fP);
 };
 
 
 //********************************************************************
 // Returns the angle between two particles in radians
 double FitUtils::th(TLorentzVector part1, TLorentzVector part2) {
   //********************************************************************
   double th = part1.Vect().Angle(part2.Vect());
   return th;
 };
 
 double FitUtils::th(FitParticle* part1, FitParticle* part2) {
   return FitUtils::th(part1->fP, part2->fP);
 };
 
 // T2K CC1pi+ helper functions
 //
 //********************************************************************
 // Returns the angle between q3 and the pion defined in Raquel's CC1pi+ on CH
 // paper
 // Uses "MiniBooNE formula" for Enu, here called EnuCC1pip_T2K_MB
 //********************************************************************
 double FitUtils::thq3pi_CC1pip_T2K(TLorentzVector pnu, TLorentzVector pmu,
                                    TLorentzVector ppi) {
   // Want this in GeV
   TVector3 p_mu = pmu.Vect() * (1. / 1000.);
 
   // Get the reconstructed Enu
   // We are not using Michel e sample, so we have pion kinematic information
   double Enu = EnuCC1piprec(pnu, pmu, ppi, true);
 
   // Get neutrino unit direction, multiply by reconstructed Enu
   TVector3 p_nu = pnu.Vect() * (1. / (pnu.Vect().Mag())) * Enu;
   TVector3 p_pi = ppi.Vect() * (1. / 1000.);
 
   // This is now in GeV
   TVector3 q3 = (p_nu - p_mu);
   // Want this in GeV
 
   double th_q3_pi = q3.Angle(p_pi);
 
   return th_q3_pi;
 }
 
 //********************************************************************
 // Returns the q3 defined in Raquel's CC1pi+ on CH paper
 // Uses "MiniBooNE formula" for Enu
 //********************************************************************
 double FitUtils::q3_CC1pip_T2K(TLorentzVector pnu, TLorentzVector pmu,
                                TLorentzVector ppi) {
   // Can't use the true Enu here; need to reconstruct it
   // We do have Michel e- here so reconstruct Enu by "MiniBooNE formula" without
   // pion kinematics
   // The bool false refers to that we don't have pion kinematics
   // Last bool refers to if we have pion kinematic information or not
   double Enu = EnuCC1piprec(pnu, pmu, ppi, false);
 
   TVector3 p_mu = pmu.Vect() * (1. / 1000.);
   TVector3 p_nu = pnu.Vect() * (1. / pnu.Vect().Mag()) * Enu;
 
   double q3 = (p_nu - p_mu).Mag();
 
   return q3;
 }
 
 
 //********************************************************************
 // Returns the W reconstruction from Raquel CC1pi+ CH thesis
 // Uses the MiniBooNE formula Enu
 //********************************************************************
 double FitUtils::WrecCC1pip_T2K_MB(TLorentzVector pnu, TLorentzVector pmu,
                                    TLorentzVector ppi) {
   double E_mu = pmu.E() / 1000.;
   double p_mu = pmu.Vect().Mag() / 1000.;
   double E_nu = EnuCC1piprec(pnu, pmu, ppi, false);
 
   double a1 = (E_nu + PhysConst::mass_neutron) - E_mu;
   double a2 = E_nu - p_mu;
 
   double wrec = sqrt(a1 * a1 - a2 * a2);
 
   return wrec;
 }
 
 //********************************************************
 double FitUtils::ProtonQ2QErec(double pE, double binding) {
   //********************************************************
 
   const double V = binding / 1000.;           // binding potential
   const double mn = PhysConst::mass_neutron;  // neutron mass
   const double mp = PhysConst::mass_proton;   // proton mass
   const double mn_eff = mn - V;               // effective proton mass
   const double pki = (pE / 1000.0) - mp;
 
   double q2qe = mn_eff * mn_eff - mp * mp + 2 * mn_eff * (pki + mp - mn_eff);
 
   return q2qe;
 };
 
 //********************************************************************
 double FitUtils::EnuQErec(TLorentzVector pmu, double costh, double binding,
                           bool neutrino) {
-  //********************************************************************
-
-  double momshift = 0.0;
-  double temp = FitPar::Config().GetParD("muon_momentum_shift");
-  if (temp != -999.9 and temp != 0.0) {
-    if (FitPar::Config().GetParI("muon_momentum_throw") == 0)
-      momshift = temp;
-    else if (FitPar::Config().GetParI("muon_momentum_throw") == 1) {
-      momshift = gRandom->Gaus(0.0, 1.0) * temp;
-    }
-  }
+//********************************************************************
 
+ 
   // Convert all values to GeV
   const double V = binding / 1000.;           // binding potential
   const double mn = PhysConst::mass_neutron;  // neutron mass
   const double mp = PhysConst::mass_proton;   // proton mass
 
   double mN_eff = mn - V;
   double mN_oth = mp;
 
   if (!neutrino) {
     mN_eff = mp - V;
     mN_oth = mn;
   }
 
   double el = pmu.E() / 1000.;
   double pl = (pmu.Vect().Mag()) / 1000.;  // momentum of lepton
   double ml = sqrt(el * el - pl * pl);     // lepton mass
-  pl += momshift;
 
   double rEnu =
       (2 * mN_eff * el - ml * ml + mN_oth * mN_oth - mN_eff * mN_eff) /
       (2 * (mN_eff - el + pl * costh));
 
   return rEnu;
 };
 
 double FitUtils::Q2QErec(TLorentzVector pmu, double costh, double binding,
                          bool neutrino) {
-  double momshift = 0.0;
-  double temp = FitPar::Config().GetParD("muon_momentum_shift");
-  if (temp != -999.9 and temp != 0.0) {
-    if (FitPar::Config().GetParI("muon_momentum_throw") == 0)
-      momshift = temp;
-    else if (FitPar::Config().GetParI("muon_momentum_throw") == 1) {
-      momshift = gRandom->Gaus(0.0, 1.0) * temp;
-    }
-  }
 
   double el = pmu.E() / 1000.;
   double pl = (pmu.Vect().Mag()) / 1000.;  // momentum of lepton
   double ml = sqrt(el * el - pl * pl);     // lepton mass
-  pl += momshift / 1000.;
 
   double rEnu = EnuQErec(pmu, costh, binding, neutrino);
   double q2 = -ml * ml + 2. * rEnu * (el - pl * costh);
 
   return q2;
 };
 
 
 double FitUtils::EnuQErec(double pl, double costh, double binding,
                           bool neutrino) {
 
   if (pl < 0) return 0.; // Make sure nobody is silly
 
   double momshift = 0.0;
   double temp = FitPar::Config().GetParD("muon_momentum_shift");
   if (temp != -999.9 and temp != 0.0) {
     if (FitPar::Config().GetParI("muon_momentum_throw") == 0)
       momshift = temp;
     else if (FitPar::Config().GetParI("muon_momentum_throw") == 1) {
       momshift = gRandom->Gaus(0.0, 1.0) * temp;
     }
   }
 
   double mN_eff = PhysConst::mass_neutron - binding/1000.;
   double mN_oth = PhysConst::mass_proton;
 
   if (!neutrino) {
     mN_eff = PhysConst::mass_proton - binding/1000.;
     mN_oth = PhysConst::mass_neutron;
   }
   double ml = PhysConst::mass_muon;
   double el = sqrt(pl*pl + ml*ml);
   pl += momshift;
 
   double rEnu =
     (2 * mN_eff * el - ml * ml + mN_oth * mN_oth - mN_eff * mN_eff) /
     (2 * (mN_eff - el + pl * costh));
 
   return rEnu;
 };
 
 double FitUtils::Q2QErec(double pl, double costh, double binding,
                          bool neutrino) {
 
   if (pl < 0) return 0.; // Make sure nobody is silly
 
   double momshift = 0.0;
   double temp = FitPar::Config().GetParD("muon_momentum_shift");
   if (temp != -999.9 and temp != 0.0) {
     if (FitPar::Config().GetParI("muon_momentum_throw") == 0)
       momshift = temp;
     else if (FitPar::Config().GetParI("muon_momentum_throw") == 1) {
       momshift = gRandom->Gaus(0.0, 1.0) * temp;
     }
   }
 
   double ml = PhysConst::mass_muon;
   double el = sqrt(pl*pl + ml*ml);
 
   pl += momshift / 1000.;
 
   double rEnu = EnuQErec(pl, costh, binding, neutrino);
   double q2 = -ml * ml + 2. * rEnu * (el - pl * costh);
 
   return q2;
 };
 
 
 //********************************************************************
 // Reconstructs Enu for CC1pi0
 // Very similar for CC1pi+ reconstruction
 double FitUtils::EnuCC1pi0rec(TLorentzVector pnu, TLorentzVector pmu,
                               TLorentzVector ppi0) {
   //********************************************************************
 
   double E_mu = pmu.E() / 1000;
   double p_mu = pmu.Vect().Mag() / 1000;
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   double E_pi0 = ppi0.E() / 1000;
   double p_pi0 = ppi0.Vect().Mag() / 1000;
   double m_pi0 = sqrt(E_pi0 * E_pi0 - p_pi0 * p_pi0);
   double th_nu_pi0 = pnu.Vect().Angle(ppi0.Vect());
 
   const double m_n = PhysConst::mass_neutron;  // neutron mass
   const double m_p = PhysConst::mass_proton;   // proton mass
   double th_pi0_mu = ppi0.Vect().Angle(pmu.Vect());
 
   double rEnu = (m_mu * m_mu + m_pi0 * m_pi0 + m_n * m_n - m_p * m_p -
                  2 * m_n * (E_pi0 + E_mu) + 2 * E_pi0 * E_mu -
                  2 * p_pi0 * p_mu * cos(th_pi0_mu)) /
                 (2 * (E_pi0 + E_mu - p_pi0 * cos(th_nu_pi0) -
                       p_mu * cos(th_nu_mu) - m_n));
 
   return rEnu;
 };
 
 //********************************************************************
 // Reconstruct Q2 for CC1pi0
 // Beware: uses true Enu, not reconstructed Enu
 double FitUtils::Q2CC1pi0rec(TLorentzVector pnu, TLorentzVector pmu,
                              TLorentzVector ppi0) {
   //********************************************************************
 
   double E_mu = pmu.E() / 1000.;                  // energy of lepton in GeV
   double p_mu = pmu.Vect().Mag() / 1000.;         // momentum of lepton
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);  // lepton mass
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   // double rEnu = EnuCC1pi0rec(pnu, pmu, ppi0); //reconstructed neutrino energy
   // Use true neutrino energy
   double rEnu = pnu.E() / 1000.;
   double q2 = -m_mu * m_mu + 2. * rEnu * (E_mu - p_mu * cos(th_nu_mu));
 
   return q2;
 };
 
 //********************************************************************
 // Reconstruct Enu for CC1pi+
 // pionInfo reflects if we're using pion kinematics or not
 // In T2K CC1pi+ CH the Michel tag is used for pion in which pion kinematic info
 // is lost and Enu is reconstructed without pion kinematics
 double FitUtils::EnuCC1piprec(TLorentzVector pnu, TLorentzVector pmu,
                               TLorentzVector ppi, bool pionInfo) {
   //********************************************************************
 
   double E_mu = pmu.E() / 1000.;
   double p_mu = pmu.Vect().Mag() / 1000.;
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);
 
   double E_pi = ppi.E() / 1000.;
   double p_pi = ppi.Vect().Mag() / 1000.;
   double m_pi = sqrt(E_pi * E_pi - p_pi * p_pi);
 
   const double m_n = PhysConst::mass_neutron;  // neutron/proton mass
   // should really take proton mass for proton interaction, neutron for neutron
   // interaction. However, difference is pretty much negligable here!
 
   // need this angle too
   double th_nu_pi = pnu.Vect().Angle(ppi.Vect());
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
   double th_pi_mu = ppi.Vect().Angle(pmu.Vect());
 
   double rEnu = -999;
   // If experiment doesn't have pion kinematic information (T2K CC1pi+ CH
   // example of this; Michel e sample has no directional information on pion)
   // We'll need to modify the reconstruction variables
   if (!pionInfo) {
     // Assumes that pion angle contribution contributes net zero
     // Also assumes the momentum of reconstructed pions when using Michel
     // electrons is 130 MeV
     // So need to redefine E_pi and p_pi
     // It's a little unclear what happens to the pmu . ppi term (4-vector); do
     // we include the angular contribution?
     // This below doesn't
     th_nu_pi = M_PI / 2.;
     p_pi = 0.130;
     E_pi = sqrt(p_pi * p_pi + m_pi * m_pi);
     // rEnu = (m_mu*m_mu + m_pi*m_pi - 2*m_n*(E_mu + E_pi) + 2*E_mu*E_pi -
     // 2*p_mu*p_pi) / (2*(E_mu + E_pi - p_mu*cos(th_nu_mu) - m_n));
   }
 
   rEnu =
       (m_mu * m_mu + m_pi * m_pi - 2 * m_n * (E_pi + E_mu) + 2 * E_pi * E_mu -
        2 * p_pi * p_mu * cos(th_pi_mu)) /
       (2 * (E_pi + E_mu - p_pi * cos(th_nu_pi) - p_mu * cos(th_nu_mu) - m_n));
 
   return rEnu;
 };
 
 //********************************************************************
 // Reconstruct neutrino energy from outgoing particles; will differ from the
 // actual neutrino energy. Here we use assumption of a Delta resonance
 double FitUtils::EnuCC1piprecDelta(TLorentzVector pnu, TLorentzVector pmu) {
   //********************************************************************
 
   const double m_Delta =
       PhysConst::mass_delta;  // PDG value for Delta mass in GeV
   const double m_n = PhysConst::mass_neutron;  // neutron/proton mass
   // should really take proton mass for proton interaction, neutron for neutron
   // interaction. However, difference is pretty much negligable here!
 
   double E_mu = pmu.E() / 1000;
   double p_mu = pmu.Vect().Mag() / 1000;
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   double rEnu = (m_Delta * m_Delta - m_n * m_n - m_mu * m_mu + 2 * m_n * E_mu) /
                 (2 * (m_n - E_mu + p_mu * cos(th_nu_mu)));
 
   return rEnu;
 };
 
 // MOVE TO T2K UTILS!
 //********************************************************************
 // Reconstruct Enu using "extended MiniBooNE" as defined in Raquel's T2K TN
 //
 // Supposedly includes pion direction and binding energy of target nucleon
 // I'm not convinced (yet), maybe
 double FitUtils::EnuCC1piprec_T2K_eMB(TLorentzVector pnu, TLorentzVector pmu,
                                       TLorentzVector ppi) {
   //********************************************************************
 
   // Unit vector for neutrino momentum
   TVector3 p_nu_vect_unit = pnu.Vect() * (1. / pnu.E());
 
   double E_mu = pmu.E() / 1000.;
   TVector3 p_mu_vect = pmu.Vect() * (1. / 1000.);
 
   double E_pi = ppi.E() / 1000.;
   TVector3 p_pi_vect = ppi.Vect() * (1. / 1000.);
 
   double E_bind =
       27. / 1000.;  // This should be roughly correct for CH; but not clear!
   double m_p = PhysConst::mass_proton;
 
   // Makes life a little easier, gonna square this one
   double a1 = m_p - E_bind - E_mu - E_pi;
   // Just gets the magnitude square of the muon and pion momentum vectors
   double a2 = (p_mu_vect + p_pi_vect).Mag2();
   // Gets the somewhat complicated scalar product between neutrino and
   // (p_mu+p_pi), scaled to Enu
   double a3 = p_nu_vect_unit * (p_mu_vect + p_pi_vect);
 
   double rEnu =
       (m_p * m_p - a1 * a1 + a2) / (2 * (m_p - E_bind - E_mu - E_pi + a3));
 
   return rEnu;
 }
 
 //********************************************************************
 // Reconstructed Q2 for CC1pi+
 //
 // enuType describes how the neutrino energy is reconstructed
 // 0 uses true neutrino energy; case for MINERvA and MiniBooNE
 // 1 uses "extended MiniBooNE" reconstructed (T2K CH)
 // 2 uses "MiniBooNE" reconstructed (EnuCC1piprec with pionInfo = true) (T2K CH)
 //        "MiniBooNE" reconstructed (EnuCC1piprec with pionInfo = false, the
 //        case for T2K when using Michel tag) (T2K CH)
 // 3 uses Delta for reconstruction (T2K CH)
 double FitUtils::Q2CC1piprec(TLorentzVector pnu, TLorentzVector pmu,
                              TLorentzVector ppi, int enuType, bool pionInfo) {
   //********************************************************************
 
   double E_mu = pmu.E() / 1000.;                  // energy of lepton in GeV
   double p_mu = pmu.Vect().Mag() / 1000.;         // momentum of lepton
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);  // lepton mass
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   // Different ways of reconstructing the neutrino energy; default is just to
   // use the truth (case 0)
   double rEnu = -999;
 
   switch (enuType) {
     case 0:  // True neutrino energy, default; this is the case for when Q2
              // defined as Q2 true (MiniBooNE, MINERvA)
       rEnu = pnu.E() / 1000.;
       break;
     case 1:  // Extended MiniBooNE reconstructed, as defined by Raquel's CC1pi+
              // CH T2K analysis
              // Definitely uses pion info :)
       rEnu = EnuCC1piprec_T2K_eMB(pnu, pmu, ppi);
       break;
     case 2:  // MiniBooNE reconstructed, as defined by MiniBooNE and Raquel's
              // CC1pi+ CH T2K analysis and Linda's CC1pi+ H2O
       // Can have this with and without pion info, depending on if Michel tag
       // used (Raquel)
       rEnu = EnuCC1piprec(pnu, pmu, ppi, pionInfo);
       break;
     case 3:
       rEnu = EnuCC1piprecDelta(pnu, pmu);
       break;
 
   }  // No need for default here since default value of enuType = 0, defined in
      // header
 
   double q2 = -m_mu * m_mu + 2. * rEnu * (E_mu - p_mu * cos(th_nu_mu));
 
   return q2;
 };
 
 //********************************************************************
 // Returns the reconstructed W from a nucleon and an outgoing pion
 //
 // Could do this a lot more clever (pp + ppi).Mag() would do the job, but this
 // would be less instructive
 //********************************************************************
 double FitUtils::MpPi(TLorentzVector pp, TLorentzVector ppi) {
   double E_p = pp.E();
   double p_p = pp.Vect().Mag();
   double m_p = sqrt(E_p * E_p - p_p * p_p);
 
   double E_pi = ppi.E();
   double p_pi = ppi.Vect().Mag();
   double m_pi = sqrt(E_pi * E_pi - p_pi * p_pi);
 
   double th_p_pi = pp.Vect().Angle(ppi.Vect());
 
   // fairly easy thing to derive since bubble chambers measure the proton!
   double invMass = sqrt(m_p * m_p + m_pi * m_pi + 2 * E_p * E_pi -
                         2 * p_pi * p_p * cos(th_p_pi));
 
   return invMass;
 };
 
 //********************************************************
 
 // Reconstruct the hadronic mass using neutrino and muon
 // Could technically do E_nu = EnuCC1pipRec(pnu,pmu,ppi) too, but this wwill be
 // reconstructed Enu; so gives reconstructed Wrec which most of the time isn't
 // used!
 //
 // Only MINERvA uses this so far; and the Enu is Enu_true
 // If we want W_true need to take initial state nucleon motion into account
 // Return value is in MeV!!!
 double FitUtils::Wrec(TLorentzVector pnu, TLorentzVector pmu) {
   //********************************************************
 
   double E_mu = pmu.E();
   double p_mu = pmu.Vect().Mag();
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   // The factor of 1000 is necessary for downstream functions
   const double m_p = PhysConst::mass_proton * 1000;
 
   // MINERvA cut on W_exp which is tuned to W_true; so use true Enu from
   // generators
   double E_nu = pnu.E();
 
   double w_rec = sqrt(m_p * m_p + m_mu * m_mu - 2 * m_p * E_mu +
                       2 * E_nu * (m_p - E_mu + p_mu * cos(th_nu_mu)));
 
   return w_rec;
 };
 
 //********************************************************
 // Reconstruct the true hadronic mass using the initial state and muon
 // Could technically do E_nu = EnuCC1pipRec(pnu,pmu,ppi) too, but this wwill be
 // reconstructed Enu; so gives reconstructed Wrec which most of the time isn't
 // used!
 //
 // No one seems to use this because it's fairly MC dependent!
 // Return value is in MeV!!!
 double FitUtils::Wtrue(TLorentzVector pnu, TLorentzVector pmu,
                        TLorentzVector pnuc) {
   //********************************************************
 
   // Could simply do the TLorentzVector operators here but this is more
   // instructive?
   // ... and prone to errors ...
 
   double E_mu = pmu.E();
   double p_mu = pmu.Vect().Mag();
   double m_mu = sqrt(E_mu * E_mu - p_mu * p_mu);
   double th_nu_mu = pnu.Vect().Angle(pmu.Vect());
 
   double E_nuc = pnuc.E();
   double p_nuc = pnuc.Vect().Mag();
   double m_nuc = sqrt(E_nuc * E_nuc - p_nuc * p_nuc);
   double th_nuc_mu = pmu.Vect().Angle(pnuc.Vect());
   double th_nu_nuc = pnu.Vect().Angle(pnuc.Vect());
 
   double E_nu = pnu.E();
 
   double w_rec = sqrt(m_nuc * m_nuc + m_mu * m_mu - 2 * E_nu * E_mu +
                       2 * E_nu * p_mu * cos(th_nu_mu) - 2 * E_nuc * E_mu +
                       2 * p_nuc * p_mu * cos(th_nuc_mu) + 2 * E_nu * E_nuc -
                       2 * E_nu * p_nuc * cos(th_nu_nuc));
 
   return w_rec;
 };
 
 /*
   E Recoil
 */
 double FitUtils::GetErecoil_TRUE(FitEvent *event) {
   // Get total energy of hadronic system.
   double Erecoil = 0.0;
   for (unsigned int i = 2; i < event->Npart(); i++) {
     // Only final state
     if (!event->PartInfo(i)->fIsAlive) continue;
     if (event->PartInfo(i)->fNEUTStatusCode != 0) continue;
 
     // Skip Lepton
     if (abs(event->PartInfo(i)->fPID) == abs(event->PartInfo(0)->fPID) - 1)
       continue;
 
     // Add Up KE of protons and TE of everything else
     if (event->PartInfo(i)->fPID == 2212 || event->PartInfo(i)->fPID == 2112) {
       Erecoil +=
           fabs(event->PartInfo(i)->fP.E()) - fabs(event->PartInfo(i)->fP.Mag());
     } else {
       Erecoil += event->PartInfo(i)->fP.E();
     }
   }
 
   return Erecoil;
 }
 
 double FitUtils::GetErecoil_CHARGED(FitEvent *event) {
   // Get total energy of hadronic system.
   double Erecoil = 0.0;
   for (unsigned int i = 2; i < event->Npart(); i++) {
     // Only final state
     if (!event->PartInfo(i)->fIsAlive) continue;
     if (event->PartInfo(i)->fNEUTStatusCode != 0) continue;
 
     // Skip Lepton
     if (abs(event->PartInfo(i)->fPID) == abs(event->PartInfo(0)->fPID) - 1)
       continue;
 
     // Skip Neutral particles
     if (event->PartInfo(i)->fPID == 2112 || event->PartInfo(i)->fPID == 111 ||
         event->PartInfo(i)->fPID == 22)
       continue;
 
     // Add Up KE of protons and TE of everything else
     if (event->PartInfo(i)->fPID == 2212) {
       Erecoil +=
           fabs(event->PartInfo(i)->fP.E()) - fabs(event->PartInfo(i)->fP.Mag());
     } else {
       Erecoil += event->PartInfo(i)->fP.E();
     }
   }
 
   return Erecoil;
 }
 
 // MOVE TO MINERVA Utils!
 double FitUtils::GetErecoil_MINERvA_LowRecoil(FitEvent *event) {
   // Get total energy of hadronic system.
   double Erecoil = 0.0;
 
   for (unsigned int i = 2; i < event->Npart(); i++) {
     // Only final state
     if (!event->PartInfo(i)->fIsAlive) continue;
     if (event->PartInfo(i)->fNEUTStatusCode != 0) continue;
 
     // Skip Lepton
     if (abs(event->PartInfo(i)->fPID) == 13) continue;
 
     // Skip Neutrons particles
     if (event->PartInfo(i)->fPID == 2112) continue;
 
     int PID = event->PartInfo(i)->fPID;
 
     // KE of Protons and charged pions
     if (PID == 2212 or PID == 211 or PID == -211) {
       //      Erecoil += FitUtils::T(event->PartInfo(i)->fP);
       Erecoil +=
           fabs(event->PartInfo(i)->fP.E()) - fabs(event->PartInfo(i)->fP.Mag());
 
       // Total Energy of non-neutrons
       //    } else if (PID != 2112 and PID < 999 and PID != 22 and abs(PID) !=
       //    14) {
     } else if (PID == 111 || PID == 11 || PID == -11 || PID == 22) {
       Erecoil += (event->PartInfo(i)->fP.E());
     }
   }
 
   return Erecoil;
 }
 
 TVector3 GetVectorInTPlane(const TVector3 &inp, const TVector3 &planarNormal) {
   TVector3 pnUnit = planarNormal.Unit();
   double inpProjectPN = inp.Dot(pnUnit);
 
   TVector3 InPlanarInput = inp - (inpProjectPN * pnUnit);
   return InPlanarInput;
 }
 
 TVector3 GetUnitVectorInTPlane(const TVector3 &inp,
                                const TVector3 &planarNormal) {
   return GetVectorInTPlane(inp, planarNormal).Unit();
 }
 
 Double_t GetDeltaPhiT(TVector3 const &V_lepton, TVector3 const &V_other,
                       TVector3 const &Normal, bool PiMinus = false) {
   TVector3 V_lepton_T = GetUnitVectorInTPlane(V_lepton, Normal);
 
   TVector3 V_other_T = GetUnitVectorInTPlane(V_other, Normal);
 
   return PiMinus ? acos(V_lepton_T.Dot(V_other_T))
                  : (M_PI - acos(V_lepton_T.Dot(V_other_T)));
 }
 
 TVector3 GetDeltaPT(TVector3 const &V_lepton, TVector3 const &V_other,
                     TVector3 const &Normal) {
   TVector3 V_lepton_T = GetVectorInTPlane(V_lepton, Normal);
 
   TVector3 V_other_T = GetVectorInTPlane(V_other, Normal);
 
   return V_lepton_T + V_other_T;
 }
 
 Double_t GetDeltaAlphaT(TVector3 const &V_lepton, TVector3 const &V_other,
                         TVector3 const &Normal, bool PiMinus = false) {
   TVector3 DeltaPT = GetDeltaPT(V_lepton, V_other, Normal);
 
   return GetDeltaPhiT(V_lepton, DeltaPT, Normal, PiMinus);
 }
 
 double FitUtils::Get_STV_dpt(FitEvent *event, int ISPDG, bool Is0pi) {
   // Check that the neutrino exists
   if (event->NumISParticle(ISPDG) == 0) {
     return -9999;
   }
   // Return 0 if the proton or muon are missing
   if (event->NumFSParticle(2212) == 0 ||
       event->NumFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1)) == 0) {
     return -9999;
   }
 
   // Now get the TVector3s for each particle
   TVector3 const &NuP = event->GetHMISParticle(14)->fP.Vect();
   TVector3 const &LeptonP =
       event->GetHMFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1))->fP.Vect();
   TVector3 HadronP = event->GetHMFSParticle(2212)->fP.Vect();
 
   if (!Is0pi) {
     if (event->NumFSParticle(PhysConst::pdg_pions) == 0) {
       return -9999;
     }
     TLorentzVector pp = event->GetHMFSParticle(PhysConst::pdg_pions)->fP;
     HadronP += pp.Vect();
   }
   return GetDeltaPT(LeptonP, HadronP, NuP).Mag();
 }
 
 double FitUtils::Get_STV_dphit(FitEvent *event, int ISPDG, bool Is0pi) {
   // Check that the neutrino exists
   if (event->NumISParticle(ISPDG) == 0) {
     return -9999;
   }
   // Return 0 if the proton or muon are missing
   if (event->NumFSParticle(2212) == 0 ||
       event->NumFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1)) == 0) {
     return -9999;
   }
 
   // Now get the TVector3s for each particle
   TVector3 const &NuP = event->GetHMISParticle(ISPDG)->fP.Vect();
   TVector3 const &LeptonP =
       event->GetHMFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1))->fP.Vect();
   TVector3 HadronP = event->GetHMFSParticle(2212)->fP.Vect();
 
   if (!Is0pi) {
     if (event->NumFSParticle(PhysConst::pdg_pions) == 0) {
       return -9999;
     }
     TLorentzVector pp = event->GetHMFSParticle(PhysConst::pdg_pions)->fP;
     HadronP += pp.Vect();
   }
   return GetDeltaPhiT(LeptonP, HadronP, NuP);
 }
 double FitUtils::Get_STV_dalphat(FitEvent *event, int ISPDG, bool Is0pi) {
   // Check that the neutrino exists
   if (event->NumISParticle(ISPDG) == 0) {
     return -9999;
   }
   // Return 0 if the proton or muon are missing
   if (event->NumFSParticle(2212) == 0 ||
       event->NumFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1)) == 0) {
     return -9999;
   }
 
   // Now get the TVector3s for each particle
   TVector3 const &NuP = event->GetHMISParticle(ISPDG)->fP.Vect();
   TVector3 const &LeptonP =
       event->GetHMFSParticle(ISPDG + ((ISPDG < 0) ? 1 : -1))->fP.Vect();
   TVector3 HadronP = event->GetHMFSParticle(2212)->fP.Vect();
 
   if (!Is0pi) {
     if (event->NumFSParticle(PhysConst::pdg_pions) == 0) {
       return -9999;
     }
     TLorentzVector pp = event->GetHMFSParticle(PhysConst::pdg_pions)->fP;
     HadronP += pp.Vect();
   }
   return GetDeltaAlphaT(LeptonP, HadronP, NuP);
 }
diff --git a/src/Utils/FitUtils.h b/src/Utils/FitUtils.h
index 739f323..f2d8678 100644
--- a/src/Utils/FitUtils.h
+++ b/src/Utils/FitUtils.h
@@ -1,182 +1,171 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef FITUTILS_H_SEEN
 #define FITUTILS_H_SEEN
 
-// C Includes
 #include <math.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <ctime>
 #include <iostream>
 #include <numeric>
 
-// ROOT includes
 #include <TChain.h>
 #include <TFile.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <THStack.h>
 #include <TKey.h>
 #include <TLegend.h>
 #include <TList.h>
 #include <TLorentzVector.h>
 #include <TObjArray.h>
 #include <TROOT.h>
 #include <TRandom3.h>
 #include <TTree.h>
 #include "FitEvent.h"
 #include "TGraph.h"
 #include "TH2Poly.h"
+#include "FitEvent.h"
 
-// Fit  includes
 #include "FitParameters.h"
 #include "FitLogger.h"
 
 /*!
  *  \addtogroup Utils
  *  @{
  */
 
-//! Functions needed by individual samples for calculating kinematic quantities.
+/// Functions needed by individual samples for calculating kinematic quantities.
 namespace FitUtils {
 
-/*
-  MISC
-*/
-
-//! Return a vector of all values saved in map
+/// Return a vector of all values saved in map
 double *GetArrayFromMap(std::vector<std::string> invals,
                         std::map<std::string, double> inmap);
 
-/*
-  MISC Event
-*/
-
-//! Returns kinetic energy of particle
+/// Returns kinetic energy of particle
 double T(TLorentzVector part);
 
-//! Returns momentum of particle
+/// Returns momentum of particle
 double p(TLorentzVector part);
 double p(FitParticle* part);
 
-//! Returns angle between particles (_NOT_ cosine!)
+/// Returns angle between particles (_NOT_ cosine!)
 double th(TLorentzVector part, TLorentzVector part2);
 double th(FitParticle* part1, FitParticle* part2);
 
-//! Hadronic mass reconstruction
+/// Hadronic mass reconstruction
 double Wrec(TLorentzVector pnu, TLorentzVector pmu);
 
-//! Hadronic mass true from initial state particles and muon; useful if the full
-//! FSI vectors aren't not saved and we for some reasons need W_true
+/// Hadronic mass true from initial state particles and muon; useful if the full
+/// FSI vectors aren't not saved and we for some reasons need W_true
 double Wtrue(TLorentzVector pnu, TLorentzVector pmu, TLorentzVector pnuc);
 
-/*
-  E Recoil
-*/
+/// Return E Hadronic for all FS Particles in Hadronic System
 double GetErecoil_TRUE(FitEvent *event);
+
+/// Return E Hadronic for all Charged FS Particles in Hadronic System
 double GetErecoil_CHARGED(FitEvent *event);
 
 /*
   CCQE MiniBooNE/MINERvA
 */
-//! Function to calculate the reconstructed Q^{2}_{QE}
+/// Function to calculate the reconstructed Q^{2}_{QE}
 double Q2QErec(TLorentzVector pmu, double costh, double binding,
                bool neutrino = true);
 
-//! Function returns the reconstructed E_{nu} values
+/// Function returns the reconstructed E_{nu} values
 double EnuQErec(TLorentzVector pmu, double costh, double binding,
                 bool neutrino = true);
 
 //! Function to calculate the reconstructed Q^{2}_{QE}
 double Q2QErec(double pl, double costh, double binding,
 	       bool neutrino = true);
 
 //! Function returns the reconstructed E_{nu} values
 double EnuQErec(double pl, double costh, double binding,
 		bool neutrino = true);
 
 /*
   CCQE1p MINERvA
 */
-//! Reconstruct Q2QE given just the maximum energy proton.
+/// Reconstruct Q2QE given just the maximum energy proton.
 double ProtonQ2QErec(double pE, double binding);
 
 /*
   E Recoil MINERvA
 */
 double GetErecoil_MINERvA_LowRecoil(FitEvent *event);
 
 /*
   CC1pi0 MiniBooNE
 */
-//! Reconstruct Enu from CCpi0 vectors and binding energy
+/// Reconstruct Enu from CCpi0 vectors and binding energy
 double EnuCC1pi0rec(TLorentzVector pnu, TLorentzVector pmu,
                     TLorentzVector ppi0 = TLorentzVector(0, 0, 0, 0));
 
-//! Reconstruct Q2 from CCpi0 vectors and binding energy
+/// Reconstruct Q2 from CCpi0 vectors and binding energy
 double Q2CC1pi0rec(TLorentzVector pnu, TLorentzVector pmu,
                    TLorentzVector ppi0 = TLorentzVector(0, 0, 0, 0));
 
 /*
   CC1pi+ MiniBooNE
 */
 
-//! returns reconstructed Enu a la MiniBooNE CCpi+
-//! returns reconstructed Enu a la MiniBooNE CCpi+
+/// returns reconstructed Enu a la MiniBooNE CCpi+
+/// returns reconstructed Enu a la MiniBooNE CCpi+
 // Also for when not having pion info (so when we have a Michel tag in T2K)
 double EnuCC1piprec(TLorentzVector pnu, TLorentzVector pmu, TLorentzVector ppip,
                     bool pionInfo = true);
 
-//! returns reconstructed Enu assumming resonance interaction where intermediate
-//! resonance was a Delta
+/// returns reconstructed Enu assumming resonance interaction where intermediate
+/// resonance was a Delta
 double EnuCC1piprecDelta(TLorentzVector pnu, TLorentzVector pmu);
 
-//! returns reconstructed in a variety of flavours
+/// returns reconstructed in a variety of flavours
 double Q2CC1piprec(TLorentzVector pnu, TLorentzVector pmu, TLorentzVector ppip,
                    int enuType = 0, bool pionInfo = true);
 
 /*
   T2K CC1pi+ on CH
 */
 double thq3pi_CC1pip_T2K(TLorentzVector pnu, TLorentzVector pmu,
                          TLorentzVector ppi);
 double q3_CC1pip_T2K(TLorentzVector pnu, TLorentzVector pmu,
                      TLorentzVector ppi);
 double WrecCC1pip_T2K_MB(TLorentzVector pnu, TLorentzVector pmu,
                          TLorentzVector ppip);
 double EnuCC1piprec_T2K_eMB(TLorentzVector pnu, TLorentzVector pmu,
                             TLorentzVector ppi);
 
 /*
   nucleon single pion
 */
 double MpPi(TLorentzVector pp, TLorentzVector ppi);
 
 /// Gets delta p T as defined in Phys.Rev. C94 (2016) no.1, 015503
 double Get_STV_dpt(FitEvent *event, int ISPDG, bool Is0pi);
 /// Gets delta phi T as defined in Phys.Rev. C94 (2016) no.1, 015503
 double Get_STV_dphit(FitEvent *event, int ISPDG, bool Is0pi);
 /// Gets delta alpha T as defined in Phys.Rev. C94 (2016) no.1, 015503
 double Get_STV_dalphat(FitEvent *event, int ISPDG, bool Is0pi);
 }
 
 /*! @} */
 #endif
diff --git a/src/Utils/GeneralUtils.cxx b/src/Utils/GeneralUtils.cxx
index ea7f618..4fd52a5 100644
--- a/src/Utils/GeneralUtils.cxx
+++ b/src/Utils/GeneralUtils.cxx
@@ -1,143 +1,170 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #include "GeneralUtils.h"
 
-std::vector<std::string> GeneralUtils::ParseToStr(std::string str, const char* del){
+std::string GeneralUtils::BoolToStr(bool val) {
+  std::ostringstream ss;
+  ss << val;
+  return ss.str();
+}
+
+std::string GeneralUtils::IntToStr(int val) {
+  std::ostringstream ss;
+  ss << val;
+  return ss.str();
+};
+
+std::string GeneralUtils::DblToStr(double val) {
+  std::ostringstream ss;
+  ss << val;
+  return ss.str();
+};
+
+std::vector<std::string> GeneralUtils::LoadCharToVectStr(int argc, char* argv[]){
+  std::vector<std::string> vect;
+  for (int i = 1; i < argc; i++){
+    vect.push_back( std::string(argv[i]) );
+  }
+  return vect;
+}
+
+std::vector<std::string> GeneralUtils::ParseToStr(std::string str, const char* del) {
 
   std::istringstream stream(str);
   std::string temp_string;
   std::vector<std::string> vals;
 
   while (std::getline(stream >> std::ws, temp_string, *del)) {
     if (temp_string.empty()) continue;
     vals.push_back(temp_string);
-
   }
 
   return vals;
-
 }
-std::vector<double> GeneralUtils::ParseToDbl(std::string str, const char* del){
+
+std::vector<double> GeneralUtils::ParseToDbl(std::string str, const char* del) {
 
   std::istringstream stream(str);
   std::string temp_string;
   std::vector<double> vals;
 
   while (std::getline(stream >> std::ws, temp_string, *del)) {
     if (temp_string.empty()) continue;
     std::istringstream stream(temp_string);
     double entry;
     stream >> entry;
 
     vals.push_back(entry);
 
   }
-  
   return vals;
 }
 
-std::vector<int> GeneralUtils::ParseToInt(std::string str, const char* del){
+std::vector<int> GeneralUtils::ParseToInt(std::string str, const char* del) {
 
   std::istringstream stream(str);
   std::string temp_string;
   std::vector<int> vals;
 
   while (std::getline(stream >> std::ws, temp_string, *del)) {
     if (temp_string.empty()) continue;
     std::istringstream stream(temp_string);
     int entry;
     stream >> entry;
 
     vals.push_back(entry);
 
   }
-
   return vals;
 }
 
-// To stop rooku's skin from crawling :p
-double GeneralUtils::StrToDbl(std::string str){
-  
+double GeneralUtils::StrToDbl(std::string str) {
+
   std::istringstream stream(str);
   double val;
   stream >> val;
 
   return val;
 }
 
-int GeneralUtils::StrToInt(std::string str){
+int GeneralUtils::StrToInt(std::string str) {
 
   std::istringstream stream(str);
   int val;
   stream >> val;
 
   return val;
 }
 
-bool GeneralUtils::StrToBool(std::string str){
+bool GeneralUtils::StrToBool(std::string str) {
+
+  // convert result to lower case
+  for (int i = 0; i < str.size(); i++) str[i] = std::tolower(str[i]);
 
+  // Test for true/false
+  if      (!str.compare("false")) return false;
+  else if (!str.compare("true") ) return true;
+  if (str.empty()) return false;
+
+  // Push into bool
   std::istringstream stream(str);
   bool val;
   stream >> val;
 
   return val;
 }
 
+std::vector<std::string> GeneralUtils::ParseFileToStr(std::string str, const char* del) {
 
-std::vector<std::string> GeneralUtils::ParseFileToStr(std::string str, const char* del){
-  
   std::vector<std::string> linevect;
   std::string line;
-  
+
   std::ifstream read;
   read.open(str.c_str());
-  
-  if (!read.is_open()){
-    ERR(FTL) << "Cannot open file " << str << " in ParseFileToStr" << std::endl;
-    throw;
+
+  if (!read.is_open()) {
+    THROW("Cannot open file " << str << " in ParseFileToStr");
   }
-  
-  while( std::getline(read >> std::ws, line, *del) ){
+
+  while ( std::getline(read >> std::ws, line, *del) ) {
     linevect.push_back(line);
   }
 
   read.close();
-  
+
   return linevect;
 }
 
-std::string GeneralUtils::GetTopLevelDir(){
+std::string GeneralUtils::GetTopLevelDir() {
 
   static bool first = true;
   static std::string topLevelVarVal;
-  
-  if(first){
+
+  if (first) {
     char * const var = getenv("EXT_FIT");
-    if(!var){ 
-      ERR(FTL) << "Cannot find top level directory! Set the EXT_FIT environmental variable" << std::endl;
-      exit(-1);
+    if (!var) {
+      THROW("Cannot find top level directory! Set the EXT_FIT environmental variable");
     }
     topLevelVarVal = std::string(var);
     first = false;
   }
 
   return topLevelVarVal;
 }
 
diff --git a/src/Utils/GeneralUtils.h b/src/Utils/GeneralUtils.h
index 128684c..3139b52 100644
--- a/src/Utils/GeneralUtils.h
+++ b/src/Utils/GeneralUtils.h
@@ -1,150 +1,132 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
 #ifndef GENERALUTILS_H_SEEN
 #define GENERALUTILS_H_SEEN
 
 #include <math.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <cstring>
 #include <fstream>
 #include <iostream>
 #include <iostream>
 #include <numeric>
 #include <limits>
 #include <sstream>
 #include <string>
 #include <vector>
 #include "FitLogger.h"
+#include "PhysConst.h"
 
 /*!
  *  \addtogroup Utils
  *  @{
  */
 
-//! Functions which deal with basic string and file handling. They should have
-//! no dependence on the other NUISANCE files!
+/// Functions which deal with basic string and file handling. They should have
+/// no dependence on the other NUISANCE files!
 namespace GeneralUtils {
 
 /*!
   String handling and file parsing functions
 */
 
-//! Parse a string into a vector of doubles given a delimiter "del"
+/// Parse a string into a vector of doubles given a delimiter "del"
 std::vector<double> ParseToDbl(std::string str, const char* del);
 
-//! Parse a string into a vector of ints given a delimiter "del"
+/// Parse a string into a vector of ints given a delimiter "del"
 std::vector<int> ParseToInt(std::string str, const char* del);
 
-//! Parse a string into a vector of strings given a delimiter "del"
+/// Parse a string into a vector of strings given a delimiter "del"
 std::vector<std::string> ParseToStr(std::string str, const char* del);
 
-//! Parse text file into a vector of strings
+/// Parse text file into a vector of strings 
 std::vector<std::string> ParseFileToStr(std::string str, const char* del);
 
-//! Convert a string to a double
+/// Convert a string to a double
 double StrToDbl(std::string str);
 
-//! Convert a string to an int
+/// Convert a string to an int
 int StrToInt(std::string str);
 
-//! Convert a string to an bool
+/// Convert a string to an bool
 bool StrToBool(std::string str);
 
-//! Return the top level environmental variable for the fitter
+/// Convert a bool to string
+std::string BoolToStr(bool val);
+
+/// Convert Int to string
+std::string IntToStr(int val);
+
+/// Convert Double to String
+std::string DblToStr(double val);
+
+/// Return the top level environmental variable for the fitter
 std::string GetTopLevelDir();
 
-// //! A utility function to return a std::vector from an array
+// /// A utility function to return a std::vector from an array
 // template <typename T, size_t N>
 // std::vector<T> makeVector(const T (&data)[N]) {
 //   return std::vector<T>(data, data + N);
 // }
+std::vector<std::string> LoadCharToVectStr(int argc, char* argv[]);
+
 
 template <typename T, size_t N>
 size_t GetArraySize(const T (&data)[N]) {
   return N;
 }
 template <typename T>
 size_t GetHammingWeight(T const& d) {
   T c = d;
   size_t w = 0;
   while (bool(c)) {
     w += c & 1;
     c = (c >> 1);
   }
   return w;
 }
 
 template <typename T>
 size_t GetFirstOnBit(T const& d) {
   T c = d;
   size_t fob = 0;
   while (bool(c)) {
     if (c & 1) {
       return fob;
     } else {
       c = (c >> 1);
     }
     fob++;
   }
   return fob;
 }
 
 template <typename T>
 size_t IsSmallNum(T const& d) {
   if (std::numeric_limits<T>::is_integer) {
     return (d == 0);
   }
   return (((d > 0) && (d < std::numeric_limits<T>::epsilon())) ||
           ((d < 0) && (d > -std::numeric_limits<T>::epsilon())));
 }
 }
 
-namespace PhysConst {
-const double mass_proton = 0.93827203;   // Proton mass in GeV
-const double mass_neutron = 0.93956536;  // Neutron mass in GeV
-const double mass_delta = 1.232;         // Delta mass in GeV
-const double mass_muon = 0.10565837;     // Muon mass in GeV
-const double mass_electron = 0.000510998928; // Electron mass in GeV
-const int pdg_neutrinos[] = {12, -12, 14, -14 /*, 16, -16*/};
-const int pdg_muons[] = {13, -13};
-const int pdg_pions[] = {211, -211, 111};
-const int pdg_charged_pions[] = {211, -211};
-const int pdg_strangemesons[] = {
-    130,     310,     311,     321,     9000311, 9000321, 10311,
-    10321,   100311,  100321,  9010311, 9010321, 9020311, 9020321,
-    313,     323,     10313,   10323,   20313,   20323,   100313,
-    100323,  9000313, 9000323, 30313,   30323,   315,     325,
-    9000315, 9000325, 10315,   10325,   20315,   20325,   9010315,
-    9010325, 9020315, 9020325, 317,     327,     9010317, 9010327};
-
-// Just *-1 to cover possibility
-const int pdg_kplus = 321;
-const int pdg_antistrangemesons[] = {
-    -130,     -310,     -311,     -321,     -9000311, -9000321, -10311,
-    -10321,   -100311,  -100321,  -9010311, -9010321, -9020311, -9020321,
-    -313,     -323,     -10313,   -10323,   -20313,   -20323,   -100313,
-    -100323,  -9000313, -9000323, -30313,   -30323,   -315,     -325,
-    -9000315, -9000325, -10315,   -10325,   -20315,   -20325,   -9010315,
-    -9010325, -9020315, -9020325, -317,     -327,     -9010317, -9010327};
-}
-
 /*! @} */
 #endif
diff --git a/src/Utils/Initialiser.cxx b/src/Utils/Initialiser.cxx
new file mode 100644
index 0000000..923805a
--- /dev/null
+++ b/src/Utils/Initialiser.cxx
@@ -0,0 +1,98 @@
+#include "Initialiser.h"
+
+void RunNuisance(){
+  std::cout << "Starting NUISANCE" << std::endl;
+}
+
+struct LetterBackronym {
+  LetterBackronym(size_t n, std::string const &b, float p = 1.0,
+                  std::string const &t = "") {
+    NUsed = n;
+    Backkie = b;
+    ProbAccept = p;
+    TagLine = t;
+  };
+  size_t NUsed;
+  float ProbAccept;
+  std::string Backkie;
+  std::string TagLine;
+};
+
+__attribute__((constructor)) void nuisance_init(void) {
+  std::vector<std::vector<LetterBackronym> > Letters;
+
+  for (size_t i = 0; i < 8; ++i) {
+    Letters.push_back(std::vector<LetterBackronym>());
+  }
+
+  Letters[0].push_back(LetterBackronym(2, "Neutrino"));
+  Letters[0].push_back(LetterBackronym(3, "NUIsance", 0.2));
+
+  Letters[2].push_back(LetterBackronym(1, "Interaction"));
+
+  Letters[3].push_back(LetterBackronym(1, "Systematics"));
+  Letters[3].push_back(LetterBackronym(
+                         1, "Synthesiser", 0.2, "Playing on the comparisons you want to see"));
+
+  Letters[4].push_back(LetterBackronym(2, "ANalyser"));
+  Letters[4].push_back(LetterBackronym(1, "Aggregating", 0.5));
+  Letters[4].push_back(LetterBackronym(3, "from A-Neutrino sCattering", 1,
+                                       "You can always find a frame"));
+
+  Letters[5].push_back(
+    LetterBackronym(1, "New", 1, "The freshest comparisons"));
+
+  Letters[6].push_back(LetterBackronym(1, "by Comparing"));
+  Letters[6].push_back(LetterBackronym(1, "Constraints from"));
+
+  Letters[7].push_back(LetterBackronym(1, "Experiments"));
+
+  std::vector<std::string> TagLines;
+  TagLines.push_back("Fit and compare.");
+
+  std::stringstream back("");
+
+  TRandom3 tr;
+  tr.SetSeed();
+
+  for (size_t i = 0; i < 8;) {
+    LetterBackronym const &let = Letters[i][tr.Integer(Letters[i].size())];
+    if (tr.Uniform() > let.ProbAccept) {
+      continue;
+    }
+    back << let.Backkie << " ";
+    i += let.NUsed;
+    if (let.TagLine.length()) {
+      TagLines.push_back(let.TagLine);
+    }
+  }
+
+  std::string Name = "Nuisance";
+  std::string TagL = TagLines[tr.Integer(TagLines.size())];
+
+  std::vector<std::pair<std::string, std::pair<std::string, std::string> > >
+  OneBlob;
+
+  OneBlob.push_back(
+    std::make_pair("NUISANCE", std::make_pair("", "FiXing your Neutrinos")));
+
+  if (tr.Uniform() < 0.01) {
+    std::pair<std::string, std::pair<std::string, std::string> > const &blob =
+      OneBlob[tr.Integer(OneBlob.size())];
+    Name = blob.first;
+    back.str("");
+    back << blob.second.first;
+    TagL = blob.second.second;
+  }
+
+  std::cout << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+            "%%%%%%%%%%%%%%%"
+            "%%"
+            << std::endl
+            << "%%  Welcome to " << Name << ": \033[5m" << back.str()
+            << "\033[0m-- " << TagL << std::endl
+            << "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
+            "%%%%%%%%%%%%%%%"
+            "%%"
+            << std::endl;
+}
\ No newline at end of file
diff --git a/src/Utils/Initialiser.h b/src/Utils/Initialiser.h
new file mode 100644
index 0000000..104ead9
--- /dev/null
+++ b/src/Utils/Initialiser.h
@@ -0,0 +1,20 @@
+#include <iosfwd>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <fcntl.h>
+#include <unistd.h>
+#include <math.h>
+#include <stdlib.h>
+#include <cstring>
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <numeric>
+#include <sstream>
+#include <sstream>
+#include <string>
+#include <vector>
+#include "TRandom3.h"
+
+void RunNuisance();
diff --git a/src/Utils/NuisConfig.cxx b/src/Utils/NuisConfig.cxx
new file mode 100644
index 0000000..ae9addc
--- /dev/null
+++ b/src/Utils/NuisConfig.cxx
@@ -0,0 +1,858 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+#include "NuisConfig.h"
+#include "FitParameters.h"
+
+struct SXmlAttr_t {
+   SXmlAttr_t  *fNext;
+   // after structure itself memory for attribute name is preserved
+   // if first byte is 0, this is special attribute
+   static inline char* Name(void* arg) { return (char*)arg + sizeof(SXmlAttr_t); }
+};
+
+enum EXmlNodeType {
+  kXML_NODE    = 1,    // normal node with children
+  kXML_COMMENT = 2,    // comment (stored as value of node fName)
+  kXML_PI_NODE = 3,    // processing instructions node (like <?name  attr="" ?>
+  kXML_RAWLINE = 4,    // just one line of xml code
+  kXML_CONTENT = 5     // node content, can appear many times in between of normal nodes
+};
+
+struct SXmlNode_t {
+   EXmlNodeType fType;    //  this is node type - node, comment, processing instruction and so on
+   SXmlAttr_t  *fAttr;    // first attribute
+   SXmlAttr_t  *fNs;      // name space definition (if any)
+   SXmlNode_t  *fNext;    // next node on the same level of hierarchy
+   SXmlNode_t  *fChild;   // first child node
+   SXmlNode_t  *fLastChild; // last child node
+   SXmlNode_t  *fParent;   // parent node
+   // consequent bytes after structure are node name
+   // if first byte is 0, next is node content
+   static inline char* Name(void* arg) { return (char*)arg + sizeof(SXmlNode_t); }
+};
+
+
+
+
+nuisconfig::nuisconfig() {
+
+  // Initial Setup
+  std::string filename = GeneralUtils::GetTopLevelDir() + "/parameters/config.xml";
+  std::cout << "[ NUISANCE ]: Loading DEFAULT config from : " << filename;
+
+  // Create XML Engine
+  fXML = new TXMLEngine;
+
+  // Load in documents
+  fXMLDocs.clear();
+  fXML->SetSkipComments(true);
+  fXMLDocs.push_back( fXML->ParseFile(filename.c_str(), 1000000) );
+
+  // Setup Main XML Node
+  fMainNode = fXML->DocGetRootElement( fXMLDocs[0] );
+  //RemoveIdenticalNodes();
+
+  std::cout << " -> DONE." << std::endl;
+
+
+}
+
+nuisconfig::~nuisconfig() {
+
+  // Free all xml docs
+  //  for (int i = 0; i < fXMLDocs.size(); i++){
+  //    fXML->FreeDoc( fXMLDocs.at(i) );
+  //  }
+
+  // Remove XMLDocs
+  //fXMLDocs.clear();
+
+  // Delete Engine
+  //delete fXML;
+
+}
+
+void nuisconfig::OverrideConfig(std::string conf) {
+  std::vector<std::string> opts = GeneralUtils::ParseToStr(conf, "=");
+  SetConfS(opts[0], opts[1]);
+}
+
+
+XMLNodePointer_t nuisconfig::GetConfigNode(std::string 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;
+}
+
+/// Request a string config key
+std::string nuisconfig::SetConfS(const std::string name, std::string val) {
+  XMLNodePointer_t node = GetConfigNode(name);
+  if (!node) node = CreateNode("config");
+  SetS(node, name, val);
+  return val;
+}
+
+/// Get nuisconfig::SetConfig Bool
+bool nuisconfig::SetConfB(const std::string name, bool val) {
+  XMLNodePointer_t node = GetConfigNode(name);
+  if (!node) node = CreateNode("config");
+  SetB(node, name, val);
+  return val;
+}
+
+/// Get nuisconfig::SetConfig Int
+int nuisconfig::SetConfI(const std::string name, int val) {
+  XMLNodePointer_t node = GetConfigNode(name);
+  if (!node) node = CreateNode("config");
+  SetI(node, name, val);
+  return val;
+}
+
+/// Get nuisconfig::SetConfig Double
+double nuisconfig::SetConfD(const std::string name, double val) {
+  XMLNodePointer_t node = GetConfigNode(name);
+  if (!node) node = CreateNode("config");
+  SetD(node, name, val);
+  return val;
+}
+
+
+std::string nuisconfig::ConvertParameterLineToXML(std::string line) {
+
+  // Parse
+  std::vector<std::string> parsed = GeneralUtils::ParseToStr(line, " ");
+
+  // Min limits
+  if (parsed.size() < 2) {
+    ERR(FTL) << " Insufficient parameter options" << std::endl;
+    throw;
+  }
+
+  // Setup XMLLine
+  std::string xmlline = "parameter";
+
+  // Name
+  xmlline += " name=\"" + parsed[0] + "\"";
+
+  // Nominal
+  xmlline += " nominal=\"" + parsed[1] + "\"";
+
+  // State
+  xmlline += " state=\"" + parsed[2] + "\"";
+
+  return "<" + xmlline + "/>";
+}
+
+std::string nuisconfig::ConvertSampleLineToXML(std::string line) {
+
+  // Parse
+  std::vector<std::string> parsed = GeneralUtils::ParseToStr(line, " ");
+
+  // Min limits
+  if (parsed.size() < 2) {
+    ERR(FTL) << "Insufficient sample options" << std::endl;
+  }
+
+  // Setup XMLLine
+  std::string xmlline = "sample";
+
+  // Name
+  xmlline += " name=\"" + parsed[1] + "\"";
+
+  // InputFile
+  xmlline += " input=\"" + parsed[2] + "\"";
+
+  // If option add it
+  if (parsed.size() > 3) {
+    xmlline += " state=\"" + parsed[3] + "\"";
+  }
+
+  // If norm add it
+  if (parsed.size() > 4) {
+    xmlline += " norm=\"" + parsed[4] + "\"";
+  }
+
+  return "<" + xmlline + "/>";
+}
+
+
+void nuisconfig::AddXMLLine(std::string line) {
+
+  // XMLLine
+  std::string xmlline = "";
+
+  // If = in it its not an xml
+  if (line.find("=") != std::string::npos) {
+    xmlline = "<" + line + "/>";
+
+    // Else Convert it to a line
+  } else {
+
+    // Parse XMLLine
+    std::vector<std::string> parsed = GeneralUtils::ParseToStr(line, " ");
+    if (parsed.empty()) return;
+
+    // Convert it to new fomat
+    if (!parsed[0].compare("sample")) {
+      xmlline = ConvertSampleLineToXML(line);
+    } else if (!parsed[0].compare("parameter")) {
+      xmlline = ConvertParameterLineToXML(line);
+    }
+  }
+
+  // Ad the line
+  std::cout << "[ NUISANCE ]: Adding XMLLine in nuisconfig: '"
+            << xmlline << "'";
+
+  // Make XML Structure
+  fXMLDocs.push_back( fXML->ParseString(xmlline.c_str()) );
+
+  int nxml = fXMLDocs.size();
+  XMLNodePointer_t newdocroot = fXML->DocGetRootElement( fXMLDocs[nxml - 1] );
+  fXML->AddChild( fMainNode, newdocroot );
+
+  std::cout << " -> DONE." << std::endl;
+}
+
+void nuisconfig::FinaliseConfig(std::string name) {
+
+  std::cout << "[ NUISANCE ]: Finalising configuration";
+  // Save full config to file
+  WriteConfig(name);
+  RemoveEmptyNodes();
+  RemoveIdenticalNodes();
+  std::cout << "-> DONE." << std::endl;
+}
+
+void nuisconfig::LoadXMLConfig(std::string filename, std::string state = "") {
+
+  std::cout << "[ NUISANCE ]: Loading XML config from : " << filename;
+  // Add new file to xml docs list
+  fXMLDocs.push_back( fXML->ParseFile( filename.c_str(), 1000000 ) );
+
+  // Get New Doc ROOT
+  int nxml = fXMLDocs.size();
+  XMLNodePointer_t newdocroot = fXML->DocGetRootElement( fXMLDocs[nxml - 1] );
+
+
+  // Loop over children and add
+  XMLNodePointer_t child = fXML->GetChild( newdocroot );
+  while ( child != 0 ) {
+    // Add additional state flag if given
+    if (!state.empty()) {
+      if (GetS(child, "source").empty()) {
+        fXML->NewAttr(child, 0, "source", state.c_str());
+      } else {
+        // fXML->SetAttr
+      }
+
+      // If its a config node, then remove previous attributes, overriding
+      if (!std::string(fXML->GetNodeName(child)).compare("config")) {
+
+        // Loop over attribues
+        XMLAttrPointer_t attr1 = fXML->GetFirstAttr(child);
+        while ( attr1 != 0 ) {
+          if (!ConfS(fXML->GetAttrName(attr1)).empty()) {
+            std::vector<XMLNodePointer_t> confignodes = GetNodes("config");
+
+            for (size_t i = 0; i < confignodes.size(); i++) {
+              if (fXML->HasAttr(confignodes[i], fXML->GetAttrName(attr1))) {
+                std::cout << fXML->GetAttrName(attr1) << std::endl;
+                fXML->FreeAttr(confignodes[i], fXML->GetAttrName(attr1));
+                break;
+              }
+            }
+          }
+          attr1 = fXML->GetNextAttr(attr1);
+        }
+      }
+    }
+
+    // Add this child to the main config list
+    fXML->AddChild( fMainNode, child );
+
+    // Get Next Child
+    child = fXML->GetNext(child);
+  }
+  // std::cout << "Removing Identical Nodes" << std::endl;
+  std::cout << " -> DONE." << std::endl;
+}
+
+
+void nuisconfig::LoadConfig(std::string filename, std::string state) {
+
+  // Open file and see if its XML
+  std::cout << "[ NUISANCE ]: Trying to parse file : " << filename;
+  StopTalking();
+  XMLDocPointer_t tempdoc = fXML->ParseFile( filename.c_str() , 1000000);
+  StartTalking();
+
+  if (tempdoc) {
+    std::cout << " -> Found XML file." << std::endl;
+    LoadXMLConfig(filename, state);
+  } else {
+    std::cout << " -> Assuming its a simple card file." << std::endl;
+    LoadCardConfig(filename, state);
+  }
+
+}
+
+void nuisconfig::LoadCardConfig(std::string filename, std::string state) {
+
+  // Build XML Config from the card file
+  std::vector<std::string> cardlines =
+    GeneralUtils::ParseFileToStr(filename, "\n");
+  int linecount = 0;
+
+  for (std::vector<std::string>::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<std::string> strvct = GeneralUtils::ParseToStr(line, " ");
+    if (strvct.empty()) continue;
+
+    // Get Identifier
+    std::string id = strvct[0];
+
+    // Build backwards compatible xml configs
+    if (!id.compare("sample")) Config::CreateSampleKeyFromLine(line);
+
+    if (id.find("_parameter") != std::string::npos)
+      Config::CreateParameterKeyFromLine(line);
+
+    if (!id.compare("covar") ||
+        !id.compare("pull")  ||
+        !id.compare("throw"))
+      Config::CreatePullKeyFromLine(line);
+
+    if (!id.compare("config"))
+      Config::CreateOldConfigKeyFromLine(line);
+  }
+
+
+  return;
+
+}
+
+
+
+XMLNodePointer_t nuisconfig::CreateNode(std::string name) {
+  return fXML->NewChild(fMainNode, 0, name.c_str());
+}
+
+void nuisconfig::WriteConfig(std::string outputname) {
+  // Create a New XML Doc
+  XMLDocPointer_t newxmldoc = fXML->NewDoc();
+  fXML->DocSetRootElement(newxmldoc, fMainNode);
+
+  // Save document to file
+  //  fXML->SaveDoc(newxmldoc, outputname.c_str());
+}
+
+
+void nuisconfig::CheckCallCount(std::string name) {
+
+  // Add Count Warning Flag so we only warn once...
+  if (fConfigCallWarning.find(name) == fConfigCallWarning.end()) {
+    fConfigCallWarning[name] = false;
+    fConfigCallCount[name] = 0;
+  }
+
+  // Check for inefficiency and warn if it happens
+  if (abs(time(NULL) - fCurrentTime) > 1) {
+    fCurrentTime = time(NULL);
+
+    // Check count since last 10 seconds
+    if (!fConfigCallWarning[name] and fConfigCallCount[name] > 100) {
+      ERR(WRN) << "Config Parameter " << name
+               << " has been requested " << fConfigCallCount[name]
+               << " times in the last second." << std::endl;
+      ERR(WRN) << "This is very inefficient! Please try to change this." << std::endl;
+      fConfigCallWarning[name] = true;
+    }
+
+    // Reset counter
+    fConfigCallCount[name] = 0;
+  }
+
+  // Add to Call Count
+  fConfigCallCount[name] += 1;
+
+}
+
+std::string nuisconfig::ConfS(const std::string name) {
+  std::string temp = "";
+
+  CheckCallCount(name);
+
+  // Loop over children and look for name
+  XMLNodePointer_t child = fXML->GetChild(fMainNode);
+  while (child != 0) {
+
+    // std::cout << "Child = " << fXML->GetNodeName(child) << std::endl;
+    // Select only config parameters
+    if (!std::string(fXML->GetNodeName(child)).compare("config")) {
+
+      // std::cout << "Found Config " << std::endl;
+      // Loop over config attributes and search for name
+      XMLAttrPointer_t attr = fXML->GetFirstAttr(child);
+      while ( attr != 0 ) {
+
+        // Save name value
+        // std::cout << "Setting Temp " << std::string(fXML->GetAttrName(attr)) << " '" << fXML->GetAttrValue(attr) << "' " << std::endl;
+        if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
+          // std::cout << "Setting Temp " << std::string(fXML->GetAttrName(attr)) << " " << fXML->GetAttrValue(attr) << std::endl;
+          temp = fXML->GetAttrValue(attr);
+        }
+
+        // Get Next Attribute
+        attr = fXML->GetNextAttr(attr);
+      }
+    }
+
+    // Next Child
+    child = fXML->GetNext(child);
+  }
+
+  // Return Config Value
+  return temp;
+}
+
+bool nuisconfig::ConfB(const std::string name) {
+  std::string pars = ConfS(name);
+  return GeneralUtils::StrToBool(pars);
+}
+
+int nuisconfig::ConfI(const std::string name) {
+  std::string pars = ConfS(name);
+  return GeneralUtils::StrToInt(pars);
+}
+
+double nuisconfig::ConfD(const std::string name) {
+  std::string pars = ConfS(name);
+  return GeneralUtils::StrToDbl(pars);
+}
+
+std::vector<XMLNodePointer_t> nuisconfig::GetNodes(const std::string type) {
+  std::vector<XMLNodePointer_t> nodelist;
+
+  /// Loop over all children
+  XMLNodePointer_t child = fXML->GetChild(fMainNode);
+  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;
+}
+
+
+/// Get String from a given node
+std::string nuisconfig::GetS(XMLNodePointer_t node, std::string name) {
+
+  // If node empty return empty
+  if (node == 0) return "";
+
+  // Check request count
+  CheckCallCount(name);
+
+  // Get Attribute from child with name
+  XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
+  std::string temp = "";
+
+  // Check if its a search or exact (should probs just add wildcards...)
+  bool exact = true;
+  if (name.size() > 0) {
+    if (name[0] == '*' and name[name.size() - 1] == '*') {
+      exact = false;
+    }
+  }
+
+  if (!fXML) {
+    std::cout << "AAAAH NO XML" << std::endl;
+    throw;
+  }
+
+  // Loop over all attributes
+  while ( attr != 0 ) {
+
+    // Find value of correct name
+    if (exact) {
+      // std::cout << "Getting Attr name = " << attr << " " << name << std::endl;
+      if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
+        temp = fXML->GetAttrValue(attr);
+      }
+    } else {
+
+    }
+
+    // Next Attribute
+    attr = fXML->GetNextAttr(attr);
+  }
+
+  return temp;
+}
+
+bool nuisconfig::Has(XMLNodePointer_t node, std::string name) {
+
+  // If node empty return empty
+  if (node == 0) return false;
+
+  // Get Attribute from child with name
+  SXmlNode_t* snode = (SXmlNode_t*) node;
+  SXmlAttr_t* sattr = snode->fAttr;
+
+  XMLAttrPointer_t attr = fXML->GetFirstAttr(node);
+  
+  bool found = false;
+
+  // Check if its a search or exact (should probs just add wildcards...)
+  bool exact = true;
+  if (name.size() > 0) {
+    if (name[0] == '*' and name[name.size() - 1] == '*') {
+      exact = false;
+    }
+  }
+
+  // Loop over all attributes
+  while ( attr != 0 ) {
+
+    // Find value of correct name
+    if (exact) {
+      if (std::string(fXML->GetAttrName(attr)) == name.c_str()) {
+        found = true;
+      }
+    } else {
+
+    }
+
+    // Next Attribute
+    attr = fXML->GetNextAttr(attr);
+  }
+
+  return found;
+}
+
+/// Get Bools from a given node
+bool nuisconfig::GetB(XMLNodePointer_t node, std::string name) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::StrToBool(tempattr);
+}
+
+/// Get int from given node
+int nuisconfig::GetI(XMLNodePointer_t node, std::string name) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::StrToInt(tempattr);
+}
+
+/// Get double from given node
+double nuisconfig::GetD(XMLNodePointer_t node, std::string name) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::StrToDbl(tempattr);
+}
+
+std::vector<std::string> nuisconfig::GetVS(XMLNodePointer_t node, std::string name, const char* del) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::ParseToStr(tempattr, del);
+}
+
+std::vector<int> nuisconfig::GetVI(XMLNodePointer_t node, std::string name, const char* del) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::ParseToInt(tempattr, del);
+}
+
+std::vector<double> nuisconfig::GetVD(XMLNodePointer_t node, std::string name, const char* del) {
+  std::string tempattr = GetS(node, name);
+  return GeneralUtils::ParseToDbl(tempattr, del);
+}
+
+
+namespace Config {
+nuisconfig& Get() { return nuisconfig::GetConfig(); };
+}
+
+nuisconfig* nuisconfig::m_nuisconfigInstance = NULL;
+nuisconfig& nuisconfig::GetConfig(void) {
+  if (!m_nuisconfigInstance)  m_nuisconfigInstance = new nuisconfig;
+  return *m_nuisconfigInstance;
+};
+
+
+void nuisconfig::AddS(XMLNodePointer_t node, std::string name, std::string val) {
+  fXML->NewAttr(node, 0, name.c_str(), val.c_str());
+}
+
+void nuisconfig::AddB(XMLNodePointer_t node, std::string name, bool val) {
+  AddS(node, name, GeneralUtils::BoolToStr(val));
+}
+
+void nuisconfig::AddI(XMLNodePointer_t node, std::string name, int val) {
+  AddS(node, name, GeneralUtils::IntToStr(val));
+}
+void nuisconfig::AddD(XMLNodePointer_t node, std::string name, double val) {
+  AddS(node, name, GeneralUtils::DblToStr(val));
+}
+
+void nuisconfig::SetS(XMLNodePointer_t node, std::string name, std::string val) {
+
+  // Remove and readd attribute
+  if (fXML->HasAttr(node, name.c_str())) {
+    fXML->FreeAttr(node, name.c_str());
+  }
+
+  AddS(node, name, val);
+}
+
+void nuisconfig::SetB(XMLNodePointer_t node, std::string name, bool val) {
+  SetS(node, name, GeneralUtils::BoolToStr(val));
+}
+
+void nuisconfig::SetI(XMLNodePointer_t node, std::string name, int val) {
+  SetS(node, name, GeneralUtils::IntToStr(val));
+}
+void nuisconfig::SetD(XMLNodePointer_t node, std::string name, double val) {
+  SetS(node, name, GeneralUtils::DblToStr(val));
+}
+
+void nuisconfig::ChangeS(XMLNodePointer_t node, std::string name, std::string val) {
+  if (!fXML->HasAttr(node, name.c_str())) return;
+  SetS(node, name, val);
+}
+
+void nuisconfig::ChangeB(XMLNodePointer_t node, std::string name, bool val) {
+  ChangeS(node, name, GeneralUtils::BoolToStr(val));
+}
+
+void nuisconfig::ChangeI(XMLNodePointer_t node, std::string name, int val) {
+  ChangeS(node, name, GeneralUtils::IntToStr(val));
+}
+void nuisconfig::ChangeD(XMLNodePointer_t node, std::string name, double val) {
+  ChangeS(node, name, GeneralUtils::DblToStr(val));
+}
+
+
+
+void nuisconfig::RemoveEmptyNodes() {
+  std::vector<XMLNodePointer_t> nodelist = Config::Get().GetNodes();
+  for (size_t i = 0; i < nodelist.size(); i++) {
+    if (fXML->IsEmptyNode(nodelist[i])) {
+      RemoveNode(nodelist[i]);
+    }
+  }
+}
+
+void nuisconfig::RemoveIdenticalNodes() {
+  std::vector<XMLNodePointer_t> removed;
+
+  // Loop over all nodes and check for identical nodes
+  std::vector<XMLNodePointer_t> nodelist = Config::Get().GetNodes();
+  for (size_t i = 0; i < nodelist.size(); i++) {
+    for (size_t j = 0; j < nodelist.size(); j++) {
+
+      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;
+      if (i == j) 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) {
+  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) << " : " << 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;
+}
+
+
+std::string nuisconfig::GetTag(std::string name) {
+
+  std::vector<XMLAttrPointer_t> alltags = GetNodes("tag");
+  std::string tagval = "";
+  bool tagfound = false;
+
+  for (size_t i = 0; i < alltags.size(); i++) {
+    if (!Has(alltags[i], name)) continue;
+    tagval = GetS(alltags[i], name);
+    tagfound = true;
+  }
+
+  if (!tagfound) {
+    ERR(FTL) << "Cannot find tag " << name << " in global conig!" << std::endl;
+    throw;
+  }
+
+  return tagval;
+};
+
+void nuisconfig::ExpandAllTags() {
+  return;
+  /*
+  // Loop over children and look for name
+  XMLNodePointer_t child = fXML->GetChild(fMainNode);
+  while (child != 0) {
+
+    // Loop over attributes and search for tags
+    XMLAttrPointer_t attr = fXML->GetFirstAttr(child);
+    while ( attr != 0 ) {
+
+      // Search attribute value for <>
+      std::string attrval = std::string(fXML->GetAttrValue(attr));
+      std::string attrname = std::string(fXML->GetAttrName(attr));
+
+      // Search for <>
+      while (attrval.find("<") != std::string::npos and
+             attrval.find(">") != std::string::npos){
+
+        size_t startdel = 0;
+        size_t enddel = 0;
+        std::string replacestring = "";
+
+        for (size_t i = 0; i < attrval.size(); i++){
+
+          if (attrval[i] == '<'){
+            replacestring = "";
+            startdel = i;
+          }
+
+          replacestring.push_back(attrval[i]);
+
+          if (attrval[i] == '>'){
+            enddel = i;
+            break;
+          }
+        }
+
+        attrval.replace(startdel, replacestring, GetTag(replacestring) );
+      }
+
+      fXML->FreeAttr(child, attr);
+      attr = fXML->NewAttr(child, attr, attrname.c_str(), attrval.c_str());
+
+      // Get Next Attribute
+      attr = fXML->GetNextAttr(attr);
+    }
+    child = fXML->GetNext(child);
+  }
+  */
+
+
+
+};
+
+
+
+
+
+
+
+
+
diff --git a/src/Utils/NuisConfig.h b/src/Utils/NuisConfig.h
new file mode 100644
index 0000000..06bef45
--- /dev/null
+++ b/src/Utils/NuisConfig.h
@@ -0,0 +1,178 @@
+// Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
+
+/*******************************************************************************
+*    This file is part of NUISANCE.
+*
+*    NUISANCE is free software: you can redistribute it and/or modify
+*    it under the terms of the GNU General Public License as published by
+*    the Free Software Foundation, either version 3 of the License, or
+*    (at your option) any later version.
+*
+*    NUISANCE is distributed in the hope that it will be useful,
+*    but WITHOUT ANY WARRANTY; without even the implied warranty of
+*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*    GNU General Public License for more details.
+*
+*    You should have received a copy of the GNU General Public License
+*    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
+*******************************************************************************/
+
+#ifndef NUISCONFIG_H_SEEN
+#define NUISCONFIG_H_SEEN
+#include "TXMLEngine.h"
+#include "GeneralUtils.h"
+#include <algorithm>
+#include <map>
+
+// New NUISANCE Config Class
+class nuisconfig {
+public:
+
+  /// Singleton Get Function
+  static nuisconfig& GetConfig(void);
+
+  /// Constructor \n
+  /// Loads defaults from $NUISANCE/parameters/config.xml
+  nuisconfig();
+
+  /// Desctructor \n Frees XML Docs
+  virtual ~nuisconfig();
+
+  /// Adds a new configuration list
+  void LoadConfig(std::string filename, std::string state);
+
+  /// Adds a new config from new xml file format
+  void LoadXMLConfig(std::string filename, std::string state);
+
+  /// Adds a new config from old card file format
+  void LoadCardConfig(std::string filename, std::string state);
+
+  /// Save the config to file
+  void WriteConfig(std::string filename);
+
+void OverrideConfig(std::string conf);
+
+XMLNodePointer_t GetConfigNode(std::string name);
+
+
+
+  /// Request a string config key
+  std::string SetConfS(const std::string name, std::string val);
+
+  /// Get SetConfig Bool
+  bool SetConfB(const std::string name, bool val);
+
+  /// Get SetConfig Int
+  int SetConfI(const std::string name, int val);
+
+  /// Get SetConfig Double
+  double SetConfD(const std::string name, double val);
+
+  // Set config
+  std::string ConfS(const std::string name);
+
+  /// Get Config Bool
+  bool ConfB(const std::string name);
+
+  /// Get Config Int
+  int ConfI(const std::string name);
+
+  /// Get Config Double
+  double ConfD(const std::string name);
+
+  /// Node Functions
+  void CheckCallCount(std::string name);
+
+  // Get List of nodes
+  std::vector<XMLNodePointer_t> GetNodes(std::string type="");
+
+  /// Get String from a given node
+  std::string GetS(XMLNodePointer_t node, std::string name);
+
+  /// Get Bools from a given node
+  bool GetB(XMLNodePointer_t node, std::string name);
+
+  /// Get int from given node
+  int GetI(XMLNodePointer_t node, std::string name);
+
+  /// Get double from given node
+  double GetD(XMLNodePointer_t node, std::string name);
+  
+  // Add Children to root node
+  XMLNodePointer_t CreateNode(std::string name);
+
+  // Add line
+  void AddXMLLine(std::string line);
+
+  std::string ConvertSampleLineToXML(std::string line);
+  std::string ConvertParameterLineToXML(std::string line);
+  void FinaliseConfig(std::string name);
+
+  // Add attribute to node
+  void AddS(XMLNodePointer_t node, std::string name, std::string val);
+  void AddB(XMLNodePointer_t node, std::string name, bool val);
+  void AddI(XMLNodePointer_t node, std::string name, int val);
+  void AddD(XMLNodePointer_t node, std::string name, double val);
+
+  void SetS(XMLNodePointer_t node, std::string name, std::string val);
+  void SetB(XMLNodePointer_t node, std::string name, bool val);
+  void SetI(XMLNodePointer_t node, std::string name, int val);
+  void SetD(XMLNodePointer_t node, std::string name, double val);
+
+  void ChangeS(XMLNodePointer_t node, std::string name, std::string val);
+  void ChangeB(XMLNodePointer_t node, std::string name, bool val);
+  void ChangeI(XMLNodePointer_t node, std::string name, int val);
+  void ChangeD(XMLNodePointer_t node, std::string name, double val);
+
+
+  // Check has element
+  bool Has(XMLNodePointer_t node, std::string name);
+
+  // Reconfigure (sorts overrides, logger, etc)
+  void Reconfigure(){};
+
+  /// OLD Wrapper Functions for GetParI,etc
+  inline std::string GetParS(std::string name){ return ConfS(name); };
+  inline int GetParI(std::string name){ return ConfI(name); };
+  inline double GetParD(std::string name){ return ConfD(name); };
+  inline bool GetParB(std::string name){ return ConfB(name); };
+
+  // Get Vectors
+  std::vector<std::string> GetVS(XMLNodePointer_t node, std::string name, const char* del);
+  std::vector<int> GetVI(XMLNodePointer_t node, std::string name, const char* del);
+  std::vector<double> GetVD(XMLNodePointer_t node, std::string name, const char* del);
+
+  void RemoveEmptyNodes();
+  void RemoveIdenticalNodes();
+  bool MatchingNodes(XMLNodePointer_t node1, XMLNodePointer_t node2);
+  void PrintNode(XMLNodePointer_t node);
+  void RemoveNode(XMLNodePointer_t node);
+
+  std::string GetTag(std::string name);
+  void ExpandAllTags();
+
+ private:
+
+  XMLNodePointer_t fMainNode; ///< Main XML Parent Node
+  TXMLEngine* fXML; ///< ROOT XML Engine
+  std::vector<XMLDocPointer_t> fXMLDocs; ///< List of all XML document inputs
+
+  int fCurrentTime; ///< Unix time for inefficiency checking
+  std::map<std::string, int> fConfigCallCount; ///< To check for inefficiency.
+  std::map<std::string, bool> fConfigCallWarning; ///< Only print warning once.
+
+protected:
+  static nuisconfig* m_nuisconfigInstance;
+};
+
+// Get Function for Singleton
+namespace Config {
+  nuisconfig& Get();
+
+}
+
+
+/*! @} */
+#endif
+
+
diff --git a/src/Utils/NuisKey.cxx b/src/Utils/NuisKey.cxx
new file mode 100644
index 0000000..c626c33
--- /dev/null
+++ b/src/Utils/NuisKey.cxx
@@ -0,0 +1,195 @@
+#include "NuisKey.h"
+
+std::string nuiskey::GetS(std::string name){ 
+  return Config::Get().GetS(fNode,name); 
+};
+
+int         nuiskey::GetI(std::string name){ 
+  return Config::Get().GetI(fNode,name); 
+};
+
+double      nuiskey::GetD(std::string name){ 
+  return Config::Get().GetD(fNode,name); 
+};
+
+bool        nuiskey::GetB(std::string name){ 
+  return Config::Get().GetB(fNode,name); 
+};
+
+std::vector<std::string> nuiskey::GetVS(std::string name, const char* del){
+  return Config::Get().GetVS(fNode,name,del);
+};
+
+std::vector<int>         nuiskey::GetVI(std::string name, const char* del){
+  return Config::Get().GetVI(fNode,name,del);
+};
+
+std::vector<double>      nuiskey::GetVD(std::string name, const char* del){
+  return Config::Get().GetVD(fNode,name,del);
+};
+
+
+
+
+
+
+
+std::vector<nuiskey> Config::QueryKeys(const std::string type, const std::string test1){
+
+  // Get Vector of nodes     
+  std::vector<XMLNodePointer_t> nodelist = Config::Get().GetNodes(type);
+
+  // Convert List into a key list for easier access  
+  std::vector<nuiskey> keylist;
+  for (std::vector<XMLNodePointer_t>::const_iterator iter = nodelist.begin();
+       iter != nodelist.end(); iter++){
+
+    // Create new key
+    nuiskey newkey = nuiskey(*iter);
+
+    // Add test1
+    if (!test1.empty()){
+      std::vector<std::string> testvect = GeneralUtils::ParseToStr(test1,"=");
+      if (testvect.size() < 2) continue;
+      if (newkey.GetS(testvect[0]) != testvect[1]) continue;
+    }
+
+    // Save node as nuiskey  
+    keylist.push_back( newkey );
+  }
+
+  // Return list of keys     
+  return keylist;
+}
+
+nuiskey Config::QueryLastKey(const std::string type, const std::string test1){
+  // Loop over all for now because I'm lazy...
+  std::vector<nuiskey> allkeys = Config::QueryKeys(type,test1);
+  if (allkeys.size() < 1) return nuiskey();
+  else return allkeys[allkeys.size()-1];
+}
+
+
+nuiskey Config::QueryFirstKey(const std::string type, const std::string test1){
+  // Loop over all for now because I'm lazy...          
+  std::vector<nuiskey> allkeys = Config::QueryKeys(type,test1);
+  if (allkeys.size() < 1) return nuiskey();
+  else return allkeys[allkeys.size()-1];
+}
+
+nuiskey Config::CreateParameterKeyFromLine(const std::string line){
+  nuiskey parameterkey = Config::CreateKey("parameter");
+
+  // Parse
+  std::vector<std::string> strvct = GeneralUtils::ParseToStr(line, " ");
+
+  // Add to key
+  parameterkey.AddS("type", strvct[0]);
+  parameterkey.AddS("name", strvct[1]);
+  parameterkey.AddS("nominal", strvct[2]);
+
+  if (strvct.size() == 7){
+    parameterkey.AddS("low",strvct[3]);
+    parameterkey.AddS("high",strvct[4]);
+    parameterkey.AddS("step",strvct[5]);
+    parameterkey.AddS("state",strvct[6]);
+  } else if (strvct.size() == 3){
+    parameterkey.AddS("state","FIX");
+  }
+
+  return parameterkey;
+}
+
+bool nuiskey::Has(const std::string name){
+  return Config::Get().Has(fNode, name);
+}
+
+nuiskey Config::CreatePullKeyFromLine(const std::string line){
+  nuiskey pullkey = Config::CreateKey("pull");
+
+  // Parse
+  std::vector<std::string> strvct = GeneralUtils::ParseToStr(line, " ");
+  pullkey.AddS("name", strvct[1]);
+  pullkey.AddS("input", strvct[2]);
+  pullkey.AddS("type", strvct[3]);
+    
+  return pullkey;
+}
+
+
+nuiskey Config::CreateOldConfigKeyFromLine(const std::string line){
+  nuiskey configkey = Config::CreateKey("config");
+
+  std::vector<std::string> strvct = GeneralUtils::ParseToStr(line, " ");
+  configkey.AddS( strvct[1], strvct[2] );
+
+  return configkey;
+}
+
+nuiskey Config::CreateSampleKeyFromLine(const std::string line){
+
+  // Create new key
+  nuiskey samplekey = Config::CreateKey("sample");
+
+  // Parse
+  std::vector<std::string> strvct = GeneralUtils::ParseToStr(line, " ");
+
+  // Get elements
+  samplekey.AddS("name"  , strvct[1]);
+  samplekey.AddS("input" , strvct[2]);
+  if (strvct.size() > 3){
+    samplekey.AddS("type", strvct[3]);
+  }
+  if (strvct.size() > 4){
+    samplekey.AddS("norm", strvct[4]);
+  }
+
+  return samplekey;
+}
+
+
+nuiskey Config::CreateKey(const std::string name){
+  return nuiskey(Config::Get().CreateNode(name));
+}
+
+void nuiskey::AddS(std::string name, std::string newval){
+  Config::Get().AddS(fNode, name, newval);
+}
+void nuiskey::AddI(std::string name, int newval){
+  Config::Get().AddI(fNode, name, newval);
+}
+void nuiskey::AddD(std::string name, double newval){
+  Config::Get().AddD(fNode, name, newval);
+}
+void nuiskey::AddB(std::string name, bool newval){
+  Config::Get().AddB(fNode, name, newval);
+}
+
+void nuiskey::SetS(std::string name, std::string newval){
+  Config::Get().SetS(fNode, name, newval);
+}
+void nuiskey::SetI(std::string name, int newval){
+  Config::Get().SetI(fNode, name, newval);
+}
+void nuiskey::SetD(std::string name, double newval){
+  Config::Get().SetD(fNode, name, newval);
+}
+void nuiskey::SetB(std::string name, bool newval){
+  Config::Get().SetB(fNode, name, newval);
+}
+
+void nuiskey::ChangeS(std::string name, std::string newval){
+  Config::Get().ChangeS(fNode, name, newval);
+}
+void nuiskey::ChangeI(std::string name, int newval){
+  Config::Get().ChangeI(fNode, name, newval);
+}
+void nuiskey::ChangeD(std::string name, double newval){
+  Config::Get().ChangeD(fNode, name, newval);
+}
+void nuiskey::ChangeB(std::string name, bool newval){
+  Config::Get().ChangeB(fNode, name, newval);
+}
+
+
+
diff --git a/src/Utils/NuisKey.h b/src/Utils/NuisKey.h
new file mode 100644
index 0000000..d9460ac
--- /dev/null
+++ b/src/Utils/NuisKey.h
@@ -0,0 +1,68 @@
+#ifndef NUISKEY_H
+#define NUISKEY_H
+
+#include "NuisConfig.h"
+#include <vector>
+
+class nuiskey{
+ public:
+
+  nuiskey(){
+  };
+
+  nuiskey(XMLNodePointer_t node){
+    fNode = node;
+  };
+
+  ~nuiskey(){};
+
+  std::string GetS(std::string name);
+  int    GetI(std::string name);
+  double GetD(std::string name);
+  bool   GetB(std::string name);
+
+  std::vector<std::string> GetVS(std::string name, const char* del);
+  std::vector<int>         GetVI(std::string name, const char* del);
+  std::vector<double>      GetVD(std::string name, const char* del);
+
+  void SetS(std::string name, std::string newval);
+  void SetI(std::string name, int newval);
+  void SetD(std::string name, double newval);
+  void SetB(std::string name, bool newval);
+
+  void ChangeS(std::string name, std::string newval);
+  void ChangeI(std::string name, int newval);
+  void ChangeD(std::string name, double newval);
+  void ChangeB(std::string name, bool newval);
+
+  void AddS(std::string name, std::string newval);
+  void AddI(std::string name, int newval);
+  void AddD(std::string name, double newval);
+  void AddB(std::string name, bool newval);
+
+  bool Has(std::string name);
+
+  XMLNodePointer_t fNode; ///< XML Node in Config::Get().fXML for this key                                                   
+};
+
+namespace Config {
+
+  // Return a vector of keys for use
+  std::vector<nuiskey> QueryKeys(const std::string name, const std::string test1="");
+  nuiskey QueryFirstKey(const std::string name, const std::string test1="");
+  nuiskey QueryLastKey(const std::string name, const std::string test1="");
+
+  // Create a new global config entry
+  nuiskey CreateKey(const std::string name);
+
+
+  // void ConvertAndLoadCardToXMLFormat(const std::string cardfile);
+
+  // Backwards compatible sample key options
+  nuiskey CreateSampleKeyFromLine(const std::string line);
+  nuiskey CreateParameterKeyFromLine(const std::string line);
+  nuiskey CreatePullKeyFromLine(const std::string line);
+  nuiskey CreateOldConfigKeyFromLine(const std::string line);
+  
+}
+#endif
diff --git a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h b/src/Utils/OpenMPWrapper.h
similarity index 69%
copy from src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
copy to src/Utils/OpenMPWrapper.h
index ce6fd7d..811732d 100644
--- a/src/K2K/K2K_NC1pi0_Evt_1Dppi0_nu.h
+++ b/src/Utils/OpenMPWrapper.h
@@ -1,35 +1,36 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
+#ifndef OPENMPWRAPPER_H
+#define OPENMPWRAPPER_H
 
-#ifndef K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
-#define K2K_NC1PI0_EVT_1DPPI0_NU_H_SEEN
 
-#include "Measurement1D.h"
+// Have to define dummy opemmp variables incase its not enabled
+#ifdef __USE_OPENMP__
 
-class K2K_NC1pi0_Evt_1Dppi0_nu : public Measurement1D {
-public:
+#include <omp.h>
 
-  K2K_NC1pi0_Evt_1Dppi0_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~K2K_NC1pi0_Evt_1Dppi0_nu() {};
+#else
+
+typedef int omp_int_t;
+inline omp_int_t omp_get_thread_num()  { return 0; }
+inline omp_int_t omp_get_max_threads() { return 1; }
 
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
-};
-  
 #endif
+
+#endif
\ No newline at end of file
diff --git a/src/Utils/ParserUtils.cxx b/src/Utils/ParserUtils.cxx
new file mode 100644
index 0000000..a1f015f
--- /dev/null
+++ b/src/Utils/ParserUtils.cxx
@@ -0,0 +1,190 @@
+#include "ParserUtils.h"
+
+void ParserUtils::CheckBadArguments(std::vector<std::string> args) {
+	// Any argument that has not already been erased is considered bad.
+	for (size_t i = 0; i < args.size(); i++) {
+		if (args[i][0] == '-') {
+			THROW("Unknown command line option given : \'" << args[i] << "\'");
+		}
+	}
+}
+
+
+void ParserUtils::ParseArgument(std::vector<std::string>& args, std::string opt,
+                                int& val, bool required, bool duplicates) {
+
+	int indexfound = -1;
+	for (size_t i = 0; i < args.size() - 1; i++) {
+		if (args.empty()) break;
+
+		if (!(args[i]).compare(opt.c_str())) {
+
+			// Found it
+			if (indexfound != -1 and !duplicates) {
+				THROW("Duplicate arguments given with : " << opt << std::endl
+				      << "1 -> " << opt << " " << val << std::endl
+				      << "2 -> " << opt << " " << args[i + 1]);
+			}
+
+			// Get Value
+			val = GeneralUtils::StrToInt(args[i + 1]);
+			indexfound = i;
+		}
+	}
+
+	// if not found
+	if (indexfound == -1 and required) {
+		THROW("No flag " << opt << " found in commands."
+		      << "This is required!");
+	}
+
+	// Remove from vector
+	if (indexfound != -1) {
+		args.erase(args.begin() + indexfound);
+		args.erase(args.begin() + indexfound);
+	}
+}
+
+void ParserUtils::ParseArgument(std::vector<std::string>& args, std::string opt,
+                                std::string& val, bool required, bool duplicates) {
+
+	int indexfound = -1;
+	for (size_t i = 0; i < args.size() - 1; i++) {
+		if (args.empty()) break;
+
+		if (!(args[i]).compare(opt.c_str())) {
+
+			// Found it
+			if (indexfound != -1 and !duplicates) {
+				THROW("Duplicate arguments given with : " << opt << std::endl
+				      << "1 -> " << opt << " " << val << std::endl
+				      << "2 -> " << opt << " " << args[i + 1]);
+			}
+
+			// Get Value
+			val = (args[i + 1]);
+			indexfound = i;
+		}
+	}
+
+	// if not found
+	if (indexfound == -1 and required) {
+		THROW("No flag " << opt << " found in commands."
+		      << "This is required!");
+	}
+
+	// Remove from vector
+	if (indexfound != -1) {
+		args.erase(args.begin() + indexfound);
+		args.erase(args.begin() + indexfound);
+	}
+}
+
+void ParserUtils::ParseArgument(std::vector<std::string>& args, std::string opt,
+                                std::vector<std::string>& val, bool required, bool duplicates) {
+
+	while (std::find(args.begin(), args.end(), opt) != args.end()) {
+		std::string temp = "";
+		ParseArgument(args, opt, temp, required);
+		val.push_back(temp);
+	}
+
+	if (required and val.empty()) {
+		THROW("No flag " << opt << " found in commands."
+		      << "This is required!");
+	}
+}
+
+
+
+void ParserUtils::ParseSplitArgument(std::vector<std::string>& args, std::string opt,
+                                     std::string& val, bool required, bool duplicates) {
+
+	int indexfound = -1;
+	std::string splitline = "";
+	int linecount = 0;
+
+	for (size_t i = 0; i < args.size(); i++) {
+		if (args.empty()) break;
+
+
+		// Start saving
+		if (!(args[i]).compare(opt.c_str())) {
+			indexfound = i;
+			splitline = "";
+			continue;
+		}
+
+		if (indexfound != -1) {
+			if (args[i][0] == '-') {
+				break;
+			}
+
+			splitline += args[i] + " ";
+			linecount++;
+		}
+	}
+
+	// Remove from vector
+	if (indexfound != -1) {
+		for (int i = indexfound; i <= indexfound + linecount; i++) {
+			args.erase(args.begin() + i);
+		}
+		val = splitline;
+	}
+}
+
+
+void ParserUtils::ParseSplitArgument(std::vector<std::string>& args, std::string opt,
+                                     std::vector<std::string>& val, bool required, bool duplicates) {
+
+	//std::cout << "Starting split argument" << std::endl;
+	while (std::find(args.begin(), args.end(), opt) != args.end()) {
+		std::string temp = "";
+		ParseArgument(args, opt, temp, required, duplicates);
+
+		val.push_back(temp);
+	}
+
+	if (required and val.empty()) {
+		THROW( "No flag " << opt << " found in commands."
+		       << "This is required!");
+		throw;
+	}
+
+
+}
+
+
+
+// void ParserUtils::ParseRemainingXML(std::vector<std::string>& args, std::vector<std::string>& cmds) {
+
+// 	// Make one big string again and parse it by ''
+// 	std::string temp = "";
+// 	for (size_t i = 0; i < args.size(); i++) {
+// 		temp += args[i] + " ";
+// 	}
+
+// 	return;
+// }
+
+void ParserUtils::ParseCounter(std::vector<std::string>& args, std::string opt, int& count) {
+
+	std::vector<int> indexlist;
+
+	for (size_t i = 0; i < args.size(); i++) {
+		if (!(args[i]).compare( "+" + opt)) {
+			count++;
+			indexlist.push_back(i);
+		} else if (!(args[i]).compare( "-" + opt)) {
+			count--;
+			indexlist.push_back(i);
+		}
+	}
+
+	for (size_t i = 0; i < indexlist.size(); i++) {
+		args.erase(args.begin() + indexlist[i]);
+	}
+}
+
+
diff --git a/src/Utils/ParserUtils.h b/src/Utils/ParserUtils.h
new file mode 100644
index 0000000..475c7fb
--- /dev/null
+++ b/src/Utils/ParserUtils.h
@@ -0,0 +1,40 @@
+#ifndef PARSER_UTILS_H
+#define PARSER_UTILS_H
+#include "FitParameters.h"
+#include "GeneralUtils.h"
+#include <vector>
+
+/// All functions used to parse input arguments.
+namespace ParserUtils {
+
+/// Checks a list of arguments for '-?' flags that have not been removed
+void CheckBadArguments(std::vector<std::string> args);
+
+/// Parses the arguments looked for the 'opt' flag and saves it into val
+void ParseArgument(std::vector<std::string>& args, std::string opt,
+                   int& val, bool required = false, bool duplicates = true);
+
+/// Parses the arguments looked for the 'opt' flag and saves it into val
+void ParseArgument(std::vector<std::string>& args, std::string opt,
+                   std::string& val, bool required = false, bool duplicates = true);
+
+/// Parses the arguments looked for the 'opt' flag and saves it into val
+void ParseSplitArgument(std::vector<std::string>& args, std::string opt,
+                        std::string& val, bool required = false, bool duplicates = true);
+
+/// Parses the arguments looked for the 'opt' flag and saves all proceeding values into val (UNSTABLE)
+void ParseSplitArgument(std::vector<std::string>& args, std::string opt,
+                        std::vector<std::string>& val, bool required = false, bool duplicates = true);
+
+// /// Take everything left in the string
+// void ParseRemainingXML(std::vector<std::string>& args, std::vector<std::string>& cmds);
+
+/// Parse arguments looking for '+/-opt' and add/subtract from counter when it occurs
+void ParseCounter(std::vector<std::string>& args, std::string opt, int& count);
+
+/// In the case where duplicates can be given, parses all cases into the val vector
+void ParseArgument(std::vector<std::string>& args, std::string opt,
+                   std::vector<std::string>& val, bool required = false, bool duplicates = true);
+};
+
+#endif
diff --git a/src/Utils/GeneralUtils.h b/src/Utils/PhysConst.h
similarity index 54%
copy from src/Utils/GeneralUtils.h
copy to src/Utils/PhysConst.h
index 128684c..4440d72 100644
--- a/src/Utils/GeneralUtils.h
+++ b/src/Utils/PhysConst.h
@@ -1,150 +1,70 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
-
-#ifndef GENERALUTILS_H_SEEN
-#define GENERALUTILS_H_SEEN
+#ifndef PHYSCONST_H_SEEN
+#define PHYSCONST_H_SEEN
 
 #include <math.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <cstring>
 #include <fstream>
 #include <iostream>
 #include <iostream>
 #include <numeric>
 #include <limits>
 #include <sstream>
 #include <string>
 #include <vector>
 #include "FitLogger.h"
 
-/*!
- *  \addtogroup Utils
- *  @{
- */
-
-//! Functions which deal with basic string and file handling. They should have
-//! no dependence on the other NUISANCE files!
-namespace GeneralUtils {
-
-/*!
-  String handling and file parsing functions
-*/
-
-//! Parse a string into a vector of doubles given a delimiter "del"
-std::vector<double> ParseToDbl(std::string str, const char* del);
-
-//! Parse a string into a vector of ints given a delimiter "del"
-std::vector<int> ParseToInt(std::string str, const char* del);
-
-//! Parse a string into a vector of strings given a delimiter "del"
-std::vector<std::string> ParseToStr(std::string str, const char* del);
-
-//! Parse text file into a vector of strings
-std::vector<std::string> ParseFileToStr(std::string str, const char* del);
-
-//! Convert a string to a double
-double StrToDbl(std::string str);
-
-//! Convert a string to an int
-int StrToInt(std::string str);
-
-//! Convert a string to an bool
-bool StrToBool(std::string str);
-
-//! Return the top level environmental variable for the fitter
-std::string GetTopLevelDir();
-
-// //! A utility function to return a std::vector from an array
-// template <typename T, size_t N>
-// std::vector<T> makeVector(const T (&data)[N]) {
-//   return std::vector<T>(data, data + N);
-// }
-
-template <typename T, size_t N>
-size_t GetArraySize(const T (&data)[N]) {
-  return N;
-}
-template <typename T>
-size_t GetHammingWeight(T const& d) {
-  T c = d;
-  size_t w = 0;
-  while (bool(c)) {
-    w += c & 1;
-    c = (c >> 1);
-  }
-  return w;
-}
-
-template <typename T>
-size_t GetFirstOnBit(T const& d) {
-  T c = d;
-  size_t fob = 0;
-  while (bool(c)) {
-    if (c & 1) {
-      return fob;
-    } else {
-      c = (c >> 1);
-    }
-    fob++;
-  }
-  return fob;
-}
-
-template <typename T>
-size_t IsSmallNum(T const& d) {
-  if (std::numeric_limits<T>::is_integer) {
-    return (d == 0);
-  }
-  return (((d > 0) && (d < std::numeric_limits<T>::epsilon())) ||
-          ((d < 0) && (d > -std::numeric_limits<T>::epsilon())));
-}
-}
-
+/// namespace to contain all physical constants used by NUISANCE
 namespace PhysConst {
 const double mass_proton = 0.93827203;   // Proton mass in GeV
 const double mass_neutron = 0.93956536;  // Neutron mass in GeV
 const double mass_delta = 1.232;         // Delta mass in GeV
 const double mass_muon = 0.10565837;     // Muon mass in GeV
 const double mass_electron = 0.000510998928; // Electron mass in GeV
-const int pdg_neutrinos[] = {12, -12, 14, -14 /*, 16, -16*/};
-const int pdg_muons[] = {13, -13};
+
+ const int pdg_neutrinos[] = {12, -12, 14, -14 /*, 16, -16*/};
+ const int pdg_muons[] = {13, -13};
+ const int pdg_leptons[] = {11, -11, 13, -13, 15, -15};
+
 const int pdg_pions[] = {211, -211, 111};
 const int pdg_charged_pions[] = {211, -211};
 const int pdg_strangemesons[] = {
     130,     310,     311,     321,     9000311, 9000321, 10311,
     10321,   100311,  100321,  9010311, 9010321, 9020311, 9020321,
     313,     323,     10313,   10323,   20313,   20323,   100313,
     100323,  9000313, 9000323, 30313,   30323,   315,     325,
     9000315, 9000325, 10315,   10325,   20315,   20325,   9010315,
     9010325, 9020315, 9020325, 317,     327,     9010317, 9010327};
 
 // Just *-1 to cover possibility
 const int pdg_kplus = 321;
 const int pdg_antistrangemesons[] = {
     -130,     -310,     -311,     -321,     -9000311, -9000321, -10311,
     -10321,   -100311,  -100321,  -9010311, -9010321, -9020311, -9020321,
     -313,     -323,     -10313,   -10323,   -20313,   -20323,   -100313,
     -100323,  -9000313, -9000323, -30313,   -30323,   -315,     -325,
     -9000315, -9000325, -10315,   -10325,   -20315,   -20325,   -9010315,
     -9010325, -9020315, -9020325, -317,     -327,     -9010317, -9010327};
 }
 
 /*! @} */
 #endif
diff --git a/src/Utils/PlotUtils.cxx b/src/Utils/PlotUtils.cxx
index f489eec..50aeeb2 100644
--- a/src/Utils/PlotUtils.cxx
+++ b/src/Utils/PlotUtils.cxx
@@ -1,903 +1,927 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "PlotUtils.h"
 #include "FitEvent.h"
 #include "FitParameters.h"
 
 // MOVE TO MB UTILS!
 // This function is intended to be modified to enforce a consistent masking for all models.
-TH2D* PlotUtils::SetMaskHist(std::string type, TH2D* data){
-  
-  TH2D *fMaskHist = (TH2D*)data->Clone("fMaskHist");  
+TH2D* PlotUtils::SetMaskHist(std::string type, TH2D* data) {
 
-  for (int xBin = 0; xBin < fMaskHist->GetNbinsX(); ++xBin){
-    for (int yBin = 0; yBin < fMaskHist->GetNbinsY(); ++yBin){
-      if (data->GetBinContent(xBin+1, yBin+1) == 0) fMaskHist->SetBinContent(xBin+1, yBin+1, 0);
-      else fMaskHist->SetBinContent(xBin+1, yBin+1, 0.5);
+  TH2D *fMaskHist = (TH2D*)data->Clone("fMaskHist");
 
-      if (!type.compare("MB_numu_2D")){
-	if (yBin == 19 && xBin < 8) fMaskHist->SetBinContent(xBin+1, yBin+1, 1.0);
+  for (int xBin = 0; xBin < fMaskHist->GetNbinsX(); ++xBin) {
+    for (int yBin = 0; yBin < fMaskHist->GetNbinsY(); ++yBin) {
+      if (data->GetBinContent(xBin + 1, yBin + 1) == 0) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 0);
+      else fMaskHist->SetBinContent(xBin + 1, yBin + 1, 0.5);
+
+      if (!type.compare("MB_numu_2D")) {
+        if (yBin == 19 && xBin < 8) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 1.0);
       } else {
-	if (yBin == 19 && xBin < 11) fMaskHist->SetBinContent(xBin+1, yBin+1, 1.0);
+        if (yBin == 19 && xBin < 11) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 1.0);
       }
-      if (yBin == 18 && xBin < 3) fMaskHist->SetBinContent(xBin+1, yBin+1, 1.0);
-      if (yBin == 17 && xBin < 2) fMaskHist->SetBinContent(xBin+1, yBin+1, 1.0);
-      if (yBin == 16 && xBin < 1) fMaskHist->SetBinContent(xBin+1, yBin+1, 1.0);
+      if (yBin == 18 && xBin < 3) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 1.0);
+      if (yBin == 17 && xBin < 2) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 1.0);
+      if (yBin == 16 && xBin < 1) fMaskHist->SetBinContent(xBin + 1, yBin + 1, 1.0);
     }
   }
 
   return fMaskHist;
 };
 
 // MOVE TO GENERAL UTILS?
-bool PlotUtils::CheckObjectWithName(TFile *inFile, std::string substring){
+bool PlotUtils::CheckObjectWithName(TFile *inFile, std::string substring) {
 
   TIter nextkey(inFile->GetListOfKeys());
   TKey *key;
 
   while ( (key = (TKey*)nextkey()) ) {
     std::string test(key->GetName());
     if (test.find(substring) != std::string::npos) return true;
   }
   return false;
 };
 
 // MOVE TO GENERAL UTILS?
-std::string PlotUtils::GetObjectWithName(TFile *inFile, std::string substring){
+std::string PlotUtils::GetObjectWithName(TFile *inFile, std::string substring) {
 
   TIter nextkey(inFile->GetListOfKeys());
   TKey *key;
   std::string output="";
 
   while ( (key = (TKey*)nextkey()) ) {
     std::string test(key->GetName());
     if (test.find(substring) != std::string::npos)
       output = test;
   }
-  
+
   return output;
 };
 
-void PlotUtils::CreateNeutModeArray(TH1* hist, TH1* neutarray[]){
+void PlotUtils::CreateNeutModeArray(TH1* hist, TH1* neutarray[]) {
 
-  for (int i = 0; i < 60; i++){
-    neutarray[i] = (TH1*)hist->Clone(Form("%s_NMODE_%i",hist->GetName(),i));
+  for (int i = 0; i < 60; i++) {
+    neutarray[i] = (TH1*)hist->Clone(Form("%s_NMODE_%i", hist->GetName(), i));
   }
   return;
 };
 
-void PlotUtils::DeleteNeutModeArray(TH1* neutarray[]){
-  for (int i = 0; i < 60; i++){
+void PlotUtils::DeleteNeutModeArray(TH1* neutarray[]) {
+  for (int i = 0; i < 60; i++) {
     delete neutarray[i];
   }
   return;
 };
 
 
-void PlotUtils::FillNeutModeArray(TH1D* hist[], int mode, double xval, double weight){
+void PlotUtils::FillNeutModeArray(TH1D* hist[], int mode, double xval, double weight) {
   if (abs(mode) > 60) return;
   hist[abs(mode)]->Fill(xval, weight);
   return;
 };
 
-void PlotUtils::FillNeutModeArray(TH2D* hist[], int mode, double xval, double yval, double weight){
+void PlotUtils::FillNeutModeArray(TH2D* hist[], int mode, double xval, double yval, double weight) {
   if (abs(mode) > 60) return;
-  hist[abs(mode)]->Fill(xval,yval,weight);
+  hist[abs(mode)]->Fill(xval, yval, weight);
   return;
 };
 
 
 THStack PlotUtils::GetNeutModeStack(std::string title, TH1* ModeStack[], int option) {
-  
+
   (void) option;
-  THStack allmodes = THStack(title.c_str(),title.c_str());
+  THStack allmodes = THStack(title.c_str(), title.c_str());
 
-  for (int i = 0; i < 60; i++){
+  for (int i = 0; i < 60; i++) {
     allmodes.Add(ModeStack[i]);
   }
 
   // Credit to Clarence for copying all this out.
 
-  // CC 
+  // CC
   ModeStack[1]->SetTitle("CCQE");
   ModeStack[1]->SetFillColor(kBlue);
- // ModeStack[1]->SetFillStyle(3444);
-  ModeStack[1]->SetLineColor(kBlue); 
+// ModeStack[1]->SetFillStyle(3444);
+  ModeStack[1]->SetLineColor(kBlue);
   ModeStack[2]->SetTitle("2p/2h Nieves");
   ModeStack[2]->SetFillColor(kRed);
   //ModeStack[2]->SetFillStyle(3344);
-  ModeStack[2]->SetLineColor(kRed); 
+  ModeStack[2]->SetLineColor(kRed);
 
   //ModeStack[11]->SetTitle("#it{#nu + p #rightarrow l^{-} + p + #pi^{+}}");
   ModeStack[11]->SetTitle("CC1#pi^{+} on p");
   ModeStack[11]->SetFillColor(kGreen);
   //ModeStack[11]->SetFillStyle(3004);
-  ModeStack[11]->SetLineColor(kGreen); 
+  ModeStack[11]->SetLineColor(kGreen);
   //ModeStack[12]->SetTitle("#it{#nu + n #rightarrow l^{-} + p + #pi^{0}}");
   ModeStack[12]->SetTitle("CC1#pi^{0} on n");
-  ModeStack[12]->SetFillColor(kGreen+3);
+  ModeStack[12]->SetFillColor(kGreen + 3);
   //ModeStack[12]->SetFillStyle(3005);
-  ModeStack[12]->SetLineColor(kGreen); 
+  ModeStack[12]->SetLineColor(kGreen);
   //ModeStack[13]->SetTitle("#it{#nu + n #rightarrow l^{-} + n + #pi^{+}}");
   ModeStack[13]->SetTitle("CC1#pi^{+} on n");
-  ModeStack[13]->SetFillColor(kGreen-2);
+  ModeStack[13]->SetFillColor(kGreen - 2);
   //ModeStack[13]->SetFillStyle(3004);
-  ModeStack[13]->SetLineColor(kGreen); 
+  ModeStack[13]->SetLineColor(kGreen);
 
   ModeStack[16]->SetTitle("CC coherent");
   ModeStack[16]->SetFillColor(kBlue);
   //ModeStack[16]->SetFillStyle(3644);
-  ModeStack[16]->SetLineColor(kBlue); 
+  ModeStack[16]->SetLineColor(kBlue);
 
   //ModeStack[17]->SetTitle("#it{#nu + n #rightarrow l^{-} + p + #gamma}");
   ModeStack[17]->SetTitle("CC1#gamma");
   ModeStack[17]->SetFillColor(kMagenta);
   //ModeStack[17]->SetFillStyle(3001);
-  ModeStack[17]->SetLineColor(kMagenta); 
+  ModeStack[17]->SetLineColor(kMagenta);
 
   ModeStack[21]->SetTitle("Multi #pi (1.3 < W < 2.0)");
   ModeStack[21]->SetFillColor(kYellow);
   //ModeStack[21]->SetFillStyle(3005);
-  ModeStack[21]->SetLineColor(kYellow); 
+  ModeStack[21]->SetLineColor(kYellow);
 
   //ModeStack[22]->SetTitle("#it{#nu + n #rightarrow l^{-} + p + #eta^{0}}");
   ModeStack[22]->SetTitle("CC1#eta^{0} on n");
-  ModeStack[22]->SetFillColor(kYellow-2);
+  ModeStack[22]->SetFillColor(kYellow - 2);
   //ModeStack[22]->SetFillStyle(3013);
-  ModeStack[22]->SetLineColor(kYellow-2); 
+  ModeStack[22]->SetLineColor(kYellow - 2);
   //ModeStack[23]->SetTitle("#it{#nu + n #rightarrow l^{-} + #Lambda + K^{+}}");
   ModeStack[23]->SetTitle("CC1#Labda1K^{+}");
-  ModeStack[23]->SetFillColor(kYellow-6);
+  ModeStack[23]->SetFillColor(kYellow - 6);
   //ModeStack[23]->SetFillStyle(3013);
-  ModeStack[23]->SetLineColor(kYellow-6); 
+  ModeStack[23]->SetLineColor(kYellow - 6);
 
   ModeStack[26]->SetTitle("DIS (W > 2.0)");
   ModeStack[26]->SetFillColor(kRed);
   //ModeStack[26]->SetFillStyle(3006);
-  ModeStack[26]->SetLineColor(kRed); 
+  ModeStack[26]->SetLineColor(kRed);
 
   // NC
   //ModeStack[31]->SetTitle("#it{#nu + n #rightarrow #nu + n + #pi^{0}}");
   ModeStack[31]->SetTitle("NC1#pi^{0} on n");
   ModeStack[31]->SetFillColor(kBlue);
   //ModeStack[31]->SetFillStyle(3004);
-  ModeStack[31]->SetLineColor(kBlue); 
+  ModeStack[31]->SetLineColor(kBlue);
   //ModeStack[32]->SetTitle("#it{#nu + p #rightarrow #nu + p + #pi^{0}}");
   ModeStack[32]->SetTitle("NC1#pi^{0} on p");
-  ModeStack[32]->SetFillColor(kBlue+3);
+  ModeStack[32]->SetFillColor(kBlue + 3);
   //ModeStack[32]->SetFillStyle(3004);
-  ModeStack[32]->SetLineColor(kBlue+3); 
+  ModeStack[32]->SetLineColor(kBlue + 3);
   //ModeStack[33]->SetTitle("#it{#nu + n #rightarrow #nu + p + #pi^{-}}");
   ModeStack[33]->SetTitle("NC1#pi^{-} on n");
-  ModeStack[33]->SetFillColor(kBlue-2);
+  ModeStack[33]->SetFillColor(kBlue - 2);
   //ModeStack[33]->SetFillStyle(3005);
-  ModeStack[33]->SetLineColor(kBlue-2); 
+  ModeStack[33]->SetLineColor(kBlue - 2);
   //ModeStack[34]->SetTitle("#it{#nu + p #rightarrow #nu + n + #pi^{+}}");
   ModeStack[34]->SetTitle("NC1#pi^{+} on p");
-  ModeStack[34]->SetFillColor(kBlue-8);
+  ModeStack[34]->SetFillColor(kBlue - 8);
   //ModeStack[34]->SetFillStyle(3005);
-  ModeStack[34]->SetLineColor(kBlue-8); 
+  ModeStack[34]->SetLineColor(kBlue - 8);
 
   ModeStack[36]->SetTitle("NC Coherent");
-  ModeStack[36]->SetFillColor(kBlue+8);
+  ModeStack[36]->SetFillColor(kBlue + 8);
   //ModeStack[36]->SetFillStyle(3644);
-  ModeStack[36]->SetLineColor(kBlue+8); 
+  ModeStack[36]->SetLineColor(kBlue + 8);
 
   //ModeStack[38]->SetTitle("#it{#nu + n #rightarrow #nu + n + #gamma}");
   ModeStack[38]->SetTitle("NC1#gamma on n");
   ModeStack[38]->SetFillColor(kMagenta);
   //ModeStack[38]->SetFillStyle(3001);
-  ModeStack[38]->SetLineColor(kMagenta); 
+  ModeStack[38]->SetLineColor(kMagenta);
   //ModeStack[39]->SetTitle("#it{#nu + p #rightarrow #nu + p + #gamma}");
   ModeStack[39]->SetTitle("NC1#gamma on p");
-  ModeStack[39]->SetFillColor(kMagenta-10);
+  ModeStack[39]->SetFillColor(kMagenta - 10);
   //ModeStack[39]->SetFillStyle(3001);
-  ModeStack[39]->SetLineColor(kMagenta-10); 
+  ModeStack[39]->SetLineColor(kMagenta - 10);
 
   ModeStack[41]->SetTitle("Multi #pi (1.3 < W < 2.0)");
-  ModeStack[41]->SetFillColor(kBlue-10);
+  ModeStack[41]->SetFillColor(kBlue - 10);
   //ModeStack[41]->SetFillStyle(3005);
-  ModeStack[41]->SetLineColor(kBlue-10); 
+  ModeStack[41]->SetLineColor(kBlue - 10);
 
   //ModeStack[42]->SetTitle("#it{#nu + n #rightarrow #nu + n + #eta^{0}}");
   ModeStack[42]->SetTitle("NC1#eta^{0} on n");
-  ModeStack[42]->SetFillColor(kYellow-2);
+  ModeStack[42]->SetFillColor(kYellow - 2);
   //ModeStack[42]->SetFillStyle(3013);
-  ModeStack[42]->SetLineColor(kYellow-2); 
+  ModeStack[42]->SetLineColor(kYellow - 2);
   //ModeStack[43]->SetTitle("#it{#nu + p #rightarrow #nu + p + #eta^{0}}");
   ModeStack[43]->SetTitle("NC1#eta^{0} on p");
-  ModeStack[43]->SetFillColor(kYellow-4);
+  ModeStack[43]->SetFillColor(kYellow - 4);
   //ModeStack[43]->SetFillStyle(3013);
-  ModeStack[43]->SetLineColor(kYellow-4); 
+  ModeStack[43]->SetLineColor(kYellow - 4);
 
   //ModeStack[44]->SetTitle("#it{#nu + n #rightarrow #nu + #Lambda + K^{0}}");
   ModeStack[44]->SetTitle("NC1#Lambda1K^{0} on n");
   ModeStack[44]->SetFillColor(kYellow - 6);
   //ModeStack[44]->SetFillStyle(3014);
-  ModeStack[44]->SetLineColor(kYellow - 6); 
+  ModeStack[44]->SetLineColor(kYellow - 6);
   //ModeStack[45]->SetTitle("#it{#nu + p #rightarrow #nu + #Lambda + K^{+}}");
   ModeStack[45]->SetTitle("NC1#Lambda1K^{+}");
   ModeStack[45]->SetFillColor(kYellow - 10);
   //ModeStack[45]->SetFillStyle(3014);
-  ModeStack[45]->SetLineColor(kYellow - 10); 
+  ModeStack[45]->SetLineColor(kYellow - 10);
 
   ModeStack[46]->SetTitle("DIS (W > 2.0)");
   ModeStack[46]->SetFillColor(kRed);
   //ModeStack[46]->SetFillStyle(3006);
-  ModeStack[46]->SetLineColor(kRed); 
+  ModeStack[46]->SetLineColor(kRed);
 
   //ModeStack[51]->SetTitle("#it{#nu + p #rightarrow #nu + p}");
   ModeStack[51]->SetTitle("NC on p");
   ModeStack[51]->SetFillColor(kBlack);
   //ModeStack[51]->SetFillStyle(3444);
-  ModeStack[51]->SetLineColor(kBlack); 
+  ModeStack[51]->SetLineColor(kBlack);
   //ModeStack[52]->SetTitle("#it{#nu + n #rightarrow #nu + n}");
   ModeStack[52]->SetTitle("NC on n");
   ModeStack[52]->SetFillColor(kGray);
   //ModeStack[52]->SetFillStyle(3444);
-  ModeStack[52]->SetLineColor(kGray); 
-
-  
-
+  ModeStack[52]->SetLineColor(kGray);
 
   return allmodes;
-
-
 };
 
 
-TLegend PlotUtils::GenerateStackLegend(THStack stack, int xlow, int ylow, int xhigh, int yhigh){
+TLegend PlotUtils::GenerateStackLegend(THStack stack, int xlow, int ylow, int xhigh, int yhigh) {
 
-  TLegend leg = TLegend(xlow,ylow,xhigh,yhigh);
+  TLegend leg = TLegend(xlow, ylow, xhigh, yhigh);
 
   TObjArray* histarray = stack.GetStack();
 
   int nhist = histarray->GetEntries();
-  for (int i = 0; i < nhist; i++){
+  for (int i = 0; i < nhist; i++) {
     TH1* hist = (TH1*)(histarray->At(i));
     leg.AddEntry( (hist), ((TH1*)histarray->At(i))->GetTitle(), "fl");
   }
 
-  leg.SetName(Form("%s_LEG",stack.GetName()));
- 
+  leg.SetName(Form("%s_LEG", stack.GetName()));
+
   return leg;
-  
+
 };
 
 
-void PlotUtils::ScaleNeutModeArray(TH1* hist[], double factor, std::string option){
-  
-  for (int i = 0; i < 60; i++){
+void PlotUtils::ScaleNeutModeArray(TH1* hist[], double factor, std::string option) {
+
+  for (int i = 0; i < 60; i++) {
     if (hist[i])
-      hist[i]->Scale(factor,option.c_str());
-  }  
+      hist[i]->Scale(factor, option.c_str());
+  }
 
   return;
 };
 
-void PlotUtils::ResetNeutModeArray(TH1* hist[]){
-  
-  for (int i = 0; i < 60; i++){
+void PlotUtils::ResetNeutModeArray(TH1* hist[]) {
+
+  for (int i = 0; i < 60; i++) {
     if (hist[i])
       hist[i]->Reset();
   }
- 
+
   return;
 };
 
 
 //********************************************************************
 // This assumes the Enu axis is the x axis, as is the case for MiniBooNE 2D distributions
 void PlotUtils::FluxUnfoldedScaling(TH2D* fMCHist, TH1D* fhist, TH1D* ehist, double scalefactor) {
 //********************************************************************
-  
+
   // Make clones to avoid changing stuff
   TH1D* eventhist = (TH1D*)ehist->Clone();
   TH1D* fFluxHist = (TH1D*)fhist->Clone();
 
-  // Undo width integral in SF  
-  fMCHist->Scale( scalefactor / eventhist->Integral(1,eventhist->GetNbinsX()+1,"width"));
+  // Undo width integral in SF
+  fMCHist->Scale( scalefactor / eventhist->Integral(1, eventhist->GetNbinsX() + 1, "width"));
 
-  // Standardise The Flux       
-  eventhist->Scale(1.0/fFluxHist->Integral());
-  fFluxHist->Scale(1.0/fFluxHist->Integral());
+  // Standardise The Flux
+  eventhist->Scale(1.0 / fFluxHist->Integral());
+  fFluxHist->Scale(1.0 / fFluxHist->Integral());
 
   // Do interpolation for 2D plots?
   // fFluxHist = PlotUtils::InterpolateFineHistogram(fFluxHist,100,"width");
   // eventhist = PlotUtils::InterpolateFineHistogram(eventhist,100,"width");
 
   // eventhist->Scale(1.0/fFluxHist->Integral());
   // fFluxHist->Scale(1.0/fFluxHist->Integral());
 
-  // Scale fMCHist by eventhist integral          
-  fMCHist->Scale( eventhist->Integral(1,eventhist->GetNbinsX()+1) );
+  // Scale fMCHist by eventhist integral
+  fMCHist->Scale( eventhist->Integral(1, eventhist->GetNbinsX() + 1) );
 
   // Now Get a flux PDF assuming X axis is Enu
   TH1D* pdfflux = (TH1D*) fMCHist->ProjectionX()->Clone();
   //  pdfflux->Write( (std::string(fMCHist->GetName()) + "_PROJX").c_str());
   pdfflux->Reset();
 
   // Awful MiniBooNE Check for the time being
   bool ismb = std::string(fMCHist->GetName()).find("MiniBooNE") != std::string::npos;
 
-  for (int i = 0; i < pdfflux->GetNbinsX(); i++){
+  for (int i = 0; i < pdfflux->GetNbinsX(); i++) {
 
-    double Ml = pdfflux->GetXaxis()->GetBinLowEdge(i+1);
-    double Mh = pdfflux->GetXaxis()->GetBinLowEdge(i+2);
+    double Ml = pdfflux->GetXaxis()->GetBinLowEdge(i + 1);
+    double Mh = pdfflux->GetXaxis()->GetBinLowEdge(i + 2);
     //double Mc = pdfflux->GetXaxis()->GetBinCenter(i+1);
     //double Mw = pdfflux->GetBinWidth(i+1);
     double fluxint = 0.0;
 
     // Scaling to match flux for MB
-    if (ismb){
+    if (ismb) {
       Ml /= 1.E3;
       Mh /= 1.E3;
       //  Mc /= 1.E3;
       //  Mw /= 1.E3;
     }
 
-    for (int j = 0; j < fFluxHist->GetNbinsX(); j++){
+    for (int j = 0; j < fFluxHist->GetNbinsX(); j++) {
 
       //double Fc = fFluxHist->GetXaxis()->GetBinCenter(j+1);
-      double Fl = fFluxHist->GetXaxis()->GetBinLowEdge(j+1);
-      double Fh = fFluxHist->GetXaxis()->GetBinLowEdge(j+2);
-      double Fe = fFluxHist->GetBinContent(j+1);
-      double Fw = fFluxHist->GetXaxis()->GetBinWidth(j+1);
-
-      if (Fl >= Ml and Fh <= Mh){ fluxint += Fe; }
-      else if (Fl < Ml and Fl < Mh and Fh > Ml and Fh < Mh){  fluxint += Fe * (Fh - Ml)/Fw;  }
-      else if (Fh > Mh and Fl < Mh and Fh > Ml and Fl > Ml){  fluxint += Fe * (Mh - Fl)/Fw; }
-      else if (Ml >= Fl and Mh <= Fh){  fluxint += Fe * (Mh - Ml)/Fw; }
+      double Fl = fFluxHist->GetXaxis()->GetBinLowEdge(j + 1);
+      double Fh = fFluxHist->GetXaxis()->GetBinLowEdge(j + 2);
+      double Fe = fFluxHist->GetBinContent(j + 1);
+      double Fw = fFluxHist->GetXaxis()->GetBinWidth(j + 1);
+
+      if (Fl >= Ml and Fh <= Mh) { fluxint += Fe; }
+      else if (Fl < Ml and Fl < Mh and Fh > Ml and Fh < Mh) {  fluxint += Fe * (Fh - Ml) / Fw;  }
+      else if (Fh > Mh and Fl < Mh and Fh > Ml and Fl > Ml) {  fluxint += Fe * (Mh - Fl) / Fw; }
+      else if (Ml >= Fl and Mh <= Fh) {  fluxint += Fe * (Mh - Ml) / Fw; }
       else { continue; }
 
     }
 
-    pdfflux->SetBinContent(i+1, fluxint);
+    pdfflux->SetBinContent(i + 1, fluxint);
   }
 
   for (int i = 0; i < fMCHist->GetNbinsX(); i++) {
-    for (int j = 0; j < fMCHist->GetNbinsY(); j++){ 
+    for (int j = 0; j < fMCHist->GetNbinsY(); j++) {
 
-      if (pdfflux->GetBinContent(i+1) == 0.0) continue;
+      if (pdfflux->GetBinContent(i + 1) == 0.0) continue;
 
-      double binWidth = fMCHist->GetYaxis()->GetBinLowEdge(j+2) - fMCHist->GetYaxis()->GetBinLowEdge(j+1);
-      fMCHist->SetBinContent(i+1, j+1, fMCHist->GetBinContent(i+1,j+1) /pdfflux->GetBinContent(i+1) / binWidth);
-      fMCHist->SetBinError(i+1, j+1, fMCHist->GetBinError(i+1,j+1) /pdfflux->GetBinContent(i+1) / binWidth);
+      double binWidth = fMCHist->GetYaxis()->GetBinLowEdge(j + 2) - fMCHist->GetYaxis()->GetBinLowEdge(j + 1);
+      fMCHist->SetBinContent(i + 1, j + 1, fMCHist->GetBinContent(i + 1, j + 1) / pdfflux->GetBinContent(i + 1) / binWidth);
+      fMCHist->SetBinError(i + 1, j + 1, fMCHist->GetBinError(i + 1, j + 1) / pdfflux->GetBinContent(i + 1) / binWidth);
 
     }
   }
 
   delete eventhist;
   delete fFluxHist;
 
   return;
 };
 
-TH1D* PlotUtils::InterpolateFineHistogram(TH1D* hist, int res, std::string opt){
+TH1D* PlotUtils::InterpolateFineHistogram(TH1D* hist, int res, std::string opt) {
 
   int nbins = hist->GetNbinsX();
   double elow  = hist->GetXaxis()->GetBinLowEdge(1);
-  double ehigh = hist->GetXaxis()->GetBinLowEdge(nbins+1);
+  double ehigh = hist->GetXaxis()->GetBinLowEdge(nbins + 1);
   bool width = true; //opt.find("width") != std::string::npos;
 
-  TH1D* fine = new TH1D("fine","fine", nbins*res, elow, ehigh);
+  TH1D* fine = new TH1D("fine", "fine", nbins * res, elow, ehigh);
 
   TGraph* temp = new TGraph();
 
-  for (int i = 0; i < nbins; i++){
-      double E = hist->GetXaxis()->GetBinCenter(i+1);
-      double C = hist->GetBinContent(i+1);
-      double W = hist->GetXaxis()->GetBinWidth(i+1);
-      if (!width) W = 1.0;
+  for (int i = 0; i < nbins; i++) {
+    double E = hist->GetXaxis()->GetBinCenter(i + 1);
+    double C = hist->GetBinContent(i + 1);
+    double W = hist->GetXaxis()->GetBinWidth(i + 1);
+    if (!width) W = 1.0;
 
-      if (W != 0.0) temp->SetPoint( temp->GetN(), E, C / W );
+    if (W != 0.0) temp->SetPoint( temp->GetN(), E, C / W );
   }
 
-  for (int i = 0; i < fine->GetNbinsX(); i++){
-      double E = fine->GetXaxis()->GetBinCenter(i+1);
-      double W = fine->GetBinWidth(i+1);
-      if (!width) W = 1.0;
+  for (int i = 0; i < fine->GetNbinsX(); i++) {
+    double E = fine->GetXaxis()->GetBinCenter(i + 1);
+    double W = fine->GetBinWidth(i + 1);
+    if (!width) W = 1.0;
 
-      fine->SetBinContent(i+1, temp->Eval(E,0,"S") * W);
+    fine->SetBinContent(i + 1, temp->Eval(E, 0, "S") * W);
   }
 
-  fine->Scale(hist->Integral(1,hist->GetNbinsX()+1) / fine->Integral(1, fine->GetNbinsX()+1));
-  std::cout << "Interpolation Difference = " << fine->Integral(1,fine->GetNbinsX()+1) << "/" << hist->Integral(1,hist->GetNbinsX()+1) << std::endl; 
-	   
+  fine->Scale(hist->Integral(1, hist->GetNbinsX() + 1) / fine->Integral(1, fine->GetNbinsX() + 1));
+  std::cout << "Interpolation Difference = " << fine->Integral(1, fine->GetNbinsX() + 1) << "/" << hist->Integral(1, hist->GetNbinsX() + 1) << std::endl;
+
   return fine;
 }
 
 
 
 
-//******************************************************************** 
+//********************************************************************
 // This interpolates the flux by a TGraph instead of requiring the flux and MC flux to have the same binning
 void PlotUtils::FluxUnfoldedScaling(TH1D* mcHist, TH1D* fhist, TH1D* ehist, double scalefactor, int nevents) {
-//******************************************************************** 
+//********************************************************************
 
   TH1D* eventhist = (TH1D*)ehist->Clone();
   TH1D* fFluxHist = (TH1D*)fhist->Clone();
 
-  if (FitPar::Config().GetParB("save_flux_debug")){
+  if (FitPar::Config().GetParB("save_flux_debug")) {
     std::string name = std::string(mcHist->GetName());
-    
+
     mcHist->Write((name + "_UNF_MC").c_str());
     fFluxHist->Write((name + "_UNF_FLUX").c_str());
     eventhist->Write((name + "_UNF_EVT").c_str());
-    
-    TH1D* scalehist = new TH1D("scalehist","scalehist",1,0.0,1.0);
-    scalehist->SetBinContent(1,scalefactor);
-    scalehist->SetBinContent(2,nevents);
-  
-    scalehist->Write((name + "_UNF_SCALE").c_str());  
+
+    TH1D* scalehist = new TH1D("scalehist", "scalehist", 1, 0.0, 1.0);
+    scalehist->SetBinContent(1, scalefactor);
+    scalehist->SetBinContent(2, nevents);
+
+    scalehist->Write((name + "_UNF_SCALE").c_str());
   }
 
   // Undo width integral in SF
-  mcHist->Scale( scalefactor / eventhist->Integral(1,eventhist->GetNbinsX()+1,"width"));
-  
+  mcHist->Scale( scalefactor / eventhist->Integral(1, eventhist->GetNbinsX() + 1, "width"));
+
   // Standardise The Flux
-  eventhist->Scale(1.0/fFluxHist->Integral());
-  fFluxHist->Scale(1.0/fFluxHist->Integral());
+  eventhist->Scale(1.0 / fFluxHist->Integral());
+  fFluxHist->Scale(1.0 / fFluxHist->Integral());
 
   // Scale mcHist by eventhist integral
-  mcHist->Scale( eventhist->Integral(1,eventhist->GetNbinsX()+1) );
-  
+  mcHist->Scale( eventhist->Integral(1, eventhist->GetNbinsX() + 1) );
+
   // Now Get a flux PDF
   TH1D* pdfflux = (TH1D*) mcHist->Clone();
   pdfflux->Reset();
 
-  for (int i = 0; i < mcHist->GetNbinsX(); i++){
+  for (int i = 0; i < mcHist->GetNbinsX(); i++) {
 
-    double Ml = mcHist->GetXaxis()->GetBinLowEdge(i+1);
-    double Mh = mcHist->GetXaxis()->GetBinLowEdge(i+2);
+    double Ml = mcHist->GetXaxis()->GetBinLowEdge(i + 1);
+    double Mh = mcHist->GetXaxis()->GetBinLowEdge(i + 2);
     //double Mc = mcHist->GetXaxis()->GetBinCenter(i+1);
     //double Me = mcHist->GetBinContent(i+1);
     //double Mw = mcHist->GetBinWidth(i+1);
     double fluxint = 0.0;
 
-    for (int j = 0; j < fFluxHist->GetNbinsX(); j++){
-      
+    for (int j = 0; j < fFluxHist->GetNbinsX(); j++) {
+
       //double Fc = fFluxHist->GetXaxis()->GetBinCenter(j+1);
-      double Fl = fFluxHist->GetXaxis()->GetBinLowEdge(j+1);
-      double Fh = fFluxHist->GetXaxis()->GetBinLowEdge(j+2);
-      double Fe = fFluxHist->GetBinContent(j+1);
-      double Fw = fFluxHist->GetXaxis()->GetBinWidth(j+1);
-      
-      if (Fl >= Ml and Fh <= Mh){ fluxint += Fe; }
-      else if (Fl < Ml and Fl < Mh and Fh > Ml and Fh < Mh){  fluxint += Fe * (Fh - Ml)/Fw;  }
-      else if (Fh > Mh and Fl < Mh and Fh > Ml and Fl > Ml){  fluxint += Fe * (Mh - Fl)/Fw; }
-      else if (Ml >= Fl and Mh <= Fh){	fluxint += Fe * (Mh - Ml)/Fw; }
+      double Fl = fFluxHist->GetXaxis()->GetBinLowEdge(j + 1);
+      double Fh = fFluxHist->GetXaxis()->GetBinLowEdge(j + 2);
+      double Fe = fFluxHist->GetBinContent(j + 1);
+      double Fw = fFluxHist->GetXaxis()->GetBinWidth(j + 1);
+
+      if (Fl >= Ml and Fh <= Mh) { fluxint += Fe; }
+      else if (Fl < Ml and Fl < Mh and Fh > Ml and Fh < Mh) {  fluxint += Fe * (Fh - Ml) / Fw;  }
+      else if (Fh > Mh and Fl < Mh and Fh > Ml and Fl > Ml) {  fluxint += Fe * (Mh - Fl) / Fw; }
+      else if (Ml >= Fl and Mh <= Fh) {  fluxint += Fe * (Mh - Ml) / Fw; }
       else { continue; }
 
     }
 
-    pdfflux->SetBinContent(i+1, fluxint);
+    pdfflux->SetBinContent(i + 1, fluxint);
   }
 
   // Scale MC hist by pdfflux
-  for (int i = 0; i < mcHist->GetNbinsX(); i++){
-    if (pdfflux->GetBinContent(i+1) == 0.0) continue;
+  for (int i = 0; i < mcHist->GetNbinsX(); i++) {
+    if (pdfflux->GetBinContent(i + 1) == 0.0) continue;
 
-    mcHist->SetBinContent(i+1, mcHist->GetBinContent(i+1) / pdfflux->GetBinContent(i+1));
-    mcHist->SetBinError(i+1, mcHist->GetBinError(i+1) / pdfflux->GetBinContent(i+1));
+    mcHist->SetBinContent(i + 1, mcHist->GetBinContent(i + 1) / pdfflux->GetBinContent(i + 1));
+    mcHist->SetBinError(i + 1, mcHist->GetBinError(i + 1) / pdfflux->GetBinContent(i + 1));
   }
 
   delete eventhist;
   delete fFluxHist;
 
   return;
 };
 
 
 // MOVE TO GENERAL UTILS
-//********************************************************************                                                                                                
-void PlotUtils::Set2DHistFromText(std::string dataFile, TH2* hist, double norm, bool skipbins){
+//********************************************************************
+void PlotUtils::Set2DHistFromText(std::string dataFile, TH2* hist, double norm, bool skipbins) {
 //********************************************************************
 
   std::string line;
-  std::ifstream data(dataFile.c_str(),ifstream::in);
+  std::ifstream data(dataFile.c_str(), ifstream::in);
 
   int yBin = 0;
-  while(std::getline(data >> std::ws, line, '\n')){
-    
+  while (std::getline(data >> std::ws, line, '\n')) {
+
     std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
 
     // Loop over entries and insert them into the histogram
-    for (uint xBin = 0; xBin < entries.size(); xBin++){
-    
+    for (uint xBin = 0; xBin < entries.size(); xBin++) {
+
       if (!skipbins or entries[xBin] != -1.0)
-	hist->SetBinContent(xBin+1, yBin+1, entries[xBin]*norm);
+        hist->SetBinContent(xBin + 1, yBin + 1, entries[xBin]*norm);
     }
     yBin++;
   }
 
   return;
 
 }
 
 
 
 // MOVE TO GENERAL UTILS
-TH1D* PlotUtils::GetTH1DFromFile(std::string dataFile, std::string title, std::string fPlotTitles, std::string alt_name){
-  
+TH1D* PlotUtils::GetTH1DFromFile(std::string dataFile, std::string title, std::string fPlotTitles, std::string alt_name) {
+
   TH1D* tempPlot;
 
   // If format is a root file
-  if (dataFile.find(".root") != std::string::npos){
-    
+  if (dataFile.find(".root") != std::string::npos) {
+
     TFile* temp_infile = new TFile(dataFile.c_str(), "READ");
     tempPlot = (TH1D*)temp_infile->Get(title.c_str());
     tempPlot->SetDirectory(0);
 
     temp_infile->Close();
     delete temp_infile;
 
-  // Else its a space seperated txt file
+    // Else its a space seperated txt file
   } else {
-    
-    // Make a TGraph Errors 
-    TGraphErrors *gr = new TGraphErrors(dataFile.c_str(),"%lg %lg %lg");
+
+    // Make a TGraph Errors
+    TGraphErrors *gr = new TGraphErrors(dataFile.c_str(), "%lg %lg %lg");
     if (gr->IsZombie()) {
       exit(-1);
     }
     double* bins = gr->GetX();
     double* values = gr->GetY();
     double* errors = gr->GetEY();
     int npoints = gr->GetN();
 
     // Fill the histogram from it
-    tempPlot = new TH1D(title.c_str(),title.c_str(),npoints-1,bins);
+    tempPlot = new TH1D(title.c_str(), title.c_str(), npoints - 1, bins);
 
-    for (int i = 0; i < npoints; ++i){
+    for (int i = 0; i < npoints; ++i) {
       tempPlot->SetBinContent(i+1, values[i]);
 
       // If only two columns are present in the input file, use the sqrt(values) as the error
       // equivalent to assuming that the error is statistical
       if (!errors[i]) tempPlot->SetBinError(i+1, sqrt(values[i]));
       else tempPlot->SetBinError(i+1, errors[i]);
     }
 
     delete gr;
   }
 
   // Allow alternate naming for root files
-  if (!alt_name.empty()){
+  if (!alt_name.empty()) {
     tempPlot->SetNameTitle(alt_name.c_str(), alt_name.c_str());
   }
 
   // Allow alternate axis titles
-  if (!fPlotTitles.empty()){
+  if (!fPlotTitles.empty()) {
     tempPlot->SetNameTitle( tempPlot->GetName(), (std::string(tempPlot->GetTitle()) + fPlotTitles).c_str() );
   }
-  
+
   return tempPlot;
 };
 
-TH1D* PlotUtils::GetRatioPlot(TH1D* hist1,   TH1D* hist2){
+TH1D* PlotUtils::GetRatioPlot(TH1D* hist1,   TH1D* hist2) {
 
   // make copy of first hist
   TH1D* new_hist = (TH1D*) hist1->Clone();
-  
+
   // Do bins and errors ourselves as scales can go awkward
-  for (int i = 0; i < new_hist->GetNbinsX(); i++){
+  for (int i = 0; i < new_hist->GetNbinsX(); i++) {
 
-    if (hist2->GetBinContent(i+1) == 0.0){
-      new_hist->SetBinContent(i+1, 0.0);
+    if (hist2->GetBinContent(i + 1) == 0.0) {
+      new_hist->SetBinContent(i + 1, 0.0);
     }
 
-    new_hist->SetBinContent(i+1, hist1->GetBinContent(i+1) / hist2->GetBinContent(i+1) );
-    new_hist->SetBinError(i+1,   hist1->GetBinError(i+1)   / hist2->GetBinContent(i+1) );
+    new_hist->SetBinContent(i + 1, hist1->GetBinContent(i + 1) / hist2->GetBinContent(i + 1) );
+    new_hist->SetBinError(i + 1,   hist1->GetBinError(i + 1)   / hist2->GetBinContent(i + 1) );
   }
 
   return new_hist;
 
 };
 
-TH1D* PlotUtils::GetRenormalisedPlot(TH1D* hist1,   TH1D* hist2){
+TH1D* PlotUtils::GetRenormalisedPlot(TH1D* hist1,   TH1D* hist2) {
 
   // make copy of first hist
   TH1D* new_hist = (TH1D*) hist1->Clone();
 
-  if (hist1->Integral("width") == 0 or hist2->Integral("width") == 0){
+  if (hist1->Integral("width") == 0 or hist2->Integral("width") == 0) {
     new_hist->Reset();
     return new_hist;
   }
 
   Double_t scaleF = hist2->Integral("width") / hist1->Integral("width");
   new_hist->Scale(scaleF);
-  
+
   return new_hist;
 };
 
 
-TH1D* PlotUtils::GetShapePlot(TH1D* hist1){
+TH1D* PlotUtils::GetShapePlot(TH1D* hist1) {
 
   // make copy of first hist
   TH1D* new_hist = (TH1D*) hist1->Clone();
 
-  if (hist1->Integral("width") == 0){
+  if (hist1->Integral("width") == 0) {
     new_hist->Reset();
     return new_hist;
   }
 
   Double_t scaleF1 = 1.0 / hist1->Integral("width");
-  
+
   new_hist->Scale(scaleF1);
-    
+
   return new_hist;
 };
 
-TH1D* PlotUtils::GetShapeRatio(TH1D* hist1,   TH1D* hist2){
+TH1D* PlotUtils::GetShapeRatio(TH1D* hist1,   TH1D* hist2) {
 
   TH1D* new_hist1 = GetShapePlot(hist1);
   TH1D* new_hist2 = GetShapePlot(hist2);
 
   // Do bins and errors ourselves as scales can go awkward
-  for (int i = 0; i < new_hist1->GetNbinsX(); i++){
+  for (int i = 0; i < new_hist1->GetNbinsX(); i++) {
 
-    if (hist2->GetBinContent(i+1) == 0){
-      new_hist1->SetBinContent(i+1, 0.0);
+    if (hist2->GetBinContent(i + 1) == 0) {
+      new_hist1->SetBinContent(i + 1, 0.0);
     }
 
-    new_hist1->SetBinContent(i+1, new_hist1->GetBinContent(i+1) / new_hist2->GetBinContent(i+1) );
-    new_hist1->SetBinError(i+1,   new_hist1->GetBinError(i+1)   / new_hist2->GetBinContent(i+1) );
+    new_hist1->SetBinContent(i + 1, new_hist1->GetBinContent(i + 1) / new_hist2->GetBinContent(i + 1) );
+    new_hist1->SetBinError(i + 1,   new_hist1->GetBinError(i + 1)   / new_hist2->GetBinContent(i + 1) );
   }
 
   delete new_hist2;
 
   return new_hist1;
 };
 
-TH2D* PlotUtils::GetCovarPlot(TMatrixDSym* cov, std::string name, std::string title){
+TH2D* PlotUtils::GetCovarPlot(TMatrixDSym* cov, std::string name, std::string title) {
 
   TH2D* CovarPlot;
 
   if (cov) CovarPlot = new TH2D((*cov));
-  else CovarPlot = new TH2D(name.c_str(), title.c_str(), 1,0,1,1,0,1);
+  else CovarPlot = new TH2D(name.c_str(), title.c_str(), 1, 0, 1, 1, 0, 1);
 
   CovarPlot->SetName(name.c_str());
   CovarPlot->SetTitle(title.c_str());
-  
+
   return CovarPlot;
 
 }
 
 
-TH2D* PlotUtils::GetFullCovarPlot(TMatrixDSym* cov, std::string name){
+TH2D* PlotUtils::GetFullCovarPlot(TMatrixDSym* cov, std::string name) {
   return PlotUtils::GetCovarPlot(cov, name + "_COV", name + "_COV;Bins;Bins;Covariance (#times10^{-76})");
 }
 
-TH2D* PlotUtils::GetInvCovarPlot(TMatrixDSym* cov, std::string name){
+TH2D* PlotUtils::GetInvCovarPlot(TMatrixDSym* cov, std::string name) {
   return PlotUtils::GetCovarPlot(cov, name + "_INVCOV", name + "_INVCOV;Bins;Bins;Inv. Covariance (#times10^{-76})");
 }
 
-TH2D* PlotUtils::GetDecompCovarPlot(TMatrixDSym* cov, std::string name){
+TH2D* PlotUtils::GetDecompCovarPlot(TMatrixDSym* cov, std::string name) {
   return PlotUtils::GetCovarPlot(cov, name + "_DECCOV", name + "_DECCOV;Bins;Bins;Decomp Covariance (#times10^{-76})");
 }
 
-// RENAME
-TH1* PlotUtils::GetHistFromRootFile(std::string file, std::string name){
+TH1D* PlotUtils::GetTH1DFromRootFile(std::string file, std::string name) {
+
+  if (name.empty()) {
+    std::vector<std::string> tempfile = GeneralUtils::ParseToStr(file, ";");
+    file = tempfile[0];
+    name = tempfile[1];
+  }
+
+  TFile* rootHistFile = new TFile(file.c_str(), "READ");
+  TH1D* tempHist =  (TH1D*) rootHistFile->Get(name.c_str())->Clone();
+  tempHist->SetDirectory(0);
+
+  rootHistFile->Close();
+
+  return tempHist;
+}
+
+
+TH2D* PlotUtils::GetTH2DFromRootFile(std::string file, std::string name) {
+
+  if (name.empty()) {
+    std::vector<std::string> tempfile = GeneralUtils::ParseToStr(file, ";");
+    file = tempfile[0];
+    name = tempfile[1];
+  }
 
-  TFile* rootHistFile = new TFile(file.c_str(),"READ");
-  TH1* tempHist =  (TH1*) rootHistFile->Get(name.c_str())->Clone();
+  TFile* rootHistFile = new TFile(file.c_str(), "READ");
+  TH2D* tempHist =  (TH2D*) rootHistFile->Get(name.c_str())->Clone();
   tempHist->SetDirectory(0);
 
   rootHistFile->Close();
 
   return tempHist;
 }
 
 
+TH2D* PlotUtils::GetTH2DFromTextFile(std::string file) {
+
+  /// Contents should be
+  /// Low Edfe
 
 
+  return NULL;
+}
 
 
-void PlotUtils::AddNeutModeArray(TH1D* hist1[], TH1D* hist2[], double scaling){
+void PlotUtils::AddNeutModeArray(TH1D* hist1[], TH1D* hist2[], double scaling) {
 
-  for (int i = 0; i < 60; i++){
+  for (int i = 0; i < 60; i++) {
     if (!hist2[i]) continue;
     if (!hist1[i]) continue;
     hist1[i]->Add(hist2[i], scaling);
   }
   return;
 }
 
 
-void PlotUtils::ScaleToData(TH1D* data, TH1D* mc, TH1I* mask){
+void PlotUtils::ScaleToData(TH1D* data, TH1D* mc, TH1I* mask) {
 
   double scaleF = GetDataMCRatio(data, mc, mask);
   mc->Scale(scaleF);
-  
+
   return;
 }
 
 
-void PlotUtils::MaskBins(TH1D* hist, TH1I* mask){
+void PlotUtils::MaskBins(TH1D* hist, TH1I* mask) {
 
-  for (int i = 0; i < hist->GetNbinsX(); i++){
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
 
-    if (mask->GetBinContent(i+1) <= 0.5) continue;
+    if (mask->GetBinContent(i + 1) <= 0.5) continue;
 
-    hist->SetBinContent(i+1, 0.0);
-    hist->SetBinError(i+1, 0.0);
-    
-    LOG(REC)<<"MaskBins: Set "<<hist->GetName()<<" Bin "<<i+1<<" to 0.0 +- 0.0"<<std::endl;
+    hist->SetBinContent(i + 1, 0.0);
+    hist->SetBinError(i + 1, 0.0);
+
+    LOG(REC) << "MaskBins: Set " << hist->GetName() << " Bin " << i + 1 << " to 0.0 +- 0.0" << std::endl;
 
   }
- 
+
   return;
 }
 
-void PlotUtils::MaskBins(TH2D* hist, TH2I* mask){
+void PlotUtils::MaskBins(TH2D* hist, TH2I* mask) {
 
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    for (int j = 0; j < hist->GetNbinsY(); j++){
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+    for (int j = 0; j < hist->GetNbinsY(); j++) {
 
-      if (mask->GetBinContent(i+1,j+1) <= 0.5) continue;
+      if (mask->GetBinContent(i + 1, j + 1) <= 0.5) continue;
 
-      hist->SetBinContent(i+1,j+1, 0.0);
-      hist->SetBinError(i+1, j+1,0.0);
+      hist->SetBinContent(i + 1, j + 1, 0.0);
+      hist->SetBinError(i + 1, j + 1, 0.0);
 
-      LOG(REC)<<"MaskBins: Set "<<hist->GetName()<<" Bin "<<i+1<<" "<<j+1<<" to 0.0 +- 0.0"<<std::endl;
+      LOG(REC) << "MaskBins: Set " << hist->GetName() << " Bin " << i + 1 << " " << j + 1 << " to 0.0 +- 0.0" << std::endl;
     }
   }
   return;
 
 }
 
-double PlotUtils::GetDataMCRatio(TH1D* data, TH1D* mc, TH1I* mask){
+double PlotUtils::GetDataMCRatio(TH1D* data, TH1D* mc, TH1I* mask) {
 
   double rat = 1.0;
-  
+
   TH1D* newmc = (TH1D*)mc->Clone();
   TH1D* newdt = (TH1D*)data->Clone();
 
-  if (mask){
+  if (mask) {
     MaskBins(newmc, mask);
     MaskBins(newdt, mask);
   }
 
-  rat = newdt->Integral()/newmc->Integral();
+  rat = newdt->Integral() / newmc->Integral();
 
   return rat;
 }
 
-TH2D* PlotUtils::GetCorrelationPlot(TH2D* cov, std::string name){
+TH2D* PlotUtils::GetCorrelationPlot(TH2D* cov, std::string name) {
 
   TH2D* cor = (TH2D*)cov->Clone();
   cor->Reset();
 
-  for (int i = 0; i < cov->GetNbinsX(); i++){
-    for (int j = 0; j < cov->GetNbinsY(); j++){
-   
-      if (cov->GetBinContent(i+1,i+1) != 0.0 and cov->GetBinContent(j+1,j+1) != 0.0)
-	cor->SetBinContent(i+1,j+1, cov->GetBinContent(i+1,j+1)/(sqrt(cov->GetBinContent(i+1,i+1) * cov->GetBinContent(j+1,j+1))));
+  for (int i = 0; i < cov->GetNbinsX(); i++) {
+    for (int j = 0; j < cov->GetNbinsY(); j++) {
+
+      if (cov->GetBinContent(i + 1, i + 1) != 0.0 and cov->GetBinContent(j + 1, j + 1) != 0.0)
+        cor->SetBinContent(i + 1, j + 1, cov->GetBinContent(i + 1, j + 1) / (sqrt(cov->GetBinContent(i + 1, i + 1) * cov->GetBinContent(j + 1, j + 1))));
 
     }
   }
 
   if (!name.empty()) {
     cor->SetNameTitle(name.c_str(), (name + ";;correlation").c_str());
   }
 
   cor->SetMinimum(-1);
   cor->SetMaximum(1);
 
   return cor;
 }
 
-TH2D* PlotUtils::GetDecompPlot(TH2D* cov, std::string name){
+TH2D* PlotUtils::GetDecompPlot(TH2D* cov, std::string name) {
 
   TMatrixDSym* covarmat = new TMatrixDSym(cov->GetNbinsX());
 
   for (int i = 0; i < cov->GetNbinsX(); i++)
     for (int j = 0; j < cov->GetNbinsY(); j++)
-      (*covarmat)(i,j) = cov->GetBinContent(i+1,j+1);
+      (*covarmat)(i, j) = cov->GetBinContent(i + 1, j + 1);
 
   TMatrixDSym* decompmat = StatUtils::GetDecomp(covarmat);
 
   TH2D* dec = (TH2D*) cov->Clone();
   for (int i = 0; i < cov->GetNbinsX(); i++)
     for (int j = 0; j < cov->GetNbinsY(); j++)
-      dec->SetBinContent(i+1,j+1,(*decompmat)(i,j));
+      dec->SetBinContent(i + 1, j + 1, (*decompmat)(i, j));
 
   delete covarmat;
   delete decompmat;
 
-  dec->SetNameTitle(name.c_str(),(name + ";;;decomposition").c_str());
+  dec->SetNameTitle(name.c_str(), (name + ";;;decomposition").c_str());
 
   return dec;
 }
 
 
-TH2D* PlotUtils::MergeIntoTH2D(TH1D* xhist, TH1D* yhist, std::string zname){
+TH2D* PlotUtils::MergeIntoTH2D(TH1D* xhist, TH1D* yhist, std::string zname) {
 
 
   std::vector<double> xedges, yedges;
-  for (int i = 0; i < xhist->GetNbinsX()+2; i++) {
-    xedges.push_back(xhist->GetXaxis()->GetBinLowEdge(i+1));
+  for (int i = 0; i < xhist->GetNbinsX() + 2; i++) {
+    xedges.push_back(xhist->GetXaxis()->GetBinLowEdge(i + 1));
   }
-  for (int i = 0; i < yhist->GetNbinsX()+2; i++) {
-    yedges.push_back(yhist->GetXaxis()->GetBinLowEdge(i+1));
+  for (int i = 0; i < yhist->GetNbinsX() + 2; i++) {
+    yedges.push_back(yhist->GetXaxis()->GetBinLowEdge(i + 1));
   }
 
   int nbinsx = xhist->GetNbinsX();
   int nbinsy = yhist->GetNbinsX();
 
-  std::string name = std::string(xhist->GetName())+"_vs_"+std::string(yhist->GetName());
+  std::string name = std::string(xhist->GetName()) + "_vs_" + std::string(yhist->GetName());
   std::string titles = ";" + std::string(xhist->GetXaxis()->GetTitle()) + ";" + std::string(yhist->GetXaxis()->GetTitle()) + ";" + zname;
 
-  TH2D* newplot = new TH2D(name.c_str(),(name+titles).c_str(), nbinsx, &xedges[0], nbinsy, &yedges[0]);
+  TH2D* newplot = new TH2D(name.c_str(), (name + titles).c_str(), nbinsx, &xedges[0], nbinsy, &yedges[0]);
 
   return newplot;
 }
 
 //***************************************************
-void PlotUtils::MatchEmptyBins(TH1D* data, TH1D* mc){
+void PlotUtils::MatchEmptyBins(TH1D* data, TH1D* mc) {
 //**************************************************
 
-  for (int i = 0; i < data->GetNbinsX(); i++){
-    if (data->GetBinContent(i+1) == 0.0 or data->GetBinError(i+1) == 0.0)
-      mc->SetBinContent(i+1,0.0);
+  for (int i = 0; i < data->GetNbinsX(); i++) {
+    if (data->GetBinContent(i + 1) == 0.0 or data->GetBinError(i + 1) == 0.0)
+      mc->SetBinContent(i + 1, 0.0);
   }
-  
+
   return;
 }
 
 
 //***************************************************
-void PlotUtils::MatchEmptyBins(TH2D* data, TH2D* mc){
+void PlotUtils::MatchEmptyBins(TH2D* data, TH2D* mc) {
 //**************************************************
 
-  for (int i = 0; i < data->GetNbinsX(); i++){
-    for (int j = 0; j < data->GetNbinsY(); j++){
-      if (data->GetBinContent(i+1,j+1) == 0.0 or data->GetBinError(i+1,j+1) == 0.0)
-	mc->SetBinContent(i+1,j+1,0.0);
+  for (int i = 0; i < data->GetNbinsX(); i++) {
+    for (int j = 0; j < data->GetNbinsY(); j++) {
+      if (data->GetBinContent(i + 1, j + 1) == 0.0 or data->GetBinError(i + 1, j + 1) == 0.0)
+        mc->SetBinContent(i + 1, j + 1, 0.0);
     }
   }
 
   return;
 }
 
 
-//***************************************************    
-TH1D* PlotUtils::GetProjectionX(TH2D* hist, TH2I* mask){
-//***************************************************    
+//***************************************************
+TH1D* PlotUtils::GetProjectionX(TH2D* hist, TH2I* mask) {
+//***************************************************
 
   TH2D* maskedhist = StatUtils::ApplyHistogramMasking(hist, mask);
 
   TH1D* hist_X = maskedhist->ProjectionX();
 
   delete maskedhist;
   return hist_X;
 }
 
 
 //***************************************************
-TH1D* PlotUtils::GetProjectionY(TH2D* hist, TH2I* mask){
+TH1D* PlotUtils::GetProjectionY(TH2D* hist, TH2I* mask) {
 //***************************************************
 
   TH2D* maskedhist = StatUtils::ApplyHistogramMasking(hist, mask);
 
   TH1D* hist_Y = maskedhist->ProjectionY();
 
   delete maskedhist;
   return hist_Y;
 }
diff --git a/src/Utils/PlotUtils.h b/src/Utils/PlotUtils.h
index c727606..24ed5e9 100644
--- a/src/Utils/PlotUtils.h
+++ b/src/Utils/PlotUtils.h
@@ -1,221 +1,230 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef PLOTUTILS_H_SEEN
 #define PLOTUTILS_H_SEEN
 
 
 #include "TH1.h"
 #include "TF1.h"
 #include "TMatrixD.h"
 #include "TVectorD.h"
 #include "TSystem.h"
 #include "TFile.h"
 #include "TProfile.h"
 
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 // C Includes
 #include <stdlib.h>
 #include <numeric>
 #include <math.h>
 #include <iostream>
 #include <unistd.h>
 #include <vector>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <cstring>
 
 // ROOT includes
 #include <TROOT.h>
 #include <TH1D.h>
 #include <TH2D.h>
 #include <TTree.h>
 #include <TFile.h>
 #include <TChain.h>
 #include <TLorentzVector.h>
 #include <TList.h>
 #include <TKey.h>
 #include <THStack.h>
 #include <TLegend.h>
 #include <TObjArray.h>
 #include <TRandom3.h>
 #include<ctime>
 #include "TH2Poly.h"
 #include "TGraphErrors.h"
 #include "TMatrixDSym.h"
 
 // Fit includes
 #include "FitEvent.h"
 #include "FitParameters.h"
 #include "FitLogger.h"
 #include "StatUtils.h"
 #include "GeneralUtils.h"
 
 /*!
  *  \addtogroup Utils
  *  @{
  */
 
 //! Functions to handle different TH1s and TFiles
 namespace PlotUtils{
 
   /*!
     MISC Functions
   */
   
   //! Check the root file has an object containing the given substring in its name
   bool CheckObjectWithName(TFile *inFile, std::string substring);
   
   //! Get object in a TFile that has  a matching substring in its name
   std::string GetObjectWithName(TFile *inFile, std::string substring);
 
   /*!
     Interaction Mode Histogram Handling
   */
 
   //! Fill the Histogram Array with 61 new histograms for interaction channels.
   void CreateNeutModeArray(TH1* hist, TH1* neutarray[]);
 
   //! Call Fill on the relevent Mode 1D Histogram
   void FillNeutModeArray(TH1D* hist[], int mode, double xval, double weight = 1.0);
 
   //! Call Fill on the relevant Mode 2D Histogram 
   void FillNeutModeArray(TH2D* hist[], int mode, double xval, double yval, double weight = 1.0);
 
   //! Given two arrays of histograms for the NEUT interaction mode, hist1 = hist1 + scale*hist2
   void AddNeutModeArray(TH1D* hist1[], TH1D* hist2[], double scaling = 1.0);
   
   //! Generate a legend for the THStack
   TLegend GenerateStackLegend(THStack stack, int xlow, int ylow, int xhigh, int yhigh);
 
   //! Turn the array of TH1 histograms into a stack of Modes
   THStack GetNeutModeStack(std::string title,TH1* ModeStack[], int option);
 
   //! Reset each histogram in the mode array
   void ResetNeutModeArray(TH1* hist[]);
 
   //! Scale each histogram in the mode array by a single scaling factor, option can be used to define "width" scaling.
   void ScaleNeutModeArray(TH1* hist[], double factor, std::string option = "");
   
   //! Free up the memory used by each of the 61 mode histograms
   void DeleteNeutModeArray(TH1* neutarray[]);
 
 
   /*!
     Handling Functions
   */
 
   //! Fill a mask histogram from a text file
   TH2D* SetMaskHist(std::string type, TH2D* data);
 
   //! Divide by the flux histogram for Enu Histograms
   void DivideByFlux(TH1D* fMCHist, TH1D* fFluxHist);
 
   TH1D* InterpolateFineHistogram(TH1D* hist, int res, std::string opt);
 
   //! Flux unfolded scaling, like DivideByFlux but uses interpolation.
   void FluxUnfoldedScaling(TH1D* plot, TH1D* flux, TH1D* events=NULL, double scalefactor=1.0, int nevents=1);
 
   //! Flux unfolded scaling for 2D histograms
   void FluxUnfoldedScaling(TH2D* plot, TH1D* flux, TH1D* events=NULL, double scalefactor=1.0);
   
   //! Fill a 2D Histogram from a text file
   void Set2DHistFromText(std::string dataFile, TH2* hist, double norm, bool skipbins=false);
 
   //! Fill a 2D Poly Histogram from a text file
   void Set2PolyHistFromText(std::string dataFile, TH2Poly* hist, double norm, bool skipbins=false);
 
   //! Fill a 1D Histogram from a text file
-  TH1D* GetTH1DFromFile(std::string dataFile, std::string title, std::string fPlotTitles="", std::string alt_name="");
+  TH1D* GetTH1DFromFile(std::string dataFile, std::string title = "", std::string fPlotTitles="", std::string alt_name="");
 
   //! Grab a 1D Histrogram from a ROOT File
   TH1* GetHistFromRootFile(std::string file, std::string name);
 
+  //! Grab a 2D Histrogram from a ROOT File
+  TH2D* GetTH2DFromRootFile(std::string file, std::string name);
+
+   //! Grab a 2D Histrogram from a ROOT File
+  TH2D* GetTH2DFromTextFile(std::string file);
+
+
   //! Scale mc to match data considering empty and masked bins
   void ScaleToData(TH1D* data, TH1D* mc, TH1I* mask);
 
   //! Apply bin masking (More cosmetic)
   void MaskBins(TH1D* hist, TH1I* mask);
 
   //! Apply bin masking (More cosmetic)                                                                            
   void MaskBins(TH2D* hist, TH2I* mask);
 
   //! Get the data MC ratio considering empty and masked bins
   double GetDataMCRatio(TH1D* data, TH1D* mc, TH1I* mask=NULL);
 
   
   /*!
     Formatting Plot Utils
   */
 
   //! Create new ratio plot. hist3 = hist1/hist2
   TH1D* GetRatioPlot(TH1D* hist1,   TH1D* hist2);
 
   //! Create new plot of hist2 normalised to hist1. hist2 = hist1 * (Integral(hist1)/Integral(hist2))
   TH1D* GetRenormalisedPlot(TH1D* hist1,   TH1D* hist2);
 
   //! Normalise histogram to area of unity.
   TH1D* GetShapePlot(TH1D* hist1);
 
   //! Normalise hist1 and hist2 to unity, before creating a new plot of their ratio.
   TH1D* GetShapeRatio(TH1D* hist1,   TH1D* hist2);
 
   //! Create a covariance histogram from a TMatrixDSym and add titles given.
   TH2D* GetCovarPlot(TMatrixDSym* cov, std::string name, std::string title);
 
   //! Wrapper function to create full covariance plot
   TH2D* GetFullCovarPlot(TMatrixDSym* cov, std::string name);
 
   //! Wrapper function to create inverted covariance plot
   TH2D* GetInvCovarPlot(TMatrixDSym* cov, std::string name);
 
   //! Wrapper function to create decomposed covariance plot
   TH2D* GetDecompCovarPlot(TMatrixDSym* cov, std::string name);
 
   //! Given a covariance histogram, divide by errors to form a correlation plot.
   TH2D* GetCorrelationPlot(TH2D* cov, std::string name);
 
   //! Given a covariance histogram, calculate the decomposed matrix to form a decomposed plot.
   TH2D* GetDecompPlot(TH2D* cov, std::string name);
 
   //! Given two 1D histograms create a 2D histogram which uses their bin edges to define both axes.
   TH2D* MergeIntoTH2D(TH1D* xhist, TH1D* yhist, std::string zname="");
 
   //! Given a 1D Histogram, set any empty bins in Data to empty bins in MC
   void MatchEmptyBins(TH1D* data, TH1D* mc);
   
   //! Given a 2D Histogram, set any empty bins in Data to empty bins in MC  
   void MatchEmptyBins(TH2D* data, TH2D* mc);
 
   //! Return a projection of a 2D Histogram onto X accounting for bin masking 
   TH1D* GetProjectionX(TH2D* hist, TH2I* mask);
   
   //! Return a projection of a 2D Histogram onto Y accounting for bin masking
   TH1D* GetProjectionY(TH2D* hist, TH2I* mask);
+
+
   
 }
 
 /*! @} */
 #endif
diff --git a/src/Utils/PythiaQuiet.f b/src/Utils/PythiaQuiet.f
index 57671da..4150d06 100644
--- a/src/Utils/PythiaQuiet.f
+++ b/src/Utils/PythiaQuiet.f
@@ -1,16 +1,16 @@
-      subroutine ShhPythiaItOkay()
+      subroutine ShhNuisancePythiaItOkay()
           integer, parameter :: stdout = 6
           integer, parameter :: stderr = 0
           character(len=*), parameter :: nullfile="/dev/null"
           ! write(6,"(A)") "[INFO]: Attempting to quiten stdout..."
           open(unit=stdout, file=nullfile, status="old")
           open(unit=stderr, file=nullfile, status="old")
-      end subroutine ShhPythiaItOkay
-      subroutine CanIHazPythia()
+      end subroutine ShhNuisancePythiaItOkay
+      subroutine CanIHazNuisancePythia()
           integer, parameter :: stdout = 6
           integer, parameter :: stderr= 0
           character(len=*), parameter :: nullfile="/dev/stdout"
           open(unit=stdout, file=nullfile, status="old")
           open(unit=stderr, file=nullfile, status="old")
-      end subroutine CanIHazPythia
+      end subroutine CanIHazNuisancePythia
 
diff --git a/src/Utils/SignalDef.cxx b/src/Utils/SignalDef.cxx
index 3a60743..4fe5118 100644
--- a/src/Utils/SignalDef.cxx
+++ b/src/Utils/SignalDef.cxx
@@ -1,273 +1,289 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "FitUtils.h"
 
 #include "SignalDef.h"
 
 
 bool SignalDef::isCCINC(FitEvent *event, int nuPDG, double EnuMin, double EnuMax) {
 
   // Check for the desired PDG code
   if (!event->HasISParticle(nuPDG)) return false;
 
   // Check that it's within the allowed range if set
   if (EnuMin != EnuMax) {
     if (!SignalDef::IsEnuInRange(event, EnuMin*1000, EnuMax*1000)) {
       return false;
     }
   }
 
   // Check that the charged lepton we expect has been produced
   if (!event->HasFSParticle(nuPDG > 0 ? nuPDG-1 : nuPDG+1)) return false;
 
   return true;
 }
 
 bool SignalDef::isNCINC(FitEvent *event, int nuPDG, double EnuMin, double EnuMax) {
 
   // Check for the desired PDG code before and after the interaction
   if (!event->HasISParticle(nuPDG) ||
       !event->HasFSParticle(nuPDG)) return false;
 
   // Check that it's within the allowed range if set
   if (EnuMin != EnuMax)
     if (!SignalDef::IsEnuInRange(event, EnuMin*1000, EnuMax*1000))
       return false;
 
   return true;
 }
 
 
 bool SignalDef::isCC0pi(FitEvent *event, int nuPDG, double EnuMin, double EnuMax){
 
   // Check it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Veto event with mesons
   if (event->NumFSMesons() != 0) return false;
 
   // Veto events which don't have exactly 1 outgoing charged lepton
   if (event->NumFSLeptons() != 1) return false;
 
   return true;
 }
 
 bool SignalDef::isNC0pi(FitEvent *event, int nuPDG, double EnuMin, double EnuMax){
 
   // Check it's NCINC
   if (!SignalDef::isNCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Veto event with mesons
   if (event->NumFSMesons() != 0) return false;
 
   // Veto events with a charged lepton
   if (event->NumFSLeptons() != 0) return false;
 
   return true;
 }
 
 
 bool SignalDef::isCCQE(FitEvent *event, int nuPDG, double EnuMin, double EnuMax){
 
   // Check if it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Require modes 1 (CCQE)
   if (abs(event->Mode) != 1) return false;
 
   return true;
 }
 
 bool SignalDef::isNCEL(FitEvent *event, int nuPDG, double EnuMin, double EnuMax){
 
   // Check if it's NCINC
   if (!SignalDef::isNCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Require modes 51/52 (NCEL)
   if (abs(event->Mode) != 51 && abs(event->Mode) != 52) return false;
 
   return true;
 }
 
 
 bool SignalDef::isCCQELike(FitEvent *event, int nuPDG, double EnuMin, double EnuMax){
 
   // Check if it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Require modes 1/2 (CCQE and MEC)
   if (abs(event->Mode) != 1 && abs(event->Mode) != 2) return false;
 
   return true;
 }
 
 // Require one meson, one charged lepton. types specified in the arguments
 bool SignalDef::isCC1pi(FitEvent *event, int nuPDG, int piPDG,
 			double EnuMin, double EnuMax){
 
   // First, make sure it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   int nMesons  = event->NumFSMesons();
   int nLeptons = event->NumFSLeptons();
   int nPion    = event->NumFSParticle(piPDG);
 
   // Check that the desired pion exists and is the only meson
   if (nPion != 1 || nMesons != 1) return false;
 
   // Check that there is only one final state lepton
   if (nLeptons != 1) return false;
 
   return true;
 }
 
 // Require one meson, one neutrino. Types specified as arguments
 bool SignalDef::isNC1pi(FitEvent *event, int nuPDG, int piPDG,
                         double EnuMin, double EnuMax){
 
   // First, make sure it's NCINC
   if (!SignalDef::isNCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   int nMesons  = event->NumFSMesons();
   int nLeptons = event->NumFSLeptons();
   int nPion    = event->NumFSParticle(piPDG);
 
   // Check that the desired pion exists and is the only meson
   if (nPion != 1 || nMesons != 1) return false;
 
   // Check that there are no charged leptons
   if (nLeptons != 0) return false;
 
   return true;
 }
 
 // A slightly ugly function to replace the BC 2pi channels.
 // All particles which are allowed in the final state are specified
 bool SignalDef::isCCWithFS(FitEvent *event, int nuPDG, std::vector<int> pdgs,
 			   double EnuMin, double EnuMax){
 
   // Check it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   // Remove events where the number of final state particles
   // do not match the number specified in the signal definition
   if ((int)pdgs.size() != event->NumFSParticle()) return false;
 
   // For every particle in the list, check the number in the FS
   for (std::vector<int>::iterator it = pdgs.begin(); it != pdgs.end(); ++it){
     // Check how many times this pdg is in the vector
     int nEntries = std::count (pdgs.begin(), pdgs.end(), *it);
     if (event->NumFSParticle(*it) != nEntries)
       return false;
   }
   return true;
 }
 
 // Require one meson, one charged lepton, AND specify the only other final state particle
 // This is only suitable for bubble chambers. Types specified in the arguments
 bool SignalDef::isCC1pi3Prong(FitEvent *event, int nuPDG, int piPDG,
 			      int thirdPDG, double EnuMin, double EnuMax){
 
   // First, make sure it's CC1pi
   if (!SignalDef::isCC1pi(event, nuPDG, piPDG, EnuMin, EnuMax)) return false;
 
   // Check we have the third prong
   if (event->NumFSParticle(thirdPDG) == 0) return false;
 
   // Check that there are only three FS particles
   if (event->NumFSParticle() != 3) return false;
 
   return true;
 }
 
 // Require one meson, one neutrino, AND specify the only other final state particle
 // This is only suitable for bubble chambers. Types specified in the arguments
 bool SignalDef::isNC1pi3Prong(FitEvent *event, int nuPDG, int piPDG,
                               int thirdPDG, double EnuMin, double EnuMax){
 
   // First, make sure it's NC1pi
   if (!SignalDef::isNC1pi(event, nuPDG, piPDG, EnuMin, EnuMax)) return false;
 
   // Check we have the third prong
   if (event->NumFSParticle(thirdPDG) == 0) return false;
 
   // Check that there are only three FS particles
   if (event->NumFSParticle() != 3) return false;
 
   return true;
 }
 
 bool SignalDef::isCCCOH(FitEvent *event, int nuPDG, int piPDG, double EnuMin, double EnuMax){
 
   // Check this is a CCINC event
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   int nLepton = event->NumFSParticle(nuPDG > 0 ? nuPDG-1 : nuPDG+1);
   int nPion   = event->NumFSParticle(piPDG);
   int nFS     = event->NumFSParticle();
 
   if (nLepton != 1 || nPion != 1) return false;
   if (nFS != 2) return false;
   return true;
 }
 
 bool SignalDef::isNCCOH(FitEvent *event, int nuPDG, int piPDG, double EnuMin, double EnuMax){
 
   // Check this is an NCINC event
   if (!SignalDef::isNCINC(event, nuPDG, EnuMin, EnuMax)) return false;
 
   int nLepton = event->NumFSParticle(nuPDG);
   int nPion   = event->NumFSParticle(piPDG);
   int nFS     = event->NumFSParticle();
 
   if (nLepton != 1 || nPion != 1) return false;
   if (nFS != 2) return false;
   return true;
 }
 
 
 bool SignalDef::HasProtonKEAboveThreshold(FitEvent* event, double threshold){
 
-  double pe = -1.0;
-  if (event->HasFSProton()) pe = FitUtils::T(event->GetHMFSProton()->fP);
+  for (int i = 0; i < event->Npart(); i++){
+    FitParticle* p = event->PartInfo(i);
+    if (!p->IsFinalState()) continue;
+    if (p->fPID != 2212) continue;
 
-  return pe > threshold / 1000.0;
+    if (FitUtils::T(p->fP) > threshold / 1000.0) return true;
+  }
+  return false;
+
+}
 
+bool SignalDef::HasProtonMomAboveThreshold(FitEvent* event, double threshold){
+
+  for (int i = 0; i < event->Npart(); i++){
+    FitParticle* p = event->PartInfo(i);
+    if (!p->IsFinalState()) continue;
+    if (p->fPID != 2212) continue;
+
+    if (p->fP.Vect().Mag() > threshold) return true;
+  }
+  return false;
 }
 
 // Calculate the angle between the neutrino and an outgoing particle, apply a cut
 bool SignalDef::IsRestrictedAngle(FitEvent* event, int nuPDG, int otherPDG, double angle){
 
   // If the particles don't exist, return false
   if (!event->HasISParticle(nuPDG) || !event->HasFSParticle(otherPDG)) return false;
 
   // Get Mom
   TVector3 pnu = event->GetHMISParticle(nuPDG)->fP.Vect();
   TVector3 p2  = event->GetHMFSParticle(otherPDG)->fP.Vect();
 
   double theta = pnu.Angle(p2) * 180. / TMath::Pi();
 
   return (theta < angle);
 }
 
 bool SignalDef::IsEnuInRange(FitEvent* event, double emin, double emax){
   return (event->PartInfo(0)->fP.E() > emin &&
 	  event->PartInfo(0)->fP.E() < emax);
 }
diff --git a/src/Utils/SignalDef.h b/src/Utils/SignalDef.h
index 6e5f087..fbf963d 100644
--- a/src/Utils/SignalDef.h
+++ b/src/Utils/SignalDef.h
@@ -1,94 +1,98 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 // contains signal definitions for various interactions
 #ifndef SIGNALDEF_H_SEEN
 #define SIGNALDEF_H_SEEN
 
 // C/C++ includes
 #include <math.h>
 
 // ROOT includes
 #include <TLorentzVector.h>
 
 // ExtFit includes
 #include "FitEvent.h"
 
 namespace SignalDef {
 
 bool isCCINC(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isNCINC(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isCC0pi(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isCCQELike(FitEvent *event, int nuPDG, double EnuMin = 0,
                 double EnuMax = 0);
 bool isCCQE(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isNC0pi(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isNCEL(FitEvent *event, int nuPDG, double EnuMin = 0, double EnuMax = 0);
 bool isCCCOH(FitEvent *event, int nuPDG, int piPDG, double EnuMin = 0,
              double EnuMax = 0);
 bool isNCCOH(FitEvent *event, int nuPDG, int piPDG, double EnuMin = 0,
 	      double EnuMax = 0);
 bool isCC1pi(FitEvent *event, int nuPDG, int piPDG, double EnuMin = 0,
              double EnuMax = 0);
 bool isNC1pi(FitEvent *event, int nuPDG, int piPDG, double EnuMin = 0,
              double EnuMax = 0);
 
 bool isCC1pi3Prong(FitEvent *event, int nuPDG, int piPDG, int thirdPDG,
                    double EnuMin = 0, double EnuMax = 0);
 bool isNC1pi3Prong(FitEvent *event, int nuPDG, int piPDG, int thirdPDG,
                    double EnuMin = 0, double EnuMax = 0);
 bool isCCWithFS(FitEvent *event, int nuPDG, std::vector<int> pdgs,
                 double EnuMin = 0, double EnuMax = 0);
 
 template <size_t N>
 bool isCCWithFS(FitEvent *event, int nuPDG, int const (&pdgs)[N],
                 double EnuMin = 0, double EnuMax = 0) {
   // Check it's CCINC
   if (!SignalDef::isCCINC(event, nuPDG, EnuMin, EnuMax)) {
     return false;
   }
 
   // Remove events where the number of final state particles
   // do not match the number specified in the signal definition
   if (N != event->NumFSParticle()) {
     return false;
   }
 
   // For every particle in the list, check the number in the FS
   for (size_t p_it = 0; p_it < N; ++p_it) {
     // Check how many times this pdg is in the vector
     size_t nEntries = 0;
     for(size_t p_it2 = 0; p_it2 < N; ++p_it2) {
       nEntries += (pdgs[p_it] == pdgs[p_it2]);
     }
     if ((size_t)event->NumFSParticle(pdgs[p_it]) != nEntries) {
       return false;
     }
   }
 
   return true;
 }
 
+
+
 // Generic Signal Functions
 bool HasProtonKEAboveThreshold(FitEvent *event, double threshold);
+bool HasProtonMomAboveThreshold(FitEvent* event, double threshold);
+
 bool IsRestrictedAngle(FitEvent *event, int nuPDG, int otherPDG, double angle);
 bool IsEnuInRange(FitEvent *event, double emin, double emax);
 }
 
 #endif
diff --git a/src/Utils/StackBase.cxx b/src/Utils/StackBase.cxx
new file mode 100644
index 0000000..1a2abc3
--- /dev/null
+++ b/src/Utils/StackBase.cxx
@@ -0,0 +1,204 @@
+#include "StackBase.h"
+
+void StackBase::AddMode(std::string name, std::string title,
+                        int linecolor, int linewidth,
+                        int fillstyle) {
+
+	// int ncur = fAllLabels.size();
+	fAllLabels.push_back(name);
+	fAllTitles.push_back(title);
+
+	std::vector<int> temp;
+	temp.push_back(linecolor);
+	temp.push_back(linewidth);
+	temp.push_back(fillstyle);
+
+	fAllStyles.push_back(temp);
+}
+
+void StackBase::AddMode(int index, std::string name, std::string title,
+                        int linecolor, int linewidth, int fillstyle) {
+
+	while (fAllLabels.size() <= (UInt_t)index) {
+		fAllLabels.push_back("");
+		fAllTitles.push_back("");
+		fAllStyles.push_back(std::vector<int>(1, 1));
+	}
+
+	fAllLabels[index] = (name);
+	fAllTitles[index] = (title);
+
+	std::vector<int> temp;
+	temp.push_back(linecolor);
+	temp.push_back(linewidth);
+	temp.push_back(fillstyle);
+
+	fAllStyles[index] = temp;
+}
+
+bool StackBase::IncludeInStack(TH1* hist){
+	if (!FitPar::Config().GetParB("includeemptystackhists") and
+	        hist->Integral() == 0.0) return false;
+	return true;
+}
+
+bool StackBase::IncludeInStack(int index) {
+	return true;
+}
+
+void StackBase::SetupStack(TH1* hist) {
+	fTemplate = (TH1*) hist->Clone(fName.c_str());
+	fTemplate->Reset();
+
+	// Determine template dim
+	fNDim = fTemplate->GetDimension();
+
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists.push_back( (TH1*) fTemplate->Clone( (fName + "_" + fAllLabels[i]).c_str() ) );
+	}
+};
+
+void StackBase::Scale(double sf, std::string opt) {
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		// std::cout << "Scaling Stack Hist " << i << " by " << sf << std::endl;
+		fAllHists[i]->Scale(sf, opt.c_str());
+	}
+};
+
+void StackBase::Reset() {
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists[i]->Reset();
+	}
+};
+
+void StackBase::FillStack(int index, double x, double y, double z, double weight) {
+	if (index < 0 or (UInt_t)index >= fAllLabels.size()) {
+		ERR(WRN) << "Returning Stack Fill Because Range = " << index << " " << fAllLabels.size() << std::endl;
+		return;
+	}
+
+	if (fNDim == 1)      fAllHists[index]->Fill(x, y);
+	else if (fNDim == 2) {
+		// std::cout << "Filling 2D Stack " << index << " " << x << " " << y << " " << z << std::endl;
+		((TH2*)fAllHists[index])->Fill(x, y, z);
+	}
+
+	else if (fNDim == 3) ((TH3*)fAllHists[index])->Fill(x, y, z, weight);
+}
+
+void StackBase::Write() {
+	THStack* st = new THStack();
+
+	// Loop and add all histograms
+	bool saveseperate = FitPar::Config().GetParB("WriteSeperateStacks");
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+
+		if (!IncludeInStack(fAllHists[i])) continue;
+		if (!IncludeInStack(i)) continue;
+
+		fAllHists[i]->SetTitle( fAllTitles[i].c_str() );
+		fAllHists[i]->GetXaxis()->SetTitle( fXTitle.c_str() );
+		fAllHists[i]->GetYaxis()->SetTitle( fYTitle.c_str() );
+		fAllHists[i]->GetZaxis()->SetTitle( fZTitle.c_str() );
+		fAllHists[i]->SetLineColor( fAllStyles[i][0] );
+		fAllHists[i]->SetLineWidth( fAllStyles[i][1] );
+		fAllHists[i]->SetFillStyle( fAllStyles[i][2] );
+		fAllHists[i]->SetFillColor( fAllStyles[i][0] );
+		if (saveseperate) fAllHists[i]->Write();
+
+		st->Add(fAllHists[i]);
+	}
+	st->SetTitle(fTitle.c_str());
+	st->SetName(fName.c_str());
+	st->Write();
+	delete st;
+
+};
+
+void StackBase::Multiply(TH1* hist) {
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists[i]->Multiply(hist);
+	}
+}
+
+void StackBase::Divide(TH1* hist) {
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists[i]->Divide(hist);
+	}
+}
+
+void StackBase::Add(TH1* hist, double scale) {
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists[i]->Add(hist, scale);
+	}
+}
+
+void StackBase::Add(StackBase* hist, double scale) {
+
+	if (hist->GetType() != fType) {
+		ERR(WRN) << "Trying to add two StackBases of different types!" << std::endl;
+		ERR(WRN) << fType << " + " << hist->GetType() << " = Undefined." << std::endl;
+		ERR(WRN) << "Doing nothing..." << std::endl;
+		return;
+	}
+
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		fAllHists[i]->Add(hist->GetHist(i));
+	}
+}
+
+TH1* StackBase::GetHist(int entry) {
+	return fAllHists[entry];
+}
+
+TH1* StackBase::GetHist(std::string label) {
+
+	TH1* hist = NULL;
+	std::vector<std::string> splitlabels = GeneralUtils::ParseToStr(label, "+");
+	for (size_t j = 0; j < splitlabels.size(); j++) {
+		std::string newlabel = splitlabels[j];
+
+		for (size_t i = 0; i < fAllLabels.size(); i++) {
+			if (newlabel == fAllLabels[i]) {
+				if (!hist) hist = (TH1*) fAllHists[i]->Clone();
+				else hist->Add(fAllHists[i]);
+			}
+		}
+	}
+
+	return hist;
+}
+
+
+THStack StackBase::GetStack() {
+	THStack st = THStack();
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		st.Add(fAllHists[i]);
+	}
+	return st;
+}
+
+
+void StackBase::AddNewHist(std::string name, TH1* hist) {
+	AddMode( fAllLabels.size(), name, hist->GetTitle(), hist->GetLineColor());
+	fAllHists.push_back( (TH1*) hist->Clone() );
+}
+
+void StackBase::AddToCategory(std::string name, TH1* hist) {
+
+	for (size_t i = 0; i < fAllLabels.size(); i++) {
+		if (name == fAllLabels[i]) {
+			fAllHists[i]->Add(hist);
+			break;
+		}
+	}
+
+}
+
+void StackBase::AddToCategory(int index, TH1* hist) {
+	fAllHists[index]->Add(hist);
+}
+
+
+
+
diff --git a/src/Utils/StackBase.h b/src/Utils/StackBase.h
new file mode 100644
index 0000000..dd4831f
--- /dev/null
+++ b/src/Utils/StackBase.h
@@ -0,0 +1,124 @@
+#ifndef STACK_BASE_H
+#define STACK_BASE_H
+
+#include "MeasurementVariableBox.h"
+#include "FitLogger.h"
+#include "GeneralUtils.h"
+#include "TH1.h"
+#include "TH1D.h"
+#include "TH2D.h"
+#include "THStack.h"
+#include "TH2.h"
+#include "TH3.h"
+#include "FitParameters.h"
+
+class StackBase {
+public:
+	StackBase() {};
+	~StackBase() {};
+
+	virtual void AddMode(std::string name, std::string title,
+	                     int linecolor = 1, int linewidth = 1, int fillstyle = 1001);
+	virtual void AddMode(int index, std::string name, std::string title,
+	                     int linecolor = 1, int linewidth = 1, int fillstyle = 1001);
+	
+	virtual bool IncludeInStack(TH1* hist);
+	virtual bool IncludeInStack(int index);
+	
+	virtual void SetupStack(TH1* hist);
+	virtual void Scale(double sf, std::string opt = "");
+	virtual void Reset();
+	virtual void FillStack(int index, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+	virtual void Write();
+
+	virtual void Add(StackBase* hist, double scale);
+	virtual void Add(TH1* hist, double scale);
+	
+	virtual void AddNewHist(std::string name, TH1* hist);
+	virtual void AddToCategory(std::string name, TH1* hist);
+	virtual void AddToCategory(int index, TH1* hist);
+
+	virtual void Divide(TH1* hist);
+	virtual void Multiply(TH1* hist);
+	virtual TH1* GetHist(int entry);
+	virtual TH1* GetHist(std::string label);
+	virtual THStack GetStack();
+
+	std::string GetType(){return fType;};
+
+	std::string fName;
+	std::string fTitle;
+	std::string fXTitle;
+	std::string fYTitle;
+	std::string fZTitle;
+	std::string fType;
+
+	TH1* fTemplate;
+	int fNDim;
+
+	// Maps incase we want to be selective
+	std::vector< std::vector<int> >  fAllStyles;
+	std::vector<std::string> fAllTitles;
+	std::vector<std::string> fAllLabels;
+	std::vector<TH1*> fAllHists;
+};
+
+
+/*
+class NuSpeciesStack : public StackBase {
+public:
+	SetupStack(TH1* hist) {
+		AddMode("numu", "numu", kBlue, 2, 3004);
+		AddMode("numubar", "numubar", kRed, 2, 3004 );
+		AddMode("nue", "nue",   kGreen, 2, 3004 );
+		StackBase::SetupStack(hist);
+	};
+
+	void NuSpeciesStack::FillStack(int species, double x, double y = 1.0, double z = 1.0, double weight = 1.0) {
+		Stackbase::FillStack(ConvertSpeciesToIndex(species), x, y, z, weight);
+	}
+
+	int ConvertSpeciesToIndex(int species) {
+		switch (species) {
+		case 14: return 0;
+		case -14: return 1;
+		case 11: return 2;
+		default: return -1;
+		}
+	};
+};
+
+class TargetStack : public StackBase {
+public:
+	SetupStack(TH1* hist) {
+		AddMode("C", "C", kBlue, 2, 3004);
+		AddMode("H", "H", kRed, 2, 3004 );
+		AddMode("O", "O",   kGreen, 2, 3004 );
+		StackBase::SetupStack(hist);
+	};
+
+	void NuSpeciesStack::FillStack(int species, double x,
+	                               double y = 1.0, double z = 1.0,
+	                               double weight = 1.0) {
+		Stackbase::FillStack(ConvertTargetToIndex(species), x, y, z, weight);
+	}
+
+	int ConvertTargetToIndex(int target) {
+		switch (species) {
+		case 1000010010: return 0;
+		case 1000: return 1;
+		case 1000: return 2;
+		default: return -1;
+		}
+	};
+}
+
+*/
+
+
+#endif
+
+
+
+
+
diff --git a/src/Utils/StandardStacks.cxx b/src/Utils/StandardStacks.cxx
new file mode 100644
index 0000000..e8758c8
--- /dev/null
+++ b/src/Utils/StandardStacks.cxx
@@ -0,0 +1,392 @@
+#include "StandardStacks.h"
+
+
+/// Fake stack functions
+FakeStack::FakeStack(TH1* hist) {
+	fTemplate =  (TH1*)hist;
+	fNDim = fTemplate->GetDimension();
+}
+
+FakeStack::~FakeStack() {
+	fTemplate = NULL;
+	fNDim = 0;
+}
+
+void FakeStack::Fill(double x, double y, double z, double weight) {
+	if (fNDim == 1)      fTemplate->Fill(x, y);
+	else if (fNDim == 2) ((TH2*)fTemplate)->Fill(x, y, z);
+	else if (fNDim == 3) ((TH3*)fTemplate)->Fill(x, y, z, weight);
+}
+
+void FakeStack::Scale(double norm, std::string opt) {
+	fTemplate->Scale(norm, opt.c_str());
+}
+
+void FakeStack::Reset() {
+	fTemplate->Reset();
+}
+
+void FakeStack::Write() {
+	fTemplate->Write();
+}
+
+
+
+/// TrueModeStack Functions
+TrueModeStack::TrueModeStack(std::string name, std::string title, TH1* hist) {
+	fName = name;
+	fTitle = title;
+
+	// CC
+	AddMode(0, "CCQE",      "CCQE", kBlue, 2, 1001);
+	AddMode(1, "CC2p2h",    "2p2h", kRed, 2, 1001);
+	AddMode(2, "CC1piponp", "CC1#pi^{+} on p",  kGreen,   2, 1001);
+	AddMode(3, "CC1pi0onn", "CC1#pi^{0} on n",  kGreen + 3, 2, 1001);
+	AddMode(4, "CC1piponn", "CC1#pi^{+} on n",  kGreen - 2, 2, 1001);
+	AddMode(5, "CCcoh",     "CC coherent",      kBlue,    2, 1001);
+	AddMode(6, "CC1gamma",  "CC1#gamma",        kMagenta, 2, 1001);
+	AddMode(7, "CCMultipi", "Multi #pi (1.3 < W < 2.0)", kYellow, 2, 1001);
+	AddMode(8, "CC1eta",    "CC1#eta^{0} on n", kYellow - 2, 2, 1001);
+	AddMode(9, "CC1lamkp",  "CC1#Lambda1K^{+}", kYellow - 6, 2, 1001);
+	AddMode(10, "CCDIS",    "DIS (W > 2.0)",    kRed, 2, 1001);
+
+	// NC
+	AddMode(11, "NC1pi0onn", "NC1#pi^{0} on n", kBlue,   2, 3004);
+	AddMode(12, "NC1pi0onp", "NC1#pi^{0} on p", kBlue + 3, 2, 3004);
+	AddMode(13, "NC1pimonn",  "NC1#pi^{-} on n", kBlue - 2, 2, 3004);
+	AddMode(14, "NC1piponp", "NC1#pi^{+} on p", kBlue - 8, 2, 3004);
+	AddMode(15, "NCcoh",       "NC Coherent",     kBlue + 8, 2, 3004);
+	AddMode(16, "NC1gammaonn",  "NC1#gamma on n",  kMagenta, 2, 3004);
+	AddMode(17, "NC1gammaonp",  "NC1#gamma on p", kMagenta - 10, 2, 3004);
+	AddMode(18, "NCMultipi", "Multi #pi (1.3 < W < 2.0)", kBlue - 10, 2, 3004);
+	AddMode(19, "NC1etaonn", "NC1#eta^{0} on n", kYellow - 2, 2, 3004);
+	AddMode(20, "NC1etaonp", "NC1#eta^{0} on p", kYellow - 4, 2, 3004);
+	AddMode(21, "NC1kamk0",  "NC1#Lambda1K^{0} on n", kYellow - 6, 2, 3004);
+	AddMode(22, "NC1lamkp",  "NC1#Lambda1K^{+}", kYellow - 10, 2, 3004);
+	AddMode(23, "NCDIS", "DIS (W > 2.0)", kRed, 2, 3004);
+	AddMode(24, "NCELonp", "NCEL on p", kBlack, 2, 3004);
+	AddMode(25, "NCELonn", "NCEL on n", kGray, 2, 3004);
+
+	AddMode(26, "NC2p2h", "NC 2p2h", kRed+1, 2, 3004);
+
+	// Undefined
+	AddMode(27, "UNDEFINED", "Undefined", kRed + 1, 2, 3000);
+
+	StackBase::SetupStack(hist);
+};
+
+int TrueModeStack::ConvertModeToIndex(int mode) {
+	// std::cout << "Converting Mode " << (mode) << std::endl;
+	switch (abs(mode)) {
+	case 1:  return 0;  // CCQE
+	case 2:  return 1;  // CC2p2h
+	case 11: return 2;  // CC1piponp
+	case 12: return 3;  // CC1pi0onn
+	case 13: return 4;  // CC1piponn
+	case 16: return 5;  // CCcoh
+	case 17: return 6;  // CC1gamma
+	case 21: return 7;  // CCMultipi
+	case 22: return 8;  // CC1eta
+	case 23: return 9;  // CC1lamkp
+	case 26: return 10; // CCDIS
+
+	case 31: return 11; // NC1pi0onn
+	case 32: return 12; // NC1pi0onp
+	case 33: return 13; // NC1pimonn
+	case 34: return 14; // NC1piponp
+	case 36: return 15; // NCcoh
+	case 38: return 16; // NC1gammaonn
+	case 39: return 17; // NC1gammaonp
+	case 41: return 18; // NC Multipi
+	case 42: return 19; // NC1etaonn
+	case 43: return 20; // NC1etaonp
+	case 44: return 21; // NC1kamk0
+	case 45: return 22; // NC1lamkp
+	case 46: return 23; // NCDIS
+	case 51: return 24; // NCEL on p
+	case 52: return 25; // NCEL on n
+	case 53: return 26; // NC 2p2h
+	default: return 27; // Undefined
+	}
+};
+
+void TrueModeStack::Fill(int mode, double x, double y, double z, double weight) {
+	StackBase::FillStack(ConvertModeToIndex(mode), x, y, z, weight);
+};
+
+void TrueModeStack::Fill(FitEvent* evt, double x, double y, double z, double weight) {
+	StackBase::FillStack(ConvertModeToIndex(evt->Mode), x, y, z, weight);
+};
+
+void TrueModeStack::Fill(BaseFitEvt* evt, double x, double y, double z, double weight) {
+	StackBase::FillStack(ConvertModeToIndex(evt->Mode), x, y, z, weight);
+};
+
+
+
+/// TrueModeStack Functions
+NuNuBarTrueModeStack::NuNuBarTrueModeStack(std::string name, std::string title, TH1* hist) {
+	fName = name;
+	fTitle = title;
+
+	// Neutrino
+	// CC
+	AddMode(0, "NU_CCQE",       "#nu CCQE", kBlue, 2, 1001);
+	AddMode(1, "NU_CC2p2h",     "#nu 2p2h", kRed, 2, 1001);
+	AddMode(2, "NU_CC1piponp",  "#nu CC1#pi^{+} on p",  kGreen,   2, 1001);
+	AddMode(3, "NU_CC1pi0onn",  "#nu CC1#pi^{0} on n",  kGreen + 3, 2, 1001);
+	AddMode(4, "NU_CC1piponn",  "#nu CC1#pi^{+} on n",  kGreen - 2, 2, 1001);
+	AddMode(5, "NU_CCcoh",      "#nu CC coherent",      kBlue,    2, 1001);
+	AddMode(6, "NU_CC1gamma",   "#nu CC1#gamma",        kMagenta, 2, 1001);
+	AddMode(7, "NU_CCMultipi",  "#nu Multi #pi (1.3 < W < 2.0)", kYellow, 2, 1001);
+	AddMode(8, "NU_CC1eta",     "#nu CC1#eta^{0} on n", kYellow - 2, 2, 1001);
+	AddMode(9, "NU_CC1lamkp",   "#nu CC1#Lambda1K^{+}", kYellow - 6, 2, 1001);
+	AddMode(10, "NU_CCDIS",     "#nu DIS (W > 2.0)",     kRed, 2, 1001);
+
+	// NC
+	AddMode(11, "NU_NC1pi0onn",    "#nu NC1#pi^{0} on n", kBlue,   2, 3004);
+	AddMode(12, "NU_NC1pi0onp",    "#nu NC1#pi^{0} on p", kBlue + 3, 2, 3004);
+	AddMode(13, "NU_NC1pimonn",    "#nu NC1#pi^{-} on n", kBlue - 2, 2, 3004);
+	AddMode(14, "NU_NC1piponp",    "#nu NC1#pi^{+} on p", kBlue - 8, 2, 3004);
+	AddMode(15, "NU_NCcoh",        "#nu NC Coherent",     kBlue + 8, 2, 3004);
+	AddMode(16, "NU_NC1gammaonn",  "#nu NC1#gamma on n",  kMagenta, 2, 3004);
+	AddMode(17, "NU_NC1gammaonp",  "#nu NC1#gamma on p", kMagenta - 10, 2, 3004);
+	AddMode(18, "NU_NCMultipi",    "#nu Multi #pi (1.3 < W < 2.0)", kBlue - 10, 2, 3004);
+	AddMode(19, "NU_NC1etaonn",    "#nu NC1#eta^{0} on n", kYellow - 2, 2, 3004);
+	AddMode(20, "NU_NC1etaonp",    "#nu NC1#eta^{0} on p", kYellow - 4, 2, 3004);
+	AddMode(21, "NU_NC1kamk0",     "#nu NC1#Lambda1K^{0} on n", kYellow - 6, 2, 3004);
+	AddMode(22, "NU_NC1lamkp",     "#nu NC1#Lambda1K^{+}", kYellow - 10, 2, 3004);
+	AddMode(23, "NU_NCDIS",        "#nu DIS (W > 2.0)", kRed, 2, 3004);
+	AddMode(24, "NU_NCELonp",      "#nu NCEL on p", kBlack, 2, 3004);
+	AddMode(25, "NU_NCELonn",      "#nu NCEL on n", kGray, 2, 3004);
+
+	// Undefined
+	AddMode(26, "NU_UNDEFINED",    "#nu Undefined", kRed + 2, 2, 3000);
+
+	// CC
+	AddMode(27, "ANTINU_CCQE",       "#bar{#nu} CCQE", kBlue, 2, 1001);
+	AddMode(28, "ANTINU_CC2p2h",     "#bar{#nu} 2p2h", kRed, 2, 1001);
+	AddMode(29, "ANTINU_CC1piponp",  "#bar{#nu} CC1#pi^{+} on p",  kGreen,   2, 1001);
+	AddMode(30, "ANTINU_CC1pi0onn",  "#bar{#nu} CC1#pi^{0} on n",  kGreen + 3, 2, 1001);
+	AddMode(31, "ANTINU_CC1piponn",  "#bar{#nu} CC1#pi^{+} on n",  kGreen - 2, 2, 1001);
+	AddMode(32, "ANTINU_CCcoh",      "#bar{#nu} CC coherent",      kBlue,    2, 1001);
+	AddMode(33, "ANTINU_CC1gamma",   "#bar{#nu} CC1#gamma",        kMagenta, 2, 1001);
+	AddMode(34, "ANTINU_CCMultipi",  "#bar{#nu} Multi #pi (1.3 < W < 2.0)", kYellow, 2, 1001);
+	AddMode(35, "ANTINU_CC1eta",     "#bar{#nu} CC1#eta^{0} on n", kYellow - 2, 2, 1001);
+	AddMode(36, "ANTINU_CC1lamkp",   "#bar{#nu} CC1#Lambda1K^{+}", kYellow - 6, 2, 1001);
+	AddMode(37, "ANTINU_CCDIS",     "#bar{#nu} DIS (W > 2.0)",     kRed, 2, 1001);
+
+	// NC
+	AddMode(38, "ANTINU_NC1pi0onn",    "#bar{#nu} NC1#pi^{0} on n", kBlue,   2, 3004);
+	AddMode(39, "ANTINU_NC1pi0onp",    "#bar{#nu} NC1#pi^{0} on p", kBlue + 3, 2, 3004);
+	AddMode(40, "ANTINU_NC1pimonn",    "#bar{#nu} NC1#pi^{-} on n", kBlue - 2, 2, 3004);
+	AddMode(41, "ANTINU_NC1piponp",    "#bar{#nu} NC1#pi^{+} on p", kBlue - 8, 2, 3004);
+	AddMode(42, "ANTINU_NCcoh",        "#bar{#nu} NC Coherent",     kBlue + 8, 2, 3004);
+	AddMode(43, "ANTINU_NC1gammaonn",  "#bar{#nu} NC1#gamma on n",  kMagenta, 2, 3004);
+	AddMode(44, "ANTINU_NC1gammaonp",  "#bar{#nu} NC1#gamma on p", kMagenta - 10, 2, 3004);
+	AddMode(45, "ANTINU_NCMultipi",    "#bar{#nu} Multi #pi (1.3 < W < 2.0)", kBlue - 10, 2, 3004);
+	AddMode(46, "ANTINU_NC1etaonn",    "#bar{#nu} NC1#eta^{0} on n", kYellow - 2, 2, 3004);
+	AddMode(47, "ANTINU_NC1etaonp",    "#bar{#nu} NC1#eta^{0} on p", kYellow - 4, 2, 3004);
+	AddMode(48, "ANTINU_NC1kamk0",     "#bar{#nu} NC1#Lambda1K^{0} on n", kYellow - 6, 2, 3004);
+	AddMode(49, "ANTINU_NC1lamkp",     "#bar{#nu} NC1#Lambda1K^{+}", kYellow - 10, 2, 3004);
+	AddMode(50, "ANTINU_NCDIS",        "#bar{#nu} DIS (W > 2.0)", kRed, 2, 3004);
+	AddMode(51, "ANTINU_NCELonp",      "#bar{#nu} NCEL on p", kBlack, 2, 3004);
+	AddMode(52, "ANTINU_NCELonn",      "#bar{#nu} NCEL on n", kGray, 2, 3004);
+
+	// Undefined
+	AddMode(53, "NU_UNDEFINED",    "#bar{#nu} Undefined", kRed + 2, 2, 3000);
+
+	// Non Neutrino
+	AddMode(54, "UNDEFINED", "Non-#nu Undefined", kBlack, 2, 3000);
+
+	StackBase::SetupStack(hist);
+};
+
+int NuNuBarTrueModeStack::ConvertModeToIndex(int mode) {
+	switch (abs(mode)) {
+	case 1:  return 0;  // CCQE
+	case 2:  return 1;  // CC2p2h
+	case 11: return 2;  // CC1piponp
+	case 12: return 3;  // CC1pi0onn
+	case 13: return 4;  // CC1piponn
+	case 16: return 5;  // CCcoh
+	case 17: return 6;  // CC1gamma
+	case 21: return 7;  // CCMultipi
+	case 22: return 8;  // CC1eta
+	case 23: return 9;  // CC1lamkp
+	case 26: return 10; // CCDIS
+
+	case 31: return 11; // NC1pi0onn
+	case 32: return 12; // NC1pi0onp
+	case 33: return 13; // NC1pimonn
+	case 34: return 14; // NC1piponp
+	case 36: return 15; // NCcoh
+	case 38: return 16; // NC1gammaonn
+	case 39: return 17; // NC1gammaonp
+	case 41: return 18; // NC Multipi
+	case 42: return 19; // NC1etaonn
+	case 43: return 20; // NC1etaonp
+	case 44: return 21; // NC1kamk0
+	case 45: return 22; // NC1lamkp
+	case 46: return 23; // NCDIS
+	case 51: return 24; // NCEL on p
+	case 52: return 25; // NCEL on n
+	default: return 26; // Undefined
+	}
+};
+
+void NuNuBarTrueModeStack::Fill(int species, int mode, double x, double y, double z, double weight) {
+	int modeindex = ConvertModeToIndex(mode);
+	int index = 54; // undefined
+
+	if       (species == 12 or species == 14 or species == 16) index = modeindex;
+	else if  (species == -12 or species == -14 or species == -16) index = modeindex + 27;
+
+	StackBase::FillStack(index, x, y, z, weight);
+};
+
+
+
+
+// Species Stack Functions
+BeamSpeciesStack::BeamSpeciesStack(std::string name, std::string title, TH1* hist) {
+	fName = name;
+	fTitle = title;
+
+	// charged eptons
+	AddMode(0, "electron", "e^{-}", kBlue, 2, 1001);
+	AddMode(1, "positron", "e^{+}", kBlue - 2, 2, 3004);
+	AddMode(2, "muon", "#mu^{-}", kRed, 2, 1001);
+	AddMode(3, "antimuon", "#mu^{+}", kRed - 2, 2, 3004);
+	AddMode(4, "tau", "#tau^{-}", kGreen, 2, 1001);
+	AddMode(5, "antitau", "#tau^{+}", kGreen - 2, 2, 3004);
+
+	// neutrinos
+	AddMode(6, "nue", "#nu_e", kBlue, 2, 1001);
+	AddMode(7, "antinue", "#bar{#nu}_e", kBlue - 2, 2, 3004);
+	AddMode(8, "numu", "#nu_#mu", kRed, 2, 1001);
+	AddMode(9, "antinumu", "#bar{#nu}_#mu", kRed - 2, 2, 3004);
+	AddMode(10, "nutau", "#nu_#tau", kGreen, 2, 1001);
+	AddMode(11, "antinutau", "#bar{#nu}_#tau", kGreen - 2, 2, 3004);
+
+	StackBase::SetupStack(hist);
+};
+
+int BeamSpeciesStack::ConvertSpeciesToIndex(int species) {
+	switch (species) {
+	case 11:  return 0; // e-
+	case -11: return 1; // e+
+	case 13:  return 2; // mu-
+	case -13: return 3; // mu+
+	case 15: return 4; // tau-
+	case -15: return 5; // tau+
+	case 12: return 6; // nue
+	case -12: return 7; // nuebar
+	case 14: return 8; // numu
+	case -14: return 9; // numubar
+	case 16: return 10; // nutau
+	case -16: return 11; //nutaubar
+	default: return 12;
+	}
+};
+
+void BeamSpeciesStack::Fill(int species, double x, double y, double z, double weight) {
+	StackBase::FillStack(ConvertSpeciesToIndex(species), x, y, z, weight);
+}
+
+
+
+// Target Stack Functions
+TargetTypeStack::TargetTypeStack(std::string name, std::string title, TH1* hist){
+	fName = name;
+	fTitle = title;
+
+	AddMode(0, "H", "Hydrogen", kBlue, 2, 1001);
+	AddMode(1, "C", "Carbon", kRed, 2, 1001);
+	AddMode(2, "O", "Oxygen", kViolet, 2, 1001);
+	AddMode(3, "UNDEFINED", "Undefined", kBlack, 2, 1001 );
+
+	StackBase::SetupStack(hist);
+}
+
+void TargetTypeStack::Fill(int pdg, double x, double y, double z, double weight){
+	int index = ConvertPDGToIndex(pdg);
+	StackBase::FillStack(index, x, y, z, weight);
+}
+
+int TargetTypeStack::ConvertPDGToIndex(int pdg){
+	switch(pdg){
+		case 1000010010: return 0; // H
+		case 1000060120: return 1; // C
+		case 1000080160: return 2; // O
+		default: return 3; // Undef
+	}
+}
+
+bool TargetTypeStack::IncludeInStack(TH1* hist){
+	return (hist->Integral() > 0.0);
+}
+
+
+
+
+// CC Topology Stack Functions
+CCTopologyStack::CCTopologyStack(std::string name, std::string title, TH1* hist) {
+	fName = name;
+	fTitle = title;
+
+	AddMode(0, "CC0pi", "CC-0#pi", kBlue, 2, 1001);
+	AddMode(1, "CC1pip", "CC-1#pi^{+}", kRed, 2, 1001);
+	AddMode(2, "CC1pim", "CC-1#pi^{-}", kGreen, 2, 1001);
+	AddMode(3, "CC1pi0", "CC-1#pi^{0}", kYellow, 2, 1001);
+	AddMode(4, "CCNpi", "CC-N#pi", kGray, 2, 1001);
+	AddMode(5, "CCOther", "CC-Other", kViolet, 2, 1001);
+	AddMode(6, "NC",  "NC", kMagenta, 2, 1001);
+	AddMode(7, "UNDEFINED", "Undefined", kBlack, 2, 1001);
+
+
+}
+
+void CCTopologyStack::Fill(FitEvent* evt, double x, double y, double z, double weight) {
+	int index = GetIndexFromEventParticles(evt);
+	StackBase::FillStack(index, x, y, z, weight);
+}
+
+int CCTopologyStack::GetIndexFromEventParticles(FitEvent* evt) {
+
+	int nleptons = evt->NumFSLeptons();
+	int npiplus  = evt->NumFSParticle(211);
+	int npineg   = evt->NumFSParticle(-211);
+	int npi0     = evt->NumFSParticle(111);
+	int npions = npiplus + npineg + npi0;
+
+	if (nleptons == 1) {
+		if (npions == 0) {
+			return 0; // CC0pi
+		} else if (npions == 1) {
+			if (npiplus == 1) return 1; //CC1pi+
+			else if (npineg == 1) return 2; //CC1pi-
+			else if (npi0 == 1) return 3; //CC1pi0
+		} else if (npions > 1) {
+			return 4; // CCNpi
+		}
+	} else if (nleptons > 1) {
+		return 5; // CCOther
+	} else if (nleptons < 1) {
+		return 6;
+	}
+
+	return 7; // Undefined?
+
+}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Utils/StandardStacks.h b/src/Utils/StandardStacks.h
new file mode 100644
index 0000000..1264bf8
--- /dev/null
+++ b/src/Utils/StandardStacks.h
@@ -0,0 +1,123 @@
+#ifndef STANDARD_STACKS_H
+#define STANDARD_STACKS_H
+
+#include "StackBase.h"
+#include "FitEvent.h"
+#include "BaseFitEvt.h"
+
+/// Single stack class, for consistent handling of TH1* and StackBase* histograms.
+class FakeStack : public StackBase {
+public:
+	/// Sets Template to exact pointer to hist without cloning.
+	FakeStack(TH1* hist) ;
+
+	/// Unlinks pointer to original histogram
+	~FakeStack();
+
+	/// Fills the normal fTemplate histogram
+	void Fill(double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// Scales the normal fTemplate histogram
+	void Scale(double norm, std::string opt);
+
+	/// Resets the normal fTemplate histogram
+	void Reset();
+
+	/// Writes the normal fTemplate histogram
+	void Write();
+};
+
+
+
+
+
+/// True Mode stack, an array of neut true interaction channels
+class TrueModeStack : public StackBase {
+public:
+
+	/// Main constructor listing true mode categories.
+	TrueModeStack(std::string name, std::string title, TH1* hist);
+
+	/// List to convert Modes to Index. 
+	/// Should be kept in sync with constructor.
+	int ConvertModeToIndex(int mode);
+
+	/// Fill fromgiven mode integer
+	void Fill(int mode, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// Extracts Mode from FitEvent and fills
+	void Fill(FitEvent* evt, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// Extracts Mode from BaseFitEvt
+	void Fill(BaseFitEvt* evt, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+};
+
+/// True Mode NuNuBar stack, array of true channels split by nu/nubar
+class NuNuBarTrueModeStack : public StackBase {
+public:
+
+	/// Main constructor listing true mode categories.
+	NuNuBarTrueModeStack(std::string name, std::string title, TH1* hist);
+
+	/// List to convert Modes to Index. 
+	/// Should be kept in sync with constructor.
+	int ConvertModeToIndex(int mode);
+
+	/// Fill fromgiven mode integer
+	void Fill(int species, int mode, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+};
+
+/// Species stack to look at contributions from multiple beam leptons
+class BeamSpeciesStack : public StackBase {
+public:
+
+	/// main constructor listing beam categories
+	BeamSpeciesStack(std::string name, std::string title, TH1* hist);
+
+	/// Fills stack using neutrino species
+	void Fill(int species, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// List converts PDG Beam to index. 
+	/// Should be kept in sync with constructor.
+	int ConvertSpeciesToIndex(int species);
+};
+
+
+/// Species stack to look at contributions from multiple beam leptons
+class TargetTypeStack : public StackBase {
+public:
+
+	/// main constructor listing beam categories
+	TargetTypeStack(std::string name, std::string title, TH1* hist);
+
+	/// Fills stack using target pdg 
+	void Fill(int pdg, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// List converts PDG Beam to index. 
+	/// Should be kept in sync with constructor.
+	int ConvertPDGToIndex(int pdg);
+
+	/// Specie empty histograms to not be included in final stack
+	bool IncludeInStack(TH1* hist);
+};
+
+
+
+/// CC Topology Stack, categories defined by final state particle counts.
+class CCTopologyStack : public StackBase {
+public:
+
+	/// main constructor listing beam categories
+	CCTopologyStack(std::string name, std::string title, TH1* hist);
+
+	/// Fills stack using FitEvent
+	void Fill(FitEvent* evt, double x, double y = 1.0, double z = 1.0, double weight = 1.0);
+
+	/// Extracts index from evt particle counts
+	int GetIndexFromEventParticles(FitEvent* evt);
+
+
+};
+
+#endif
diff --git a/src/Utils/StatUtils.cxx b/src/Utils/StatUtils.cxx
index 58c7ad4..71f8f8b 100644
--- a/src/Utils/StatUtils.cxx
+++ b/src/Utils/StatUtils.cxx
@@ -1,1062 +1,1228 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #include "TH1D.h"
 #include "StatUtils.h"
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromDiag(TH1D* data, TH1D* mc, TH1I* mask){
+Double_t StatUtils::GetChi2FromDiag(TH1D* data, TH1D* mc, TH1I* mask) {
 //*******************************************************************
 
   Double_t Chi2 = 0.0;
   TH1D* calc_data = (TH1D*)data->Clone();
   TH1D* calc_mc   = (TH1D*)mc->Clone();
 
   // Add MC Error to data if required
-  if (FitPar::Config().GetParB("statutils.addmcerror")){
-    for (int i = 0; i < calc_data->GetNbinsX(); i++){
+  if (FitPar::Config().GetParB("statutils.addmcerror")) {
+    for (int i = 0; i < calc_data->GetNbinsX(); i++) {
 
-      double dterr = calc_data->GetBinError(i+1);
-      double mcerr = calc_mc->GetBinError(i+1);
+      double dterr = calc_data->GetBinError(i + 1);
+      double mcerr = calc_mc->GetBinError(i + 1);
 
       if (dterr > 0.0) {
-	calc_data->SetBinError(i+1, sqrt(dterr*dterr + mcerr*mcerr));
+        calc_data->SetBinError(i + 1, sqrt(dterr * dterr + mcerr * mcerr));
       }
     }
   }
-  
+
   // Apply masking if required
-  if (mask){
-    calc_data =ApplyHistogramMasking(data, mask);
-    calc_mc   =ApplyHistogramMasking(mc, mask);
+  if (mask) {
+    calc_data = ApplyHistogramMasking(data, mask);
+    calc_mc   = ApplyHistogramMasking(mc, mask);
   }
-  
+
   // Iterate over bins in X
   for (int i = 0; i < calc_data->GetNbinsX(); i++) {
-    
+
     // Ignore bins with zero data or zero bin error
-    if (calc_data->GetBinError(i+1) <= 0.0 || 
-	calc_data->GetBinContent(i+1) == 0.0) continue;
+    if (calc_data->GetBinError(i + 1) <= 0.0 ||
+        calc_data->GetBinContent(i + 1) == 0.0) continue;
 
     // Take mc data difference
-    double diff = calc_data->GetBinContent(i+1) - calc_mc->GetBinContent(i+1);
-    double err = calc_data->GetBinError(i+1);
-    Chi2 += (diff*diff)/(err*err);
+    double diff = calc_data->GetBinContent(i + 1) - calc_mc->GetBinContent(i + 1);
+    double err = calc_data->GetBinError(i + 1);
+    Chi2 += (diff * diff) / (err * err);
 
   }
 
   // cleanup
   delete calc_data;
   delete calc_mc;
-  
+
   return Chi2;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromDiag(TH2D* data, TH2D* mc, 
-				    TH2I* map, TH2I* mask){
+Double_t StatUtils::GetChi2FromDiag(TH2D* data, TH2D* mc,
+                                    TH2I* map, TH2I* mask) {
 //*******************************************************************
 
   // Generate a simple map
   if (!map)  map = GenerateMap(data);
 
   // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
-  
+
   // Calculate 1D chi2 from 1D Plots
   Double_t Chi2 = StatUtils:: GetChi2FromDiag(data_1D, mc_1D,  mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return Chi2;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromCov(TH1D* data, TH1D* mc, 
-				   TMatrixDSym* invcov, TH1I* mask){
+Double_t StatUtils::GetChi2FromCov(TH1D* data, TH1D* mc,
+                                   TMatrixDSym* invcov, TH1I* mask) {
 //*******************************************************************
 
   Double_t Chi2 = 0.0;
   TMatrixDSym* calc_cov = (TMatrixDSym*) invcov->Clone();
   TH1D* calc_data = (TH1D*) data->Clone();
   TH1D* calc_mc   = (TH1D*) mc->Clone();
 
   // If a mask if applied we need to apply it before the matrix is inverted
   if (mask) {
     calc_cov  = ApplyInvertedMatrixMasking(invcov, mask);
     calc_data = ApplyHistogramMasking(data, mask);
     calc_mc   = ApplyHistogramMasking(mc, mask);
   }
 
-  // Add MC Error to data if required 
-  if (FitPar::Config().GetParB("statutils.addmcerror")){
+  // Add MC Error to data if required
+  if (FitPar::Config().GetParB("statutils.addmcerror")) {
 
     // Make temp cov
     TMatrixDSym* newcov = StatUtils::GetInvert(calc_cov);
-    
+
     // Add MC err to diag
-    for(int i = 0; i < calc_data->GetNbinsX(); i++){
-     
-      double mcerr = calc_mc->GetBinError(i+1)*1E38;
-      double oldval = (*newcov)(i,i);
+    for (int i = 0; i < calc_data->GetNbinsX(); i++) {
 
-      (*newcov)(i,i) = oldval + mcerr*mcerr; 
+      double mcerr = calc_mc->GetBinError(i + 1) * 1E38;
+      double oldval = (*newcov)(i, i);
+
+      (*newcov)(i, i) = oldval + mcerr * mcerr;
     }
 
     // Reset the calc_cov to new invert
     delete calc_cov;
     calc_cov = GetInvert(newcov);
 
     // Delete the tempcov
     delete newcov;
   }
 
   // iterate over bins in X (i,j)
-  for (int i = 0; i < calc_data->GetNbinsX(); i++){
-
-    for (int j = 0; j < calc_data->GetNbinsX(); j++){
-      
-      if (calc_data->GetBinContent(i+1) != 0 || calc_mc->GetBinContent(i+1) != 0) {
-
-        LOG(DEB)<< "i j = "<<i<<" "<<j<<std::endl;
-        LOG(DEB)<<"Calc_data mc i = "<<calc_data->GetBinContent(i+1)
-		<<" "<<calc_mc->GetBinContent(i+1)
-		<<"  Dif = "
-		<<( calc_data->GetBinContent(i+1) - calc_mc->GetBinContent(i+1) )
-		<<std::endl;
-
-        LOG(DEB)<<"Calc_data mc i = "<<calc_data->GetBinContent(j+1)
-		<<" "<<calc_mc->GetBinContent(j+1)
-		<<"  Dif = "
-		<<( calc_data->GetBinContent(j+1) - calc_mc->GetBinContent(j+1) )
-		<<std::endl;
-
-        LOG(DEB)<<"Covar = "<<    (*calc_cov)(i, j) <<std::endl;
-        
-        LOG(DEB)<<"Cont chi2 = " \
-		<<( ( calc_data->GetBinContent(i+1) - calc_mc->GetBinContent(i+1) ) \
-		    * (*calc_cov)(i, j) \
-		    * 1E76 \
-		    *   ( calc_data->GetBinContent(j+1) - calc_mc->GetBinContent(j+1) ) ) 
-	      <<" "<<Chi2<<std::endl;
-
-        Chi2 += ( ( calc_data->GetBinContent(i+1) - calc_mc->GetBinContent(i+1) ) * \
-		(*calc_cov)(i, j) * 1E76        * \
-		( calc_data->GetBinContent(j+1) - calc_mc->GetBinContent(j+1) ) );
+  for (int i = 0; i < calc_data->GetNbinsX(); i++) {
+
+    for (int j = 0; j < calc_data->GetNbinsX(); j++) {
+
+      if (calc_data->GetBinContent(i + 1) != 0 || calc_mc->GetBinContent(i + 1) != 0) {
+
+        LOG(DEB) << "i j = " << i << " " << j << std::endl;
+        LOG(DEB) << "Calc_data mc i = " << calc_data->GetBinContent(i + 1)
+                 << " " << calc_mc->GetBinContent(i + 1)
+                 << "  Dif = "
+                 << ( calc_data->GetBinContent(i + 1) - calc_mc->GetBinContent(i + 1) )
+                 << std::endl;
+
+        LOG(DEB) << "Calc_data mc i = " << calc_data->GetBinContent(j + 1)
+                 << " " << calc_mc->GetBinContent(j + 1)
+                 << "  Dif = "
+                 << ( calc_data->GetBinContent(j + 1) - calc_mc->GetBinContent(j + 1) )
+                 << std::endl;
+
+        LOG(DEB) << "Covar = " <<    (*calc_cov)(i, j) << std::endl;
+
+        LOG(DEB) << "Cont chi2 = " \
+                 << ( ( calc_data->GetBinContent(i + 1) - calc_mc->GetBinContent(i + 1) ) \
+                      * (*calc_cov)(i, j) \
+                      * 1E76 \
+                      *   ( calc_data->GetBinContent(j + 1) - calc_mc->GetBinContent(j + 1) ) )
+                 << " " << Chi2 << std::endl;
+
+        Chi2 += ( ( calc_data->GetBinContent(i + 1) - calc_mc->GetBinContent(i + 1) ) * \
+                  (*calc_cov)(i, j) * 1E76        * \
+                  ( calc_data->GetBinContent(j + 1) - calc_mc->GetBinContent(j + 1) ) );
 
       } else {
-	
+
         LOG(DEB) << "Error on bin (i,j) = (" << i << "," << j << ")" << std::endl;
-        LOG(DEB) << "data->GetBinContent(i+1) = " << calc_data->GetBinContent(i+1) << std::endl;
-        LOG(DEB) << "mc->GetBinContent(i+1) = " << calc_mc->GetBinContent(i+1) << std::endl;
+        LOG(DEB) << "data->GetBinContent(i+1) = " << calc_data->GetBinContent(i + 1) << std::endl;
+        LOG(DEB) << "mc->GetBinContent(i+1) = " << calc_mc->GetBinContent(i + 1) << std::endl;
         LOG(DEB) << "Adding zero to chi2 instead of dying horrifically " << std::endl;
 
         Chi2 += 0.;
       }
     }
   }
 
   // Cleanup
   delete calc_cov;
   delete calc_data;
   delete calc_mc;
 
   return Chi2;
 }
 
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromCov( TH2D* data, TH2D* mc, 
-				    TMatrixDSym* invcov, TH2I* map, TH2I* mask){
+Double_t StatUtils::GetChi2FromCov( TH2D* data, TH2D* mc,
+                                    TMatrixDSym* invcov, TH2I* map, TH2I* mask) {
 //*******************************************************************
 
   // Generate a simple map
   if (!map) {
     map = StatUtils::GenerateMap(data);
   }
-  
+
   // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
-  
+
   // Calculate 1D chi2 from 1D Plots
   Double_t Chi2 = StatUtils::GetChi2FromCov(data_1D, mc_1D,  invcov, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return Chi2;
 }
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromSVD( TH1D* data, TH1D* mc, 
-				    TMatrixDSym* cov,  TH1I* mask){
+Double_t StatUtils::GetChi2FromSVD( TH1D* data, TH1D* mc,
+                                    TMatrixDSym* cov,  TH1I* mask) {
 //*******************************************************************
 
   Double_t Chi2 = 0.0;
   TMatrixDSym* calc_cov = (TMatrixDSym*) cov->Clone();
   TH1D* calc_data = (TH1D*) data->Clone();
   TH1D* calc_mc   = (TH1D*) mc->Clone();
 
   // If a mask if applied we need to apply it before the matrix is inverted
   if (mask) {
     calc_cov  = StatUtils::ApplyMatrixMasking(cov, mask);
     calc_data = StatUtils::ApplyHistogramMasking(data, mask);
     calc_mc   = StatUtils::ApplyHistogramMasking(mc, mask);
   }
 
   // Decompose matrix
   TDecompSVD LU = TDecompSVD((*calc_cov));
   LU.Decompose();
   TMatrixDSym* cov_U = new TMatrixDSym(calc_data->GetNbinsX(), LU .GetU().GetMatrixArray(), "");
   TVectorD*    cov_S = new TVectorD( LU.GetSig() );
 
   // Apply basis rotation before adding up chi2
   Double_t rotated_difference = 0.0;
 
-  for (int i = 0; i < calc_data->GetNbinsX(); i++){
+  for (int i = 0; i < calc_data->GetNbinsX(); i++) {
     rotated_difference = 0.0;
-    
+
     // Rotate basis of Data - MC
     for (int j = 0; j < calc_data->GetNbinsY(); j++)
-      rotated_difference += ( calc_data->GetBinContent(j+1) - calc_mc  ->GetBinContent(j+1) ) * (*cov_U)(j,i) ;
-    
+      rotated_difference += ( calc_data->GetBinContent(j + 1) - calc_mc  ->GetBinContent(j + 1) ) * (*cov_U)(j, i) ;
+
     // Divide by rotated error cov_S
     Chi2 += rotated_difference * rotated_difference * 1E76 / (*cov_S)(i);
 
   }
 
   // Cleanup
   delete calc_cov;
   delete calc_data;
   delete calc_mc;
   delete cov_U;
   delete cov_S;
-  
+
   return Chi2;
 }
 
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromSVD( TH2D* data, TH2D* mc, 
-				    TMatrixDSym* cov,    TH2I* map, TH2I* mask){
+Double_t StatUtils::GetChi2FromSVD( TH2D* data, TH2D* mc,
+                                    TMatrixDSym* cov,    TH2I* map, TH2I* mask) {
 //*******************************************************************
 
   // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
-  
+
   // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
   // Calculate from 1D
   Double_t Chi2 = StatUtils::GetChi2FromSVD(data_1D, mc_1D, cov, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
-  
+
   return Chi2;
 }
 
 //*******************************************************************
 double StatUtils::GetChi2FromEventRate(TH1D* data, TH1D* mc, TH1I* mask) {
 //*******************************************************************
 
   // If just an event rate, for chi2 just use Poission Likelihood to calculate the chi2 component
   double chi2 = 0.0;
   TH1D* calc_data = (TH1D*)data->Clone();
   TH1D* calc_mc   = (TH1D*)mc->Clone();
 
   // Apply masking if required
   if (mask) {
     calc_data = ApplyHistogramMasking(data, mask);
     calc_mc   = ApplyHistogramMasking(mc, mask);
   }
 
   // Iterate over bins in X
   for (int i = 0; i < calc_data->GetNbinsX(); i++) {
 
-    double dt = calc_data->GetBinContent(i+1);
-    double mc = calc_mc->GetBinContent(i+1);
+    double dt = calc_data->GetBinContent(i + 1);
+    double mc = calc_mc->GetBinContent(i + 1);
 
     if (mc == 0) continue;
 
-    if (dt == 0){
+    if (dt == 0) {
       // Only add difference
       chi2 += 2 * (mc - dt);
     } else {
       // Do the chi2 for Poisson distributions
-      chi2 +=  2 * (mc - dt + (dt*log(dt/mc)));
+      chi2 +=  2 * (mc - dt + (dt * log(dt / mc)));
     }
 
-/*
-    LOG(REC)<<"Evt Chi2 cont = "<<i<<" "
-	    <<mc<<" "<<dt<<" "
-	    <<2 * (mc - dt + (dt+0.) * log((dt+0.) / (mc+0.)))
-	    <<" "<<Chi2<<std::endl;
-*/
+    /*
+        LOG(REC)<<"Evt Chi2 cont = "<<i<<" "
+          <<mc<<" "<<dt<<" "
+          <<2 * (mc - dt + (dt+0.) * log((dt+0.) / (mc+0.)))
+          <<" "<<Chi2<<std::endl;
+    */
   }
 
   // cleanup
   delete calc_data;
   delete calc_mc;
 
   return chi2;
 }
 
 //*******************************************************************
-Double_t StatUtils::GetChi2FromEventRate(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask){
+Double_t StatUtils::GetChi2FromEventRate(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask) {
 //*******************************************************************
 
   // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
-  
+
   // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
   // Calculate from 1D
   Double_t Chi2 = StatUtils::GetChi2FromEventRate(data_1D, mc_1D, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return Chi2;
 }
 
 
 
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromDiag(TH1D* data, TH1D* mc, TH1I* mask){
+Double_t StatUtils::GetLikelihoodFromDiag(TH1D* data, TH1D* mc, TH1I* mask) {
 //*******************************************************************
   // Currently just a placeholder!
   (void) data;
   (void) mc;
   (void) mask;
   return 0.0;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromDiag(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask){
+Double_t StatUtils::GetLikelihoodFromDiag(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask) {
 //*******************************************************************
 
-  // Generate a simple map            
+  // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
 
-  // Convert to 1D Histograms   
+  // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
-  // Calculate from 1D      
+  // Calculate from 1D
   Double_t MLE = StatUtils::GetLikelihoodFromDiag(data_1D, mc_1D, mask_1D);
 
-  // CleanUp               
+  // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return MLE;
 };
 
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromCov( TH1D* data, TH1D* mc, TMatrixDSym* invcov, TH1I* mask){
+Double_t StatUtils::GetLikelihoodFromCov( TH1D* data, TH1D* mc, TMatrixDSym* invcov, TH1I* mask) {
 //*******************************************************************
   // Currently just a placeholder !
   (void) data;
   (void) mc;
   (void) invcov;
   (void) mask;
 
   return 0.0;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromCov( TH2D* data, TH2D* mc, TMatrixDSym* invcov, TH2I* map, TH2I* mask){
+Double_t StatUtils::GetLikelihoodFromCov( TH2D* data, TH2D* mc, TMatrixDSym* invcov, TH2I* map, TH2I* mask) {
 //*******************************************************************
 
-  // Generate a simple map  
+  // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
 
-  // Convert to 1D Histograms               
+  // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
-  // Calculate from 1D      
+  // Calculate from 1D
   Double_t MLE = StatUtils::GetLikelihoodFromCov(data_1D, mc_1D, invcov, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
- return MLE;
+  return MLE;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromSVD( TH1D* data, TH1D* mc, TMatrixDSym* cov,    TH1I* mask){
+Double_t StatUtils::GetLikelihoodFromSVD( TH1D* data, TH1D* mc, TMatrixDSym* cov,    TH1I* mask) {
 //*******************************************************************
   // Currently just a placeholder!
   (void) data;
   (void) mc;
   (void) cov;
   (void) mask;
 
   return 0.0;
 };
 
-//******************************************************************* 
-Double_t StatUtils::GetLikelihoodFromSVD( TH2D* data, TH2D* mc, TMatrixDSym* cov,    TH2I* map, TH2I* mask){
-//******************************************************************* 
+//*******************************************************************
+Double_t StatUtils::GetLikelihoodFromSVD( TH2D* data, TH2D* mc, TMatrixDSym* cov,    TH2I* map, TH2I* mask) {
+//*******************************************************************
 
-  // Generate a simple map  
+  // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
 
-  // Convert to 1D Histograms               
+  // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
-  // Calculate from 1D      
+  // Calculate from 1D
   Double_t MLE = StatUtils::GetLikelihoodFromSVD(data_1D, mc_1D, cov, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return MLE;
 };
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromEventRate(TH1D* data, TH1D* mc, TH1I* mask){
+Double_t StatUtils::GetLikelihoodFromEventRate(TH1D* data, TH1D* mc, TH1I* mask) {
 //*******************************************************************
   // Currently just a placeholder!
   (void) data;
   (void) mc;
   (void) mask;
- 
+
   return 0.0;
 };
 
 
 //*******************************************************************
-Double_t StatUtils::GetLikelihoodFromEventRate(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask){
+Double_t StatUtils::GetLikelihoodFromEventRate(TH2D* data, TH2D* mc, TH2I* map, TH2I* mask) {
 //*******************************************************************
 
-  // Generate a simple map  
+  // Generate a simple map
   if (!map)
     map = StatUtils::GenerateMap(data);
 
-  // Convert to 1D Histograms               
+  // Convert to 1D Histograms
   TH1D* data_1D = MapToTH1D(data, map);
   TH1D* mc_1D   = MapToTH1D(mc,   map);
   TH1I* mask_1D = MapToMask(mask, map);
 
-  // Calculate from 1D      
+  // Calculate from 1D
   Double_t MLE = StatUtils::GetChi2FromEventRate(data_1D, mc_1D, mask_1D);
 
   // CleanUp
   delete data_1D;
   delete mc_1D;
   delete mask_1D;
 
   return MLE;
 };
 
 
 
 //*******************************************************************
-Int_t StatUtils::GetNDOF(TH1D* hist, TH1I* mask){
+Int_t StatUtils::GetNDOF(TH1D* hist, TH1I* mask) {
 //*******************************************************************
 
   TH1D* calc_hist = (TH1D*)hist->Clone();
 
   // If a mask is provided we need to apply it before getting NDOF
   if (mask) {
     calc_hist = StatUtils::ApplyHistogramMasking(hist, mask);
   }
 
   // NDOF is defined as total number of bins with non-zero errors
   Int_t NDOF = 0;
-  for (int i = 0; i < calc_hist->GetNbinsX(); i++){
-    if (calc_hist->GetBinError(i+1) > 0.0) NDOF++;
+  for (int i = 0; i < calc_hist->GetNbinsX(); i++) {
+    if (calc_hist->GetBinError(i + 1) > 0.0) NDOF++;
   }
 
   delete calc_hist;
 
   return NDOF;
 };
 
 
-//******************************************************************* 
-Int_t StatUtils::GetNDOF(TH2D* hist, TH2I* map, TH2I* mask){
-//******************************************************************* 
+//*******************************************************************
+Int_t StatUtils::GetNDOF(TH2D* hist, TH2I* map, TH2I* mask) {
+//*******************************************************************
 
   Int_t NDOF = 0;
   if (!map) map = StatUtils::GenerateMap(hist);
 
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    for (int j = 0; j < hist->GetNbinsY(); j++){
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+    for (int j = 0; j < hist->GetNbinsY(); j++) {
+
+      if (mask->GetBinContent(i + 1, j + 1)) continue;
+      if (map->GetBinContent(i + 1, j + 1) <= 0) continue;
 
-      if (mask->GetBinContent(i+1,j+1)) continue;
-      if (map->GetBinContent(i+1,j+1) <= 0) continue;
-      
       NDOF++;
 
     }
   }
 
   return NDOF;
 };
 
 
 
 //*******************************************************************
-TH1D* StatUtils::ThrowHistogram(TH1D* hist, TMatrixDSym* cov, bool throwdiag, TH1I* mask){
+TH1D* StatUtils::ThrowHistogram(TH1D* hist, TMatrixDSym* cov, bool throwdiag, TH1I* mask) {
 //*******************************************************************
 
   TH1D* calc_hist = (TH1D*) hist->Clone( (std::string(hist->GetName()) + "_THROW" ).c_str() );
   TMatrixDSym* calc_cov = (TMatrixDSym*) cov->Clone();
   Double_t correl_val = 0.0;
 
   // If a mask if applied we need to apply it before the matrix is decomposed
   if (mask) {
     calc_cov  = ApplyMatrixMasking(cov, mask);
     calc_hist = ApplyHistogramMasking(calc_hist, mask);
   }
 
   // If a covariance is provided we need a preset random vector and a decomp
   std::vector<Double_t> rand_val;
   TMatrixDSym* decomp_cov;
 
-  if (cov){
-    for (int i = 0; i < hist->GetNbinsX(); i++){
-      rand_val.push_back(gRandom->Gaus(0.0,1.0));
+  if (cov) {
+    for (int i = 0; i < hist->GetNbinsX(); i++) {
+      rand_val.push_back(gRandom->Gaus(0.0, 1.0));
     }
 
     // Decomp the matrix
     decomp_cov = StatUtils::GetDecomp(calc_cov);
   }
-  
+
   // iterate over bins
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+
     // By Default the errors on the histogram are thrown uncorrelated to the other errors
-    if (throwdiag){
-      calc_hist->SetBinContent(i+1, (calc_hist->GetBinContent(i+1) + \
-				     gRandom->Gaus(0.0,1.0) * calc_hist->GetBinError(i+1)) ); 
+    if (throwdiag) {
+      calc_hist->SetBinContent(i + 1, (calc_hist->GetBinContent(i + 1) + \
+                                       gRandom->Gaus(0.0, 1.0) * calc_hist->GetBinError(i + 1)) );
     }
 
     // If a covariance is provided that is also thrown
-    if (cov){
+    if (cov) {
       correl_val = 0.0;
-      
-      for (int j = 0; j < hist->GetNbinsX(); j++){
-	correl_val += rand_val[j] * (*decomp_cov)(j,i) ;
+
+      for (int j = 0; j < hist->GetNbinsX(); j++) {
+        correl_val += rand_val[j] * (*decomp_cov)(j, i) ;
       }
 
-      calc_hist->SetBinContent(i+1, (calc_hist->GetBinContent(i+1) + \
-				     correl_val) *1E-38);
+      calc_hist->SetBinContent(i + 1, (calc_hist->GetBinContent(i + 1) + \
+                                       correl_val) * 1E-38);
     }
   }
 
   delete calc_cov;
   delete decomp_cov;
 
   // return this new thrown data
   return calc_hist;
 };
 
-//******************************************************************* 
-TH2D* StatUtils::ThrowHistogram(TH2D* hist, TMatrixDSym* cov, TH2I* map, bool throwdiag, TH2I* mask){
-//******************************************************************* 
-  
+//*******************************************************************
+TH2D* StatUtils::ThrowHistogram(TH2D* hist, TMatrixDSym* cov, TH2I* map, bool throwdiag, TH2I* mask) {
+//*******************************************************************
+
   // PLACEHOLDER!!!!!!!!!
   // Currently no support for throwing 2D Histograms from a covariance
   (void) hist;
   (void) cov;
   (void) map;
   (void) throwdiag;
   (void) mask;
- 
+
   // /todo
   // Sort maps if required
   // Throw the covariance for a 1D plot
   // Unmap back to 2D Histogram
 
   return hist;
 }
 
 
 
 
 
 
 //*******************************************************************
-TH1D* StatUtils::ApplyHistogramMasking(TH1D* hist, TH1I* mask){
+TH1D* StatUtils::ApplyHistogramMasking(TH1D* hist, TH1I* mask) {
 //*******************************************************************
 
   if (!mask) return ( (TH1D*)hist->Clone() );
 
   // This masking is only sufficient for chi2 calculations, and will have dodgy bin edges.
 
   // Get New Bin Count
   Int_t NBins = 0;
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    if (mask->GetBinContent(i+1)) continue;
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+    if (mask->GetBinContent(i + 1)) continue;
     NBins++;
   }
-  
+
   // Make new hist
   std::string newmaskname = std::string(hist->GetName()) + "_MSKD";
   TH1D* calc_hist = new TH1D( newmaskname.c_str(), newmaskname.c_str(), NBins, 0, NBins);
 
   // fill new hist
   int binindex = 0;
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    if (mask->GetBinContent(i+1)){
-      LOG(REC)<<"Applying mask to bin "<<i+1<<" "<<hist->GetName()<<std::endl;
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+    if (mask->GetBinContent(i + 1)) {
+      LOG(REC) << "Applying mask to bin " << i + 1 << " " << hist->GetName() << std::endl;
       continue;
     }
-    calc_hist->SetBinContent(binindex+1, hist->GetBinContent(i+1));
-    calc_hist->SetBinError(binindex+1, hist->GetBinError(i+1));
+    calc_hist->SetBinContent(binindex + 1, hist->GetBinContent(i + 1));
+    calc_hist->SetBinError(binindex + 1, hist->GetBinError(i + 1));
     binindex++;
   }
 
   return calc_hist;
 };
 
-//******************************************************************* 
-TH2D* StatUtils::ApplyHistogramMasking(TH2D* hist, TH2I* mask){
-//******************************************************************* 
+//*******************************************************************
+TH2D* StatUtils::ApplyHistogramMasking(TH2D* hist, TH2I* mask) {
+//*******************************************************************
 
   TH2D* newhist = (TH2D*) hist->Clone();
 
   if (!mask) return newhist;
-  
-  for (int i = 0; i < hist->GetNbinsX(); i++){
-    for (int j = 0; j < hist->GetNbinsY(); j++){
 
-      if (mask->GetBinContent(i+1,j+1) > 0){
-	newhist->SetBinContent(i+1,j+1, 0.0);
-	newhist->SetBinContent(i+1,j+1, 0.0);
+  for (int i = 0; i < hist->GetNbinsX(); i++) {
+    for (int j = 0; j < hist->GetNbinsY(); j++) {
+
+      if (mask->GetBinContent(i + 1, j + 1) > 0) {
+        newhist->SetBinContent(i + 1, j + 1, 0.0);
+        newhist->SetBinContent(i + 1, j + 1, 0.0);
       }
     }
   }
 
   return newhist;
 }
 
 //*******************************************************************
-TMatrixDSym* StatUtils::ApplyMatrixMasking(TMatrixDSym* mat, TH1I* mask){
+TMatrixDSym* StatUtils::ApplyMatrixMasking(TMatrixDSym* mat, TH1I* mask) {
 //*******************************************************************
 
   if (!mask) return (TMatrixDSym*)(mat->Clone());
 
-   // Get New Bin Count
+  // Get New Bin Count
   Int_t NBins = 0;
-  for (int i = 0; i < mask->GetNbinsX(); i++){
-    if (mask->GetBinContent(i+1)) continue;
+  for (int i = 0; i < mask->GetNbinsX(); i++) {
+    if (mask->GetBinContent(i + 1)) continue;
     NBins++;
   }
 
   // make new matrix
   TMatrixDSym* calc_mat = new TMatrixDSym(NBins);
   int col, row;
 
   // Need to mask out bins in the current matrix
   row = 0;
-  for (int i = 0; i < mask->GetNbinsX(); i++){
+  for (int i = 0; i < mask->GetNbinsX(); i++) {
     col = 0;
 
     // skip if masked
-    if (mask->GetBinContent(i+1) > 0.5) continue;
+    if (mask->GetBinContent(i + 1) > 0.5) continue;
+
+    for (int j = 0; j < mask->GetNbinsX(); j++) {
 
-    for (int j = 0; j < mask->GetNbinsX(); j++){
-      
       // skip if masked
-      if (mask->GetBinContent(j+1) > 0.5) continue;
-      
-      (*calc_mat)(row,col) = (*mat)(i,j);
+      if (mask->GetBinContent(j + 1) > 0.5) continue;
+
+      (*calc_mat)(row, col) = (*mat)(i, j);
       col++;
     }
     row++;
   }
 
   return calc_mat;
 };
 
-//******************************************************************* 
-TMatrixDSym* StatUtils::ApplyMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map){
-//******************************************************************* 
+//*******************************************************************
+TMatrixDSym* StatUtils::ApplyMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map) {
+//*******************************************************************
 
   if (!map) map = StatUtils::GenerateMap(data);
   TH1I* mask_1D = StatUtils::MapToMask(mask, map);
-  
+
   TMatrixDSym* newmat = StatUtils::ApplyMatrixMasking(mat,  mask_1D);
-  
+
   delete mask_1D;
   return newmat;
 }
 
 
 
 //*******************************************************************
-TMatrixDSym* StatUtils::ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH1I* mask){
+TMatrixDSym* StatUtils::ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH1I* mask) {
 //*******************************************************************
 
   TMatrixDSym* new_mat = GetInvert(mat);
   TMatrixDSym* masked_mat = ApplyMatrixMasking(new_mat, mask);
-  
+
   TMatrixDSym* inverted_mat = GetInvert(masked_mat);
 
   delete masked_mat;
   delete new_mat;
-  
+
   return inverted_mat;
 };
 
 
 
-//******************************************************************* 
-TMatrixDSym* StatUtils::ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map){
-//******************************************************************* 
+//*******************************************************************
+TMatrixDSym* StatUtils::ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map) {
+//*******************************************************************
+
+  if (!map) map = StatUtils::GenerateMap(data);
+  TH1I* mask_1D = StatUtils::MapToMask(mask, map);
 
-   if (!map) map = StatUtils::GenerateMap(data);
-   TH1I* mask_1D = StatUtils::MapToMask(mask, map);
-  
   TMatrixDSym* newmat = ApplyInvertedMatrixMasking(mat, mask_1D);
 
   delete mask_1D;
   return newmat;
 }
 
 
 
 
 //*******************************************************************
-TMatrixDSym* StatUtils::GetInvert(TMatrixDSym* mat){
+TMatrixDSym* StatUtils::GetInvert(TMatrixDSym* mat) {
 //*******************************************************************
 
   TMatrixDSym* new_mat = (TMatrixDSym*)mat->Clone();
-  
+
   // Check for diagonal
   bool non_diagonal = false;
-  for (int i = 0; i < new_mat->GetNrows(); i++){
-    for (int j = 0; j < new_mat->GetNrows(); j++){
+  for (int i = 0; i < new_mat->GetNrows(); i++) {
+    for (int j = 0; j < new_mat->GetNrows(); j++) {
       if (i == j) continue;
-      
-      if ((*new_mat)(i,j) != 0.0) {
-	non_diagonal=true;
-	break;
+
+      if ((*new_mat)(i, j) != 0.0) {
+        non_diagonal = true;
+        break;
       }
     }
   }
 
   // If diag, just flip the diag
-  if (!non_diagonal or new_mat->GetNrows() == 1){
-    for(int i = 0; i < new_mat->GetNrows(); i++){
-      if ((*new_mat)(i,i) != 0.0)
-	(*new_mat)(i,i) = 1.0/(*new_mat)(i,i);
+  if (!non_diagonal or new_mat->GetNrows() == 1) {
+    for (int i = 0; i < new_mat->GetNrows(); i++) {
+      if ((*new_mat)(i, i) != 0.0)
+        (*new_mat)(i, i) = 1.0 / (*new_mat)(i, i);
       else
-	(*new_mat)(i,i) = 0.0;
+        (*new_mat)(i, i) = 0.0;
     }
     return new_mat;
   }
 
 
   // Invert full matrix
   TDecompSVD LU = TDecompSVD((*new_mat));
   new_mat = new TMatrixDSym(new_mat->GetNrows(), LU.Invert().GetMatrixArray(), "");
-  
+
   return new_mat;
 }
 
 //*******************************************************************
-TMatrixDSym* StatUtils::GetDecomp(TMatrixDSym* mat){
+TMatrixDSym* StatUtils::GetDecomp(TMatrixDSym* mat) {
 //*******************************************************************
 
   TMatrixDSym* new_mat = (TMatrixDSym*)mat->Clone();
   int nrows = new_mat->GetNrows();
-  
+
   // Check for diagonal
   bool diagonal = true;
-  for (int i = 0; i < nrows; i++){
-    for (int j = 0; j < nrows; j++){
+  for (int i = 0; i < nrows; i++) {
+    for (int j = 0; j < nrows; j++) {
       if (i == j) continue;
 
-      if ((*new_mat)(i,j) != 0.0) {
-	diagonal=false;
-	break;
+      if ((*new_mat)(i, j) != 0.0) {
+        diagonal = false;
+        break;
       }
     }
   }
 
   // If diag, just flip the diag
-  if (diagonal or nrows == 1){
-    for(int i = 0; i < nrows; i++){
-      if ((*new_mat)(i,i) > 0.0)
-	(*new_mat)(i,i) = sqrt((*new_mat)(i,i));
+  if (diagonal or nrows == 1) {
+    for (int i = 0; i < nrows; i++) {
+      if ((*new_mat)(i, i) > 0.0)
+        (*new_mat)(i, i) = sqrt((*new_mat)(i, i));
       else
-	(*new_mat)(i,i) = 0.0;
+        (*new_mat)(i, i) = 0.0;
     }
     return new_mat;
   }
-  
+
   TDecompChol LU = TDecompChol(*new_mat);
   LU.Decompose();
   delete new_mat;
 
   TMatrixDSym* dec_mat = new TMatrixDSym(nrows, LU.GetU().GetMatrixArray(), "");
 
   return dec_mat;
 }
 
 
 
 
 
 //*******************************************************************
-void StatUtils::ForceNormIntoCovar(TMatrixDSym* mat, TH1D* hist, double norm){
+void StatUtils::ForceNormIntoCovar(TMatrixDSym* mat, TH1D* hist, double norm) {
 //*******************************************************************
 
   if (!mat) mat = MakeDiagonalCovarMatrix(hist);
 
   int nbins = mat->GetNrows();
   TMatrixDSym* new_mat = new TMatrixDSym(nbins);
 
-  for (int i = 0; i < nbins; i++){
-    for (int j = 0; j < nbins; j++){
+  for (int i = 0; i < nbins; i++) {
+    for (int j = 0; j < nbins; j++) {
 
-      double valx = hist->GetBinContent(i+1)*1E38;
-      double valy = hist->GetBinContent(j+1)*1E38;
+      double valx = hist->GetBinContent(i + 1) * 1E38;
+      double valy = hist->GetBinContent(j + 1) * 1E38;
 
-      (*new_mat)(i,j) = (*mat)(i,j) + norm*norm*valx*valy;
+      (*new_mat)(i, j) = (*mat)(i, j) + norm * norm * valx * valy;
 
     }
   }
 
   // Swap the two
   delete mat;
   mat = new_mat;
 
   return;
 };
 
-//******************************************************************* 
-void StatUtils::ForceNormIntoCovar(TMatrixDSym* mat, TH2D* data, double norm, TH2I* map ){
-//******************************************************************* 
+//*******************************************************************
+void StatUtils::ForceNormIntoCovar(TMatrixDSym* mat, TH2D* data, double norm, TH2I* map ) {
+//*******************************************************************
 
-   if (!map) map = StatUtils::GenerateMap(data);
-   TH1D* data_1D = MapToTH1D(data, map);
+  if (!map) map = StatUtils::GenerateMap(data);
+  TH1D* data_1D = MapToTH1D(data, map);
 
-   StatUtils::ForceNormIntoCovar(mat, data_1D, norm);
-   delete data_1D;
+  StatUtils::ForceNormIntoCovar(mat, data_1D, norm);
+  delete data_1D;
 
-   return;
+  return;
 }
 
 //*******************************************************************
-TMatrixDSym* StatUtils::MakeDiagonalCovarMatrix(TH1D* data, double scaleF){
+TMatrixDSym* StatUtils::MakeDiagonalCovarMatrix(TH1D* data, double scaleF) {
 //*******************************************************************
 
   TMatrixDSym* newmat = new TMatrixDSym(data->GetNbinsX());
-  
-  for (int i = 0; i < data->GetNbinsX(); i++){
-    (*newmat)(i,i) = data->GetBinError(i+1) * data->GetBinError(i+1) * scaleF * scaleF;
+
+  for (int i = 0; i < data->GetNbinsX(); i++) {
+    (*newmat)(i, i) = data->GetBinError(i + 1) * data->GetBinError(i + 1) * scaleF * scaleF;
   }
-  
+
   return newmat;
 }
 
 
 
-//*******************************************************************     
-TMatrixDSym* StatUtils::MakeDiagonalCovarMatrix(TH2D* data, TH2I* map, double scaleF){
-//*******************************************************************     
+//*******************************************************************
+TMatrixDSym* StatUtils::MakeDiagonalCovarMatrix(TH2D* data, TH2I* map, double scaleF) {
+//*******************************************************************
 
   if (!map) map = StatUtils::GenerateMap(data);
   TH1D* data_1D = MapToTH1D(data, map);
 
   return StatUtils::MakeDiagonalCovarMatrix(data_1D, scaleF);
 };
 
 
-//*******************************************************************     
-void StatUtils::SetDataErrorFromCov(TH1D* data, TMatrixDSym* cov, double scale){
-//*******************************************************************     
+//*******************************************************************
+void StatUtils::SetDataErrorFromCov(TH1D* data, TMatrixDSym* cov, double scale) {
+//*******************************************************************
 
   // Check
-  if (cov->GetNrows() != data->GetNbinsX()){
+  if (cov->GetNrows() != data->GetNbinsX()) {
     ERR(WRN) << "Nrows in cov don't match nbins in data for SetDataErrorFromCov" << std::endl;
   }
-  
+
   // Set bin errors form cov diag
-  for (int i = 0; i < data->GetNbinsX(); i++){
-    data->SetBinError(i+1, sqrt((*cov)(i,i)) * scale );
+  for (int i = 0; i < data->GetNbinsX(); i++) {
+    data->SetBinError(i + 1, sqrt((*cov)(i, i)) * scale );
   }
 
   return;
 }
 
-//*******************************************************************     
-void StatUtils::SetDataErrorFromCov(TH2D* data, TMatrixDSym* cov, TH2I* map, double scale){
-//*******************************************************************     
+//*******************************************************************
+void StatUtils::SetDataErrorFromCov(TH2D* data, TMatrixDSym* cov, TH2I* map, double scale) {
+//*******************************************************************
 
   // Create map if required
   if (!map) map = StatUtils::GenerateMap(data);
+  std::cout << data << " " << cov <<  " " << map <<  " " << scale << std::endl;
 
   // Set Bin Errors from cov diag
   int count = 0;
-  for (int i = 0; i < data->GetNbinsX(); i++){
-    for (int j = 0; j < data->GetNbinsY(); j++){
+  for (int i = 0; i < data->GetNbinsX(); i++) {
+    for (int j = 0; j < data->GetNbinsY(); j++) {
 
-      if (data->GetBinContent(i+1,j+1) == 0.0) continue;
+      if (data->GetBinContent(i + 1, j + 1) == 0.0) continue;
 
-      count = map->GetBinContent(i+1,j+1)-1;
-      data->SetBinError(i+1,j+1,  sqrt((*cov)(count,count)) * scale );
+      count = map->GetBinContent(i + 1, j + 1) - 1;
+      data->SetBinError(i + 1, j + 1,  sqrt((*cov)(count, count)) * scale );
 
     }
   }
 
   return;
 }
 
-//******************************************************************* 
-TH2I* StatUtils::GenerateMap(TH2D* hist){
-//******************************************************************* 
+//*******************************************************************
+TH2I* StatUtils::GenerateMap(TH2D* hist) {
+//*******************************************************************
 
   std::string maptitle = std::string(hist->GetName()) + "_MAP";
 
   TH2I* map = new TH2I( maptitle.c_str(), maptitle.c_str(),
-			hist->GetNbinsX(), 0, hist->GetNbinsX(),
-			hist->GetNbinsY(), 0, hist->GetNbinsY());
+                        hist->GetNbinsX(), 0, hist->GetNbinsX(),
+                        hist->GetNbinsY(), 0, hist->GetNbinsY());
 
   Int_t index = 1;
 
   for (int i = 0; i < hist->GetNbinsX(); i++) {
     for (int j = 0; j < hist->GetNbinsY(); j++) {
 
-      if (hist->GetBinContent(i+1,j+1) > 0 && hist->GetBinError(i+1,j+1) > 0){
-	
-	map->SetBinContent(i+1,j+1, index);
-	index++;
+      if (hist->GetBinContent(i + 1, j + 1) > 0 && hist->GetBinError(i + 1, j + 1) > 0) {
+
+        map->SetBinContent(i + 1, j + 1, index);
+        index++;
       } else {
-        map->SetBinContent(i+1, j+1, 0);
+        map->SetBinContent(i + 1, j + 1, 0);
       }
     }
   }
 
   return map;
 }
 
-//******************************************************************* 
-TH1D* StatUtils::MapToTH1D(TH2D* hist, TH2I* map){
-//******************************************************************* 
+//*******************************************************************
+TH1D* StatUtils::MapToTH1D(TH2D* hist, TH2I* map) {
+//*******************************************************************
 
   if (!hist) return NULL;
 
   // Get N bins for 1D plot
   Int_t Nbins = map->GetMaximum();
   std::string name1D = std::string(hist->GetName()) + "_1D";
-  
+
   // Make new 1D Hist
   TH1D* newhist = new TH1D(name1D.c_str(), name1D.c_str(), Nbins, 0, Nbins);
-  
+
   // map bin contents
-  for (int i = 0; i < map->GetNbinsX(); i++){
-    for (int j = 0; j < map->GetNbinsY(); j++){
+  for (int i = 0; i < map->GetNbinsX(); i++) {
+    for (int j = 0; j < map->GetNbinsY(); j++) {
 
-      if (map->GetBinContent(i+1,j+1) == 0) continue;
-      
-      newhist->SetBinContent(map->GetBinContent(i+1,j+1), hist->GetBinContent(i+1,j+1));
-      newhist->SetBinError(map->GetBinContent(i+1,j+1),   hist->GetBinError(i+1,j+1));
+      if (map->GetBinContent(i + 1, j + 1) == 0) continue;
+
+      newhist->SetBinContent(map->GetBinContent(i + 1, j + 1), hist->GetBinContent(i + 1, j + 1));
+      newhist->SetBinError(map->GetBinContent(i + 1, j + 1),   hist->GetBinError(i + 1, j + 1));
     }
   }
 
   // return
   return newhist;
 }
 
 
-//******************************************************************* 
-TH1I* StatUtils::MapToMask(TH2I* hist, TH2I* map){
-//******************************************************************* 
+//*******************************************************************
+TH1I* StatUtils::MapToMask(TH2I* hist, TH2I* map) {
+//*******************************************************************
 
   TH1I* newhist = NULL;
   if (!hist) return newhist;
 
   // Get N bins for 1D plot
   Int_t Nbins = map->GetMaximum();
   std::string name1D = std::string(hist->GetName()) + "_1D";
-  
+
   // Make new 1D Hist
   newhist = new TH1I(name1D.c_str(), name1D.c_str(), Nbins, 0, Nbins);
-  
+
   // map bin contents
-  for (int i = 0; i < map->GetNbinsX(); i++){
-    for (int j = 0; j < map->GetNbinsY(); j++){
+  for (int i = 0; i < map->GetNbinsX(); i++) {
+    for (int j = 0; j < map->GetNbinsY(); j++) {
 
-      if (map->GetBinContent(i+1,j+1) == 0) continue;
+      if (map->GetBinContent(i + 1, j + 1) == 0) continue;
 
-      newhist->SetBinContent(map->GetBinContent(i+1,j+1), hist->GetBinContent(i+1,j+1));
+      newhist->SetBinContent(map->GetBinContent(i + 1, j + 1), hist->GetBinContent(i + 1, j + 1));
     }
   }
 
   // return
   return newhist;
 }
 
 
-TMatrixDSym* StatUtils::GetCovarFromCorrel(TMatrixDSym* correl, TH1D* data){
+TMatrixDSym* StatUtils::GetCovarFromCorrel(TMatrixDSym* correl, TH1D* data) {
 
   int nbins = correl->GetNrows();
   TMatrixDSym* covar = new TMatrixDSym(nbins);
 
-  for (int i = 0; i < nbins; i++){
-    for (int j = 0; j < nbins; j++){
-      (*covar)(i,j) = (*correl)(i,j) * data->GetBinError(i+1) * data->GetBinError(j+1);
+  for (int i = 0; i < nbins; i++) {
+    for (int j = 0; j < nbins; j++) {
+      (*covar)(i, j) = (*correl)(i, j) * data->GetBinError(i + 1) * data->GetBinError(j + 1);
     }
   }
 
   return covar;
 }
+
+
+
+//*******************************************************************
+TMatrixD* StatUtils::GetMatrixFromTextFile(std::string covfile, int dimx, int dimy) {
+//*******************************************************************
+
+  // Determine dim
+  if (dimx == -1 and dimy == -1) {
+    std::string line;
+    std::ifstream covar(covfile.c_str(), ifstream::in);
+
+    int row = 0;
+    while (std::getline(covar >> std::ws, line, '\n')) {
+      int column = 0;
+
+      std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+      for (std::vector<double>::iterator iter = entries.begin();
+           iter != entries.end(); iter++) {
+        column++;
+
+        if (column > dimx) dimx = column;
+      }
+      row++;
+      if (row > dimy) dimy = row;
+    }
+  }
+
+  // Or assume symmetric
+  if (dimx != -1 and dimy == -1) {
+    dimy = dimx;
+  }
+  assert(dimy != -1 && " matrix dimy not set.");
+
+  // Make new matrix
+  TMatrixD* mat = new TMatrixD(dimx, dimy);
+  std::string line;
+  std::ifstream covar(covfile.c_str(), ifstream::in);
+
+  int row = 0;
+  while (std::getline(covar >> std::ws, line, '\n')) {
+    int column = 0;
+
+    std::vector<double> entries = GeneralUtils::ParseToDbl(line, " ");
+    for (std::vector<double>::iterator iter = entries.begin();
+         iter != entries.end(); iter++) {
+
+      // Check Rows
+      //assert(row > mat->GetNrows() && " covar rows doesn't match matrix rows.");
+      //assert(column > mat->GetNcols() && " covar cols doesn't match matrix cols.");
+
+      // Fill Matrix
+      (*mat)(row, column) = (*iter);
+      column++;
+    }
+    row++;
+  }
+
+  return mat;
+}
+
+//*******************************************************************
+TMatrixD* StatUtils::GetMatrixFromRootFile(std::string covfile, std::string histname) {
+//*******************************************************************
+
+  std::string inputfile = covfile + ";" + histname;
+  std::vector<std::string> splitfile = GeneralUtils::ParseToStr(inputfile, ";");
+
+  if (splitfile.size() < 2) {
+    ERR(FTL) << "No object name given!" << std::endl;
+    throw;
+  }
+
+  // Get file
+  TFile* tempfile = new TFile(splitfile[0].c_str(), "READ");
+
+  // Get Object
+  TObject* obj = tempfile->Get(splitfile[1].c_str());
+  if (!obj) {
+    ERR(FTL) << "Object " << splitfile[1] << " doesn't exist!" << std::endl;
+    throw;
+  }
+
+  // Try casting
+  TMatrixD* mat = dynamic_cast<TMatrixD*>(obj);
+  if (mat) {
+
+    TMatrixD* newmat = (TMatrixD*)mat->Clone();
+
+    delete mat;
+    tempfile->Close();
+
+    return newmat;
+  }
+
+  TMatrixDSym* matsym = dynamic_cast<TMatrixDSym*>(obj);
+  if (matsym) {
+
+    TMatrixD* newmat = new TMatrixD(matsym->GetNrows(), matsym->GetNrows());
+    for (int i = 0; i < matsym->GetNrows(); i++) {
+      for (int j = 0; j < matsym->GetNrows(); j++) {
+        (*newmat)(i, j) = (*matsym)(i, j);
+      }
+    }
+
+    delete matsym;
+    tempfile->Close();
+
+    return newmat;
+  }
+
+  TH2D* mathist = dynamic_cast<TH2D*>(obj);
+  if (mathist) {
+    TMatrixD* newmat = new TMatrixD(mathist->GetNbinsX(), mathist->GetNbinsX());
+    for (int i = 0; i < mathist->GetNbinsX(); i++) {
+      for (int j = 0; j < mathist->GetNbinsX(); j++) {
+        (*newmat)(i, j) = mathist->GetBinContent(i + 1, j + 1);
+      }
+    }
+
+    delete mathist;
+    tempfile->Close();
+
+    return newmat;
+  }
+  
+  return NULL;
+}
+
+//*******************************************************************
+TMatrixDSym* StatUtils::GetCovarFromTextFile(std::string covfile, int dim){
+//*******************************************************************
+
+  // Delete TempMat
+  TMatrixD* tempmat = GetMatrixFromTextFile(covfile, dim, dim);
+
+  // Make a symmetric covariance
+  TMatrixDSym* newmat = new TMatrixDSym(tempmat->GetNrows());
+  for (int i = 0; i < tempmat->GetNrows(); i++){
+    for (int j = 0; j < tempmat->GetNrows(); j++){
+      (*newmat)(i,j) = (*tempmat)(i,j);
+    }
+  }
+
+
+  delete tempmat;
+  return newmat;
+}
+
+//*******************************************************************
+TMatrixDSym* StatUtils::GetCovarFromRootFile(std::string covfile, std::string histname){
+//*******************************************************************
+
+  TMatrixD* tempmat = GetMatrixFromRootFile(covfile, histname);
+  TMatrixDSym* newmat = new TMatrixDSym(tempmat->GetNrows());
+
+  for (int i = 0; i < tempmat->GetNrows(); i++){
+    for (int j = 0; j < tempmat->GetNrows(); j++){
+      (*newmat)(i,j) = (*tempmat)(i,j);
+    }
+  }
+
+  delete tempmat;
+  return newmat;
+}
diff --git a/src/Utils/StatUtils.h b/src/Utils/StatUtils.h
index 57b11f0..e0e8e15 100644
--- a/src/Utils/StatUtils.h
+++ b/src/Utils/StatUtils.h
@@ -1,213 +1,253 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
 
 #ifndef STATUTILS_H
 #define STATUTILS_H
 
 // C Includes
 #include <stdlib.h>
 #include <numeric>
 #include <math.h>
 #include <string>
 #include <iostream>
 #include <sstream>
 #include <iomanip>
 #include <deque>
-
+#include "assert.h"
 
 // Root Includes
 #include "TH1D.h"
 #include "TH2I.h"
 #include "TH2D.h"
 #include "TFile.h"
 #include "TMatrixDSym.h"
 #include "TDecompSVD.h"
 #include "TMath.h"
 #include "TRandom3.h"
 #include "TDecompChol.h"
 #include "TGraphErrors.h"
 
 
 // Fit Includes
 #include "FitParameters.h"
 #include "FitLogger.h"
 
 /*!
  *  \addtogroup Utils
  *  @{
  */
 
 //! Functions for handling statistics calculations
 namespace StatUtils{
 
   /*
     Chi2 Functions
   */
 
   //! Get Chi2 using diagonal bin errors from the histogram. Masking applied before calculation if mask provided.
   Double_t GetChi2FromDiag(TH1D* data, TH1D* mc, TH1I* mask=NULL);
 
   //! Get Chi2 using diagonal bin errors from the histogram.
   //! Plots converted to 1D histograms before using 1D calculation.
   Double_t GetChi2FromDiag(TH2D* data, TH2D* mc, TH2I* map=NULL, TH2I* mask=NULL);
 
   //! Get Chi2 using an inverted covariance for the data
   Double_t GetChi2FromCov( TH1D* data, TH1D* mc, TMatrixDSym* invcov, TH1I* mask=NULL);
 
   //! Get Chi2 using an inverted covariance for the data
   //! Plots converted to 1D histograms before using 1D calculation.
   Double_t GetChi2FromCov( TH2D* data, TH2D* mc, TMatrixDSym* invcov, TH2I* map=NULL, TH2I* mask=NULL);
 
   //! Get Chi2 using an SVD method on the covariance before calculation.
   //! Method suggested by Rex at MiniBooNE. Shown that it doesn't actually work.
   Double_t GetChi2FromSVD( TH1D* data, TH1D* mc, TMatrixDSym* cov,    TH1I* mask=NULL);
 
   //! Get Chi2 using an SVD method on the covariance before calculation.
   //! Method suggested by Rex at MiniBooNE. Shown that it doesn't actually work.
   //! Plots converted to 1D histograms before using 1D calculation.
   Double_t GetChi2FromSVD( TH2D* data, TH2D* mc, TMatrixDSym* cov,    TH2I* map=NULL, TH2I* mask=NULL);
 
 
   //! Get Chi2 using only the raw event rates given in each bin using a -2LL method.
   Double_t GetChi2FromEventRate(TH1D* data, TH1D* mc, TH1I* mask=NULL);
 
   //! Get Chi2 using only the raw event rates given in each bin using a -2LL method.
   //! Plots converted to 1D histograms before using 1D calculation.
   Double_t GetChi2FromEventRate(TH2D* data, TH2D* mc, TH2I* map=NULL, TH2I* mask=NULL);
 
   // Likelihood Functions
 
   //! Placeholder for 1D binned likelihood method
   Double_t GetLikelihoodFromDiag(TH1D* data, TH1D* mc, TH1I* mask=NULL);
   //! Placeholder for 2D binned likelihood method
   Double_t GetLikelihoodFromDiag(TH2D* data, TH2D* mc, TH2I* map=NULL, TH2I* mask=NULL);
 
   //! Placeholder for 1D binned likelihood method
   Double_t GetLikelihoodFromCov( TH1D* data, TH1D* mc, TMatrixDSym* invcov, TH1I* mask=NULL);
   //! Placeholder for 2D binned likelihood method
   Double_t GetLikelihoodFromCov( TH2D* data, TH2D* mc, TMatrixDSym* invcov, TH2I* map=NULL, TH2I* mask=NULL);
 
   //! Placeholder for 1D binned likelihood method
   Double_t GetLikelihoodFromSVD( TH1D* data, TH1D* mc, TMatrixDSym* cov,    TH1I* mask=NULL);
   //! Placeholder for 2D binned likelihood method
   Double_t GetLikelihoodFromSVD( TH2D* data, TH2D* mc, TMatrixDSym* cov,    TH2I* map=NULL, TH2I* mask=NULL);
 
   //! Placeholder for 1D binned likelihood method
   Double_t GetLikelihoodFromEventRate(TH1D* data, TH1D* mc, TH1I* mask=NULL);
   //! Placeholder for 2D binned likelihood method
   Double_t GetLikelihoodFromEventRate(TH2D* data, TH2D* mc, TH2I* map=NULL, TH2I* mask=NULL);
 
   /*
      NDOF Functions
   */
 
   //! Return 1D Histogram NDOF considering masking and empty bins
   Int_t GetNDOF(TH1D* hist, TH1I* mask=NULL);
 
   //! Return 2D Histogram NDOF considering masking and empty bins
   Int_t GetNDOF(TH2D* hist, TH2I* map=NULL, TH2I* mask=NULL);
 
   /*
     Fake Data Functions
   */
 
   //! Given a full covariance for a 1D data set throw the decomposition to generate fake data.
   //! throwdiag determines whether diagonal statistical errors are thrown.
   //! If no covariance is provided only statistical errors are thrown.
   TH1D* ThrowHistogram(TH1D* hist, TMatrixDSym* cov, bool throwdiag=true, TH1I* mask=NULL);
 
   //! Given a full covariance for a 2D data set throw the decomposition to generate fake data.
   //! Plots are converted to 1D histograms and the 1D ThrowHistogram is used, before being converted back to 2D histograms.
   TH2D* ThrowHistogram(TH2D* hist, TMatrixDSym* cov, TH2I* map=NULL, bool throwdiag=true, TH2I* mask=NULL);
 
 
   /*
     Masking Functions
   */
 
   //! Given a mask histogram, mask out any bins in hist with non zero entries in mask.
   TH1D* ApplyHistogramMasking(TH1D* hist, TH1I* mask);
 
   //! Given a mask histogram, mask out any bins in hist with non zero entries in mask.
   TH2D* ApplyHistogramMasking(TH2D* hist, TH2I* mask);
 
   //! Given a mask histogram apply the masking procedure to each of the rows/columns in a covariance, before recalculating its inverse.
   TMatrixDSym* ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH1I* mask);
 
   //! Given a mask histogram apply the masking procedure to each of the rows/columns in a covariance, before recalculating its inverse.
   //! Converts to 1D data before using the 1D ApplyInvertedMatrixMasking function and converting back to 2D.
   TMatrixDSym* ApplyInvertedMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map=NULL);
 
   //! Given a mask histogram apply the masking procedure to each of the rows/columns in a covariance
   TMatrixDSym* ApplyMatrixMasking(TMatrixDSym* mat, TH1I* mask);
 
   //! Given a mask histogram apply the masking procedure to each of the rows/columns in a covariance
   //! Converts to 1D data before using the 1D ApplyInvertedMatrixMasking function and converting back to 2D.
   TMatrixDSym* ApplyMatrixMasking(TMatrixDSym* mat, TH2D* data, TH2I* mask, TH2I* map=NULL);
 
   /*
     Covariance Handling Functions
   */
 
   //! Return inverted matrix of TMatrixDSym
   TMatrixDSym* GetInvert(TMatrixDSym* mat);
 
   //! Return Cholesky Decomposed matrix of TMatrixDSym
   TMatrixDSym* GetDecomp(TMatrixDSym* mat);
 
   //! Return full covariances
   TMatrixDSym* GetCovarFromCorrel(TMatrixDSym* correl, TH1D* data);
 
   //! Given a normalisation factor for a dataset add in a new normalisation term to the covariance.
   void ForceNormIntoCovar(TMatrixDSym* mat, TH1D* data, double norm);
 
   //! Given a normalisation factor for a dataset add in a new normalisation term to the covariance.
   //! Convertes 2D to 1D, before using 1D ForceNormIntoCovar
   void ForceNormIntoCovar(TMatrixDSym* mat, TH2D* data, double norm, TH2I* map=NULL);
 
   //! Given a dataset generate an uncorrelated covariance matrix using the bin errors.
   TMatrixDSym* MakeDiagonalCovarMatrix(TH1D* data, double scaleF=1E38);
 
   //! Given a dataset generate an uncorrelated covariance matrix using the bin errors.
   TMatrixDSym* MakeDiagonalCovarMatrix(TH2D* data, TH2I* map=NULL, double scaleF=1E38);
 
   //! Given a covariance set the errors in each bin on the data from the covariance diagonals.
   void SetDataErrorFromCov(TH1D* data, TMatrixDSym* cov, double scale=1.0);
 
   //! Given a covariance set the errors in each bin on the data from the covariance diagonals.
   void SetDataErrorFromCov(TH2D* data, TMatrixDSym* cov, TH2I* map=NULL, double scale=1.0);
 
 
   /*
     Mapping Functions
   */
 
   //! If no map is provided for the 2D histogram, generate one by counting up through the bins along x and y.
   TH2I* GenerateMap(TH2D* hist);
 
   //! Apply a map to a 2D histogram converting it into a 1D histogram.
   TH1D* MapToTH1D(TH2D* hist, TH2I* map);
 
   //! Apply a map to a 2D mask convering it into a 1D mask.
   TH1I* MapToMask(TH2I* hist, TH2I* map);
 
+
+  /// \brief Read TMatrixD from a text file
+  ///
+  /// - covfile = full path to text file
+  /// - dimx = x dimensions of matrix
+  /// - dimy = y dimensions of matrix
+  ///
+  /// Format of textfile should be: \n
+  /// cov_11  cov_12 ...  cov_1N \n
+  /// cov_21  cov_22 ...  cov_2N \n
+  /// ...     ...    ...  ...    \n
+  /// cov_N1  ...    ...  cov_NN \n
+  ///
+  /// If no dimensions are given, dimx and dimy are determined from rows/columns
+  /// inside textfile.
+  ///
+  /// If only dimx is given a symmetric matrix is assumed.
+  TMatrixD* GetMatrixFromTextFile(std::string covfile, int dimx=-1, int dimy=-1);
+
+
+  /// \brief Read TMatrixD from a ROOT file
+  ///
+  /// - covfile = full path to root file (+';histogram')
+  /// - histname = histogram name
+  ///
+  /// If no histogram name is given function assumes it has been appended
+  /// covfile path as: \n
+  /// 'covfile.root;histname' 
+  ///
+  /// histname can point to a TMatrixD object, a TMatrixDSym object, or
+  /// a TH2D object.
+  TMatrixD* GetMatrixFromRootFile(std::string covfile, std::string histname="");
+
+  /// \brief Calls GetMatrixFromTextFile and turns it into a TMatrixDSym
+  TMatrixDSym* GetCovarFromTextFile(std::string covfile, int dim);
+
+  /// \brief Calls GetMatrixFromRootFile and turns it into a TMatrixDSym
+  TMatrixDSym* GetCovarFromRootFile(std::string covfile, std::string histname);
+
+
 };
 
 /*! @} */
 #endif
diff --git a/src/Utils/TargetUtils.cxx b/src/Utils/TargetUtils.cxx
new file mode 100644
index 0000000..6f040ab
--- /dev/null
+++ b/src/Utils/TargetUtils.cxx
@@ -0,0 +1,39 @@
+#include "TargetUtils.h"
+
+std::vector<int> TargetUtils::ParseTargetsToIntVect(std::string targets) {
+
+	std::vector<std::string> splittgt = GeneralUtils::ParseToStr(targets, ",");
+	std::vector<int> convtgt;
+
+	for (size_t i = 0; i < splittgt.size(); i++) {
+		std::string type = splittgt[i];
+		convtgt.push_back( GetTargetPDGFromString( type ) );
+	}
+
+	return convtgt;
+}
+
+
+int TargetUtils::GetTargetPDGFromString(std::string target){
+
+	if      (!target.compare("H")) return 1000010010;
+	else if (!target.compare("C")) return 1000060120;
+	else if (!target.compare("O")) return 1000080160;
+	else {
+		int conv = GeneralUtils::StrToInt(target);
+		if (abs(conv) > 1) return conv;
+	}
+	return 0;
+}
+
+int TargetUtils::GetTargetPDGFromZA(int Z, int A){
+	return 1000000000 + A*10 + Z*10000;
+}
+
+int TargetUtils::GetTargetAFromPDG(int PDG){
+	return ((PDG%1000000000) - (PDG%10000))/10;
+}
+
+int TargetUtils::GetTargetZFromPDG(int PDG){
+	return ((PDG%1000000000) - (GetTargetAFromPDG(PDG)))/10000;
+}
\ No newline at end of file
diff --git a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h b/src/Utils/TargetUtils.h
similarity index 57%
copy from src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
copy to src/Utils/TargetUtils.h
index 7658b4a..aca226c 100644
--- a/src/ANL/ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu.h
+++ b/src/Utils/TargetUtils.h
@@ -1,41 +1,47 @@
 // Copyright 2016 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret
 
 /*******************************************************************************
 *    This file is part of NUISANCE.
 *
 *    NUISANCE is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    NUISANCE is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with NUISANCE.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
+#ifndef TARGET_UTILS_H
+#define TARGET_UTILS_H
 
-#ifndef ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
-#define ANL_CC2PI_1PIM1PIP_EVT_1DPROT_NU_H_SEEN
+#include "FitLogger.h"
+#include "GeneralUtils.h"
 
-#include "Measurement1D.h"
+/// Namespace for utils parsing target pdgs
+namespace TargetUtils {
 
-class ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu : public Measurement1D {
+	/// Convert comma seperated string of targets to vector of PDG codes
+	///
+	/// e.g. "C,H,10000100010" = "100000600120,10000100010,100000100010"
+	std::vector<int> ParseTargetsToIntVect(std::string targets);
 
-public:
-  ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile);
-  virtual ~ANL_CC2pi_1pim1pip_Evt_1Dpprot_nu() {};
+	/// Convert a target string to pdg code
+	int GetTargetPDGFromString(std::string target);
 
-  void FillEventVariables(FitEvent *event);
-  bool isSignal(FitEvent *event);
-  //void ScaleEvents();
-  //void FillHistograms();
+	/// Get Nuclear PDG code from Z and A
+	int GetTargetPDGFromZA(int Z, int A);
 
+	/// Get TargetZ code from the full PDG
+	int GetTargetZFromPDG(int PDG);
 
- private:
+	/// Get TargetA code from the full PDG
+	int GetTargetAFromPDG(int PDG);
+}
 
-};
-  
-#endif
+
+#endif
\ No newline at end of file