diff --git a/app/nuissplines.cxx b/app/nuissplines.cxx index b2fa66d..f5efb45 100644 --- a/app/nuissplines.cxx +++ b/app/nuissplines.cxx @@ -1,105 +1,105 @@ // Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret /******************************************************************************* * This file is part of NUISANCE. * * NUISANCE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * NUISANCE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NUISANCE. If not, see . *******************************************************************************/ // Author: Callum Wilkinson 01/2014 // Patrick Stowell 09/2015 /** Usage: ./GSLminimizerWithReWeight.exe -c card file, where samples and parameters are defined -o output file, where the results of the fit are stored where: */ #include "SplineRoutines.h" //******************************* void printInputCommands(){ //******************************* /* - std::cout<<"ExtFit_splines.exe -c cardFile -f [spline_routines] [-q + std::cout<<"nuissplines -c cardFile -f [spline_routines] [-q config_name=config_val] \n"; std::cout<Run(); // Show Final Status NUIS_LOG(FIT, "-------------------------------------"); NUIS_LOG(FIT, "Spline Generation/Validation Finished."); NUIS_LOG(FIT, "-------------------------------------"); return 0; } diff --git a/doc/tutorial_dialtuning.dox b/doc/tutorial_dialtuning.dox index 100637c..f783388 100644 --- a/doc/tutorial_dialtuning.dox +++ b/doc/tutorial_dialtuning.dox @@ -1,108 +1,108 @@ /*! \page tutorial_dialtuning Dial Tuning The main purpose of the fitter is to allow ReWeight dials to be quickly tuned to datasets. In this tutorial we go through how to include dials in a simple fit and define their state. \section tutorial_dialtuning_parcard Extending the Fit Card First, copy the fit card from the previous tutorial using the sample definition given there. Now we want to add in a NEUT ReWeight dials, so a quick grep of the NEUT systematics file will return what the dial names are. Below is a shortened output. Some dials (especially ones that are discontinous) cannot be used with the fitter so check what little notes there are inside the RW functions themselves when including new dials. \code $ grep case $NEUT_REWEIGHT/NSyst.h case ( kXSecTwkDial_NormNCEL ) : return "NormNCEL"; break; //case ( kXSecTwkDial_NormNCELenu ) : return "NormNCELenu"; break; case ( kXSecTwkDial_MaNCEL ) : return "MaNCEL"; break; case ( kXSecTwkDial_MaNCELshape ) : return "MaNCELshape"; break; case ( kXSecTwkDial_1overMaNCEL2 ) : return "1overMaNCEL2"; break; case ( kXSecTwkDial_AxlFFNCEL ) : return "AxlFFNCEL"; break; case ( kXSecTwkDial_VecFFNCEL ) : return "VecFFNCEL"; break; //case ( kXSecTwkDial_VecFFNCELshape ) : return "VecFFNCELshape"; break; //case ( kXSecTwkDial_EtaNCEL ) : return "EtaNCEL"; break; case ( kXSecTwkDial_NormCCQE ) : return "NormCCQE"; break; //case ( kXSecTwkDial_NormCCQEenu ) : return "NormCCQEenu"; break; case ( kXSecTwkDial_MaCCQE ) : return "MaCCQE"; break; \endcode So lets say we want to include two modifications to the MC. Firstly, we want to scale down the CCQE normalisation by a fixed 10%. Then we want to vary the axial mass freely in the fit between 0.8 and 1.4 GeV and try to converge on a best fit for this dial. To figure out what values we need to include in the card file we must determine the 1-sigma uncertainty on these parameters. Again a grep will do the trick for the 1-sigma uncertainty: \code $ grep NormCCQE $NEUT_REWEIGHT/NSystUncertainty.cc this->SetUncertainty( kXSecTwkDial_NormCCQE, 0.15, 0.15); $ grep NormCCQE $NEUT_REWEIGHT/NSystUncertainty.cc this->SetUncertainty( kXSecTwkDial_MaCCQE, 0.165289256, 0.165289256); \endcode Unfortunately the default values for these parameters is a bit more akward to find. These are given in each of the RW objects in the NEUT_REWEIGHT folder. For the purpose of this excerices we just explicitly state them here. \code Nominal MaCCQE = 1.21 GeV/c^2 Nominal NormCCQE = 1.0 \endcode We must then convert the true values we have for the nominal and limits into 1-sigma dial values using the following equation. \code true.value = nominal.value * ( 1.0 + sig.err * dial.value) dial.value = ( (true.value / nominal.value) - 1.0 ) / sig.err \endcode To finally include these dials the following lines should be added to the fit card with the neut_parameter identifier. \code # ident --------- Parameter --- Nom. ---- Low. ---- Upp. --- Stp. --- State ---- neut_parameter NormCCQE -0.10 -1.00 1.00 1.0 FIX neut_parameter MaCCQE 0.00 -2.11 0.98 1.0 FREE \endcode Alternative parameter types can be supplied for each of the different generators. These are: - neut_parameter -> NEUT - nuwro_parameter -> NuWro (Make sure you have built with NuWro AND NuWroReWeight) - genie_parameter -> GENIE - niwg_parameter -> NIWG - custom_parameter -> Custom dials that can be added to FitWeight if required. Currently a placeholder. The nominal value should always be within the lower and upper limits otherwise ROOT's minimizer libraries will complain. The step size seems to currently be ignored by most of the libraries but it is used by the PlotLimits and GridScan function so it is best to choose something reasonable just to be safe. \section tutorial_dialtuning_absolute Using absolute dial values There has recently been a modification to FitBase to allow dials to be shown in the fit card in terms of true values provided a conversion function is given in the card file contained in FitBase. If you want to use this method, you should also provide the state "ABS" in the card file. So for example the MaCCQE dial line would become. \code # ident --------- Parameter --- Nom. ---- Low. ---- Upp. --- Stp. --- State ---- neut_parameter MaCCQE 0.0 0.8 1.4 0.4 FREE/ABS \endcode Alternative parameter types can be supplied for each of the different generators. These are: - neut_parameter -> NEUT - nuwro_parameter -> NuWro (Make sure you have built with NuWro AND NuWroReWeight) - genie_parameter -> GENIE - niwg_parameter -> NIWG - custom_parameter -> Custom dials that can be added to FitWeight if required. Currently a placeholder. \section tutorial_dialtuning_runfit Running the Fit Once you have written the fit card it should be as simple as running the minimizer again. \code -ExtFit_minimizer.exe -c fittertutorial2.card -o fittertutorial2.root +nuismin -c fittertutorial2.card -o fittertutorial2.root \endcode The finished fit should produce the following output table for each parameter involved. The specified output root file should also contain MC histograms for the best fit point. There are cases where strong parameter correlations and bumpy chi2 spaces will mean the fit has problems converging. As a general guide fitting 4 parameters will usually take around 400 reconfigures. If it takes significantly longer than this (3x) then you may be having trouble. Alternative fit routines are available to try and fix problems like this. See \ref tutorial_fitroutines for more information. */ \ No newline at end of file diff --git a/doc/tutorial_inputs.dox b/doc/tutorial_inputs.dox index 4a95fd1..afcb575 100644 --- a/doc/tutorial_inputs.dox +++ b/doc/tutorial_inputs.dox @@ -1,149 +1,149 @@ /*! \page tutorial_inputs Fitting Input Card To determine what samples need to be loaded and the location of the event files to be read the fitter parses a premade input fit card which contains everything piece of information for the fit. This tutorial details how to load a simple sample of events from each of the generators and compare them against each other. \section fitcards The Fit Card For this very simple case so all that is required in the fit card is a single line to read in which sample we want to plot. For a list of samples see \ref samplelist. We want a set of Monte Carlo events to make the data/MC comparison so first you will need to generate this in Neut and NuWro separately. No explicit tutorial is given for this, but please see \ref generators for tips on what generator output format the events need to be in. Once we have a set of events create a fit card "fittertutorial1.card" in the current directory and include the "MiniBooNE_CCQE_XSec_1DQ2_nu" sample as follows. \code # Identifier - Sample Name ----------------- Type - Events File Name ------------------- Normalisation sample MiniBooNE_CCQE_XSec_1DQ2_nu FIX /path/to/miniboone_ccqe_events.root 1.0 \endcode - The "sample" argument lets the fitter know we want to include a new sample in this fit. Multiple samples can be included if required assuming they are uncorrelated by creating multiple sample lines in the fit card. - The Sample Name is a simple string identifier that lets the fitter know which dataset comparison should be performed, for a list of samples see \ref samplelist. - The sample Type is used to specify any other options required to describe how this sample is handled. Common examples are "FIX - fix this samples overall normalisation", "SHAPE - normalise MC to data before doing calculations", "DIAG - use only uncorrelated bin errors", "NORM - Add a normalisation penalty term to the fit". Some samples have extra possible fit types so it is worth checking the doxygen documentation for a sample before using it. - The events file name is just simply the directory to the MC events you want to use for this fit. In the case of joint datasets that require multiple input MC files, the path to each can be provided in this field by passing a semi-colon separated list, e.g. "/path/to/miniboone_ccqe_events1.root;/path/to/miniboone_ccqe_events2.root". - The normalisation term is used to float the overall normalisation of this sample. The fitter will complain and scale the samples to 0.0 if you forget to include this! \section fittingrun Running a Fit Once we have a sample card produced it is possible to run a default Migrad fit by passing this fit card to the minimizer. \code -ExtFit_minimizer.exe -c fittertutorial1.card -o fittertutorial1_output.root +nuismin -c fittertutorial1.card -o fittertutorial1_output.root \endcode Since we have not included any MC ReWeight dials to be minimized yet this should run relatively quickly, requiring only a single reconfigure. The final output should look as follows: \code [LOG Fitter]: Making the minimizerFCN [LOG Minmzr]: Initializing Samples [LOG Minmzr]: MINERvA_CCQE_XSec_1DQ2_nu [LOG Fitter]: Running Routine: Migrad [LOG Fitter]: Fixed Param: MINERvA_CCQE_XSec_1DQ2_nu_norm [LOG Fitter]: Setup Minimizer: 1(NDim) 0(NFree) [LOG Minmzr]: Reconfiguring all samples in series [LOG Minmzr]: Iteration = 1 [LOG Minmzr]: Time taken for this reconfigure: 40 [LOG Fitter]: Current Stat = 47.8123 [LOG Fitter]: Minimizer State: [LOG Fitter]: # Parameter = Value +- Error Units (Sigma Variation) [LOG Fitter]: 0 . MINERvA_CCQE_XSec_1DQ2_nu_norm = 1 Frac. (Fixed) [LOG Fitter]: Running Routine: FixAtLim [LOG Fitter]: Minimizer State: [LOG Fitter]: # Parameter = Value +- Error Units (Sigma Variation) [LOG Fitter]: 0 . MINERvA_CCQE_XSec_1DQ2_nu_norm = 1 Frac. (Fixed) Error in : matrix not positive definite Error in : matrix not positive definite [LOG Fitter]: Saving current FCN predictions [LOG Minmzr]: Reconfiguring all samples in series [LOG Minmzr]: Iteration = 1 [LOG Minmzr]: Time taken for this reconfigure: 39 [LOG Minmzr]: Writing each of the data classes: ------------------------------------- Minimizer Complete. ------------------------------------- \endcode - Note: The error messages about TDecompChol correspond to problems where teh minimizer didn't actually produce a good covariance matrix. This can happen if the fit fails, but also if you are fitting with 1 or 0 free parameters. If that is the case don't worry too much about it. \section analysing Analysing the Output The root file produced then contains the results from the fit. To list the contents run: \code root -l fittertutorial1_output.root root[1]: _file0->ls(); TFile** fittertutorial1_output.root TFile* fittertutorial1_output.root KEY: TTree fit_result;1 fit_result KEY: TH1D fit_dials;1 fit_dials KEY: TH1D start_dials;1 start_dials KEY: TH1D min_dials;1 min_dials KEY: TH1D max_dials;1 max_dials KEY: TH1D fit_status;1 fit_status KEY: TH2D covariance;1 covariance KEY: TH2D correlation;1 correlation KEY: TH2D decomposition;1 decomposition KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data;1 MINERvA_CCQE_XSec_1DQ2_nu_data KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC;1 47.812 KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_FINE;1 MINERvA_CCQE_XSec_1DQ2_nu_MC_FINE KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_FLUX;1 MINERvA_CCQE_XSec_1DQ2_nu KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_EVT;1 MINERvA_CCQE_XSec_1DQ2_nu_EVT KEY: THStack MINERvA_CCQE_XSec_1DQ2_nu_MC_PDG;1 MINERvA_CCQE_XSec_1DQ2_nu_MC_PDG KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_RATIO;1 47.812 KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data_RATIO;1 MINERvA_CCQE_XSec_1DQ2_nu_data KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_SHAPE;1 47.812 KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_MC_SHAPE_RATIO;1 47.812 KEY: TH1D MINERvA_CCQE_XSec_1DQ2_nu_data_SHAPE_RATIO;1 MINERvA_CCQE_XSec_1DQ2_nu_data KEY: TH1D sample_xsecs_MC;1 sample_xsecs_MC KEY: TH1D sample_xsecs_data;1 sample_xsecs_data root[2]: fit_result->Show(0); ======> EVENT:0 parameter_names = (vector*)0x1aa80e0 parameter_values = (vector*)0x1aa93b0 parameter_errors = (vector*)0x1aa9b40 parameter_min = (vector*)0x1aa9f30 parameter_max = (vector*)0x1aaa2f0 parameter_start = (vector*)0x1aaa6b0 parameter_fix = (vector*)0x1aaacb0 parameter_startfix = (vector*)0x1aab690 CHI2 = 47.8123 NDOF = 8 NBINS = 8 NDIM = 1 NFREE = 0 \endcode Each of the following plots are added to every output file following a minimization fit. - fit_results -> A TTree containing each of the dial names, values, limits, etc. The best fit chi2 point and number of fit degrees of freedom is given in this tree. - fit_dials -> Best fit results and fit errors for each dial in units of 1-sigam variation. Dials with 0.0 bin errors are fixed. - start_dials -> Nominal values for these fit parameters in units of 1-sigma variation. - min_dials -> Mnimium limit for each dial in units of 1-sigma variation. (If a dial is fit very close to the limit within fit error... worry) - max_dials -> Maximum limit for each dial in units of 1-sigma variation. (If a dial is fit very close to the limit within fit error... worry) - fit_status -> Plot of some variables from the fit, mostly unimportant. - covariance -> Fit result covariance that the ROOT minimizer gives out. - correlation -> Correlation matrix form the fit - decomposition -> Decomposed covariance matrix from the fit, useful for fake data studies and producing error bands for correlated parameters.. The following plots are specific to a given fit depending on what samples where included. The structure is generally the same, and the sample identifier used in the fit card will correspond to which sample made these plots. By default the following distributions should be created, but whether they are saved is determined by the configuration option "drawOpts" given in the config file. - MiniBooNE_CCQE_XSec_1DQ2_data -> Data distribution for the sample that was loaded in the fit. - MiniBooNE_CCQE_XSec_1DQ2_MC -> Best fit MC distribution after the fit has been ran. Titles on these plots give the best fit Chi2 for that single sample which is useful when running joint fits. Error bands show the statistical errors only for the MC prediction. - MiniBooNE_CCQE_XSec_1DQ2_MC_Fine -> Finely binned MC distribution at best fit (Can sometimes disagree with coarse MC histogram because of scaling factors..) - MiniBooNE_CCQE_XSec_1DQ2_MC_Shape -> MC plot normalised to match the data normalisation - MiniBooNE_CCQE_XSec_1DQ2_data_Ratio -> Data/MC Ratio Plot - MiniBooNE_CCQE_XSec_1DQ2_MC_Ratio -> Baseline for Data/MC Ratio (Unity) - MiniBooNE_CCQE_XSec_1DQ2_data_Shape_Ratio -> Data/MC Ratio where the MC is normalised to match the dataset before the ratio is calculated. */ diff --git a/src/Electron/CMakeLists.txt b/src/Electron/CMakeLists.txt index d6a0651..b872a22 100644 --- a/src/Electron/CMakeLists.txt +++ b/src/Electron/CMakeLists.txt @@ -1,48 +1,48 @@ # Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret ################################################################################ # This file is part of NUISANCE. # # NUISANCE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NUISANCE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with NUISANCE. If not, see . ################################################################################ set(IMPLFILES ElectronScattering_DurhamData.cxx ) set(HEADERFILES ElectronScattering_DurhamData.h ) 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(${MINIMUM_INCLUDE_DIRECTORIES}) set_target_properties(${LIBNAME} PROPERTIES VERSION - "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_VERSION_REVISION}") + "${NUISANCE_VERSION_MAJOR}.${NUISANCE_VERSION_MINOR}.${NUISANCE_VERSION_REVISION}") #set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS}) if(DEFINED PROJECTWIDE_EXTRA_DEPENDENCIES) add_dependencies(${LIBNAME} ${PROJECTWIDE_EXTRA_DEPENDENCIES}) endif() install(TARGETS ${LIBNAME} DESTINATION lib) #Can uncomment this to install the headers... but is it really neccessary? install(FILES ${HEADERFILES} DESTINATION include/Electron) set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE) diff --git a/src/InputHandler/CMakeLists.txt b/src/InputHandler/CMakeLists.txt index 9eacfa9..4a82e29 100644 --- a/src/InputHandler/CMakeLists.txt +++ b/src/InputHandler/CMakeLists.txt @@ -1,96 +1,96 @@ # Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret ################################################################################ # This file is part of NUISANCE. # # NUISANCE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NUISANCE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with NUISANCE. If not, see . ################################################################################ set(IMPLFILES BaseFitEvt.cxx FitParticle.cxx FitEvent.cxx GeneratorUtils.cxx StdHepEvt.cxx InputUtils.cxx NEUTInputHandler.cxx GENIEInputHandler.cxx NuWroInputHandler.cxx GIBUUInputHandler.cxx NUANCEInputHandler.cxx InputHandler.cxx NuanceEvent.cxx FitEventInputHandler.cxx SplineInputHandler.cxx GeneratorInfoBase.h HepMCTextInputHandler.cxx InputFactory.cxx SigmaQ0HistogramInputHandler.cxx HistogramInputHandler.cxx ) set(HEADERFILES BaseFitEvt.h FitParticle.h FitEvent.h GeneratorUtils.h StdHepEvt.h InputUtils.h NEUTInputHandler.h GENIEInputHandler.h NuWroInputHandler.h GIBUUInputHandler.h NUANCEInputHandler.h InputHandler.h NuanceEvent.h FitEventInputHandler.h SplineInputHandler.h GeneratorInfoBase.h InputTypes.h HepMCTextInputHandler.h InputFactory.h SigmaQ0HistogramInputHandler.h HistogramInputHandler.h ) if(USE_HEPMCNUEVT) LIST(APPEND IMPLFILES HepMCNuEvtInputHandler.cxx) endif() 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(${MINIMUM_INCLUDE_DIRECTORIES}) set_target_properties(${LIBNAME} PROPERTIES VERSION - "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_VERSION_REVISION}") + "${NUISANCE_VERSION_MAJOR}.${NUISANCE_VERSION_MINOR}.${NUISANCE_VERSION_REVISION}") #set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS}) if(DEFINED PROJECTWIDE_EXTRA_DEPENDENCIES) add_dependencies(${LIBNAME} ${PROJECTWIDE_EXTRA_DEPENDENCIES}) endif() if(HEPMC_USED_EP) add_dependencies(${LIBNAME} HepMC) endif() install(TARGETS ${LIBNAME} DESTINATION lib) #Can uncomment this to install the headers... but is it really neccessary? install(FILES ${HEADERFILES} DESTINATION include/InputHandler) set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE) diff --git a/src/Reweight/CMakeLists.txt b/src/Reweight/CMakeLists.txt index b1f04e4..579fb79 100644 --- a/src/Reweight/CMakeLists.txt +++ b/src/Reweight/CMakeLists.txt @@ -1,96 +1,96 @@ # Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret ################################################################################ # This file is part of NUISANCE. # # NUISANCE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NUISANCE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with NUISANCE. If not, see . ################################################################################ set(IMPLFILES GlobalDialList.cxx FitWeight.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 OscWeightEngine.cxx MINERvAWeightCalcs.cxx weightRPA.h ) if(USE_NOvARwgt) LIST(APPEND IMPLFILES NOvARwgtEngine.cxx) endif() if(USE_NUSYST) LIST(APPEND IMPLFILES nusystematicsWeightEngine.cxx) endif() set(HEADERFILES 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 OscWeightEngine.h MINERvAWeightCalcs.h weightRPA.h BeRPA.h ) if(USE_NOvARwgt) LIST(APPEND HEADERFILES NOvARwgtEngine.h) endif() 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(${MINIMUM_INCLUDE_DIRECTORIES}) set_target_properties(${LIBNAME} PROPERTIES VERSION - "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_VERSION_REVISION}") + "${NUISANCE_VERSION_MAJOR}.${NUISANCE_VERSION_MINOR}.${NUISANCE_VERSION_REVISION}") #set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS}) if(DEFINED PROJECTWIDE_EXTRA_DEPENDENCIES) add_dependencies(${LIBNAME} ${PROJECTWIDE_EXTRA_DEPENDENCIES}) endif() install(TARGETS ${LIBNAME} DESTINATION lib) #Can uncomment this to install the headers... but is it really neccessary? install(FILES ${HEADERFILES} DESTINATION include/Reweight) set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE) diff --git a/src/SciBooNE/CMakeLists.txt b/src/SciBooNE/CMakeLists.txt index 9f6f092..f501c9f 100644 --- a/src/SciBooNE/CMakeLists.txt +++ b/src/SciBooNE/CMakeLists.txt @@ -1,79 +1,79 @@ # Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret ################################################################################ # This file is part of NUISANCE. # # NUISANCE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # NUISANCE is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with NUISANCE. If not, see . ################################################################################ set(IMPLFILES SciBooNE_CCCOH_STOP_NTrks_nu.cxx SciBooNE_CCCOH_1TRK_1DQ2_nu.cxx SciBooNE_CCCOH_1TRK_1Dpmu_nu.cxx SciBooNE_CCCOH_1TRK_1Dthetamu_nu.cxx SciBooNE_CCCOH_MuPr_1DQ2_nu.cxx SciBooNE_CCCOH_MuPr_1Dthetamu_nu.cxx SciBooNE_CCCOH_MuPr_1Dpmu_nu.cxx SciBooNE_CCCOH_MuPiVA_1DQ2_nu.cxx SciBooNE_CCCOH_MuPiVA_1Dthetamu_nu.cxx SciBooNE_CCCOH_MuPiVA_1Dpmu_nu.cxx SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu.cxx SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu.cxx SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu.cxx SciBooNE_CCCOH_MuPiNoVA_1Dthetamu_nu.cxx SciBooNE_CCCOH_MuPiNoVA_1Dpmu_nu.cxx SciBooNE_CCCOH_STOPFINAL_1DQ2_nu.cxx SciBooNE_CCInc_XSec_1DEnu_nu.cxx SciBooNEUtils.cxx ) set(HEADERFILES SciBooNE_CCCOH_STOP_NTrks_nu.h SciBooNE_CCCOH_1TRK_1DQ2_nu.h SciBooNE_CCCOH_1TRK_1Dpmu_nu.h SciBooNE_CCCOH_1TRK_1Dthetamu_nu.h SciBooNE_CCCOH_MuPr_1DQ2_nu.h SciBooNE_CCCOH_MuPr_1Dthetamu_nu.h SciBooNE_CCCOH_MuPr_1Dpmu_nu.h SciBooNE_CCCOH_MuPiVA_1DQ2_nu.h SciBooNE_CCCOH_MuPiVA_1Dthetamu_nu.h SciBooNE_CCCOH_MuPiVA_1Dpmu_nu.h SciBooNE_CCCOH_MuPiNoVA_1DQ2_nu.h SciBooNE_CCCOH_MuPiNoVA_1Dthetapr_nu.h SciBooNE_CCCOH_MuPiNoVA_1Dthetapi_nu.h SciBooNE_CCCOH_MuPiNoVA_1Dthetamu_nu.h SciBooNE_CCCOH_MuPiNoVA_1Dpmu_nu.h SciBooNE_CCCOH_STOPFINAL_1DQ2_nu.h SciBooNE_CCInc_XSec_1DEnu_nu.h SciBooNEUtils.h ) set(LIBNAME expSciBooNE) if(CMAKE_BUILD_TYPE MATCHES DEBUG) add_library(${LIBNAME} STATIC ${IMPLFILES}) else(CMAKE_BUILD_TYPE MATCHES RELEASE) add_library(${LIBNAME} SHARED ${IMPLFILES}) endif() include_directories(${MINIMUM_INCLUDE_DIRECTORIES}) set_target_properties(${LIBNAME} PROPERTIES VERSION - "${ExtFit_VERSION_MAJOR}.${ExtFit_VERSION_MINOR}.${ExtFit_VERSION_REVISION}") + "${NUISANCE_VERSION_MAJOR}.${NUISANCE_VERSION_MINOR}.${NUISANCE_VERSION_REVISION}") #set_target_properties(${LIBNAME} PROPERTIES LINK_FLAGS ${ROOT_LD_FLAGS}) install(TARGETS ${LIBNAME} DESTINATION lib) #Can uncomment this to install the headers... but is it really neccessary? install(FILES ${HEADERFILES} DESTINATION include/SciBooNE) set(MODULETargets ${MODULETargets} ${LIBNAME} PARENT_SCOPE) diff --git a/src/Utils/SignalDef.h b/src/Utils/SignalDef.h index 07cc47b..f93d70a 100644 --- a/src/Utils/SignalDef.h +++ b/src/Utils/SignalDef.h @@ -1,98 +1,98 @@ // Copyright 2016-2021 L. Pickering, P Stowell, R. Terri, C. Wilkinson, C. Wret /******************************************************************************* * This file is part of NUISANCE. * * NUISANCE is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * NUISANCE is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NUISANCE. If not, see . *******************************************************************************/ // contains signal definitions for various interactions #ifndef SIGNALDEF_H_SEEN #define SIGNALDEF_H_SEEN // C/C++ includes #include // ROOT includes #include -// ExtFit includes +// NUISANCE 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 pdgs, double EnuMin = 0, double EnuMax = 0); template 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