Skip to content

Commit

Permalink
Merge branch 'develop' into feature_DetId
Browse files Browse the repository at this point in the history
  • Loading branch information
KSkwarczynski authored Jan 21, 2025
2 parents 39da9e6 + fda94de commit cc5d97f
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 10 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/CIPythonValidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
name: Validations Python CI

# The events that trigger the workflow
# on:
# pull_request:
# branches: [ develop ]
# This wrokflow temporary dont work, please uncoment this when fixed
on:
pull_request:
branches: [ develop ]
workflow_dispatch: # Placeholder trigger to allow manual runs only

permissions:
contents: read
Expand Down
9 changes: 9 additions & 0 deletions cmake/Modules/MaCh3Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ set(MaCh3_MINUIT2_ENABLED FALSE)
if(ROOT_VERSION GREATER_EQUAL 6.32.00 OR ROOT_CONFIG_MINUIT2 GREATER -1)
set(MaCh3_MINUIT2_ENABLED TRUE)
endif()

# KS: Parts of MaCh3 uses Fast Fourier Transform, do some safeguard
list(FIND ROOT_FEATURES_LIST "fftw3" ROOT_CONFIG_FFT)
set(MaCh3_FFT_ENABLED FALSE)
if(ROOT_CONFIG_FFT GREATER -1)
cmessage(STATUS "FFT Enabled")
set(MaCh3_FFT_ENABLED TRUE)
target_compile_definitions(MaCh3CompileDefinitions INTERFACE MaCh3_FFT)
endif()
### End ROOT setup

#YAML for reading in config files
Expand Down
6 changes: 6 additions & 0 deletions mcmc/MCMCProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ MCMCProcessor::MCMCProcessor(const std::string &InputFile) :
ApplySmoothing = true;
FancyPlotNames = true;
doDiagMCMC = false;

// KS: ROOT can compile FFT code but it will crash during run time. Turn off FFT dynamically
#ifdef MaCh3_FFT
useFFTAutoCorrelation = true;
#else
useFFTAutoCorrelation = false;
#endif
OutputSuffix = "_Process";
Post2DPlotThreshold = 1.e-5;

Expand Down
1 change: 0 additions & 1 deletion samplePDF/FarDetectorCoreInfoStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ struct FarDetectorCoreInfo {

~FarDetectorCoreInfo(){ delete [] isNC; }

bool signal; ///< true if signue
int nEvents; ///< how many MC events are there
double ChannelIndex;
std::string flavourName;
Expand Down
1 change: 0 additions & 1 deletion samplePDF/HistogramUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
// ROOT include
#include "TGraphAsymmErrors.h"
#include "TLorentzVector.h"
#include "TObjString.h"
#include "TRandom3.h"
#pragma GCC diagnostic pop
Expand Down
11 changes: 6 additions & 5 deletions samplePDF/samplePDFFDBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ samplePDFFDBase::samplePDFFDBase(std::string ConfigFileName, covarianceXsec* xse
{
MACH3LOG_INFO("-------------------------------------------------------------------");
MACH3LOG_INFO("Creating SamplePDFFDBase object");

//ETA - safety feature so you can't pass a NULL xsec_cov
if(!xsec_cov){
MACH3LOG_ERROR("You've passed me a nullptr to a covarianceXsec... I need this to setup splines!");
Expand Down Expand Up @@ -137,12 +137,12 @@ void samplePDFFDBase::ReadSampleConfig()
std::string splinesuffix = SampleManager->raw()["InputFiles"]["splinesuffix"].as<std::string>();

for (auto const &osc_channel : SampleManager->raw()["SubSamples"]) {
oscchan_flavnames.push_back(osc_channel["name"].as<std::string>());
mc_files.push_back(mtupleprefix+osc_channel["mtuplefile"].as<std::string>()+mtuplesuffix);
spline_files.push_back(splineprefix+osc_channel["splinefile"].as<std::string>()+splinesuffix);
sample_vecno.push_back(osc_channel["samplevecno"].as<int>());
sample_nupdgunosc.push_back(static_cast<NuPDG>(osc_channel["nutype"].as<int>()));
sample_nupdg.push_back(static_cast<NuPDG>(osc_channel["oscnutype"].as<int>()));
sample_signal.push_back(osc_channel["signal"].as<bool>());
}

//Now get selection cuts
Expand Down Expand Up @@ -746,7 +746,7 @@ void samplePDFFDBase::CalcXsecNormsBins(int iSample){
// Not strictly needed, but these events don't get included in oscillated predictions, so
// no need to waste our time calculating and storing information about xsec parameters
// that will never be used.
if (fdobj->isNC[iEvent] && fdobj->signal) {
if (fdobj->isNC[iEvent] && (*fdobj->nupdg[iEvent] != *fdobj->nupdgUnosc[iEvent]) ) {
MACH3LOG_TRACE("Event {}, missed NC/signal check", iEvent);
continue;
} //DB Abstract check on MaCh3Modes to determine which apply to neutral current
Expand Down Expand Up @@ -1332,7 +1332,7 @@ void samplePDFFDBase::SetupNuOscillator() {
MCSamples[iSample].osc_w_pointer[iEvent] = &Unity;
#endif
if (MCSamples[iSample].isNC[iEvent]) {
if (MCSamples[iSample].signal) {
if (*MCSamples[iSample].nupdg[iEvent] != *MCSamples[iSample].nupdgUnosc[iEvent]) {
#ifdef _LOW_MEMORY_STRUCTS_
MCSamples[iSample].osc_w_pointer[iEvent] = &Zero_F;
#else
Expand Down Expand Up @@ -1467,7 +1467,8 @@ void samplePDFFDBase::InitialiseSingleFDMCObject(int iSample, int nEvents_) {
FarDetectorCoreInfo *fdobj = &MCSamples[iSample];

fdobj->nEvents = nEvents_;
fdobj->signal = false;
fdobj->flavourName = oscchan_flavnames[iSample];
fdobj->ChannelIndex = iSample;

int nEvents = fdobj->nEvents;
fdobj->x_var.resize(nEvents, &Unity);
Expand Down
2 changes: 1 addition & 1 deletion samplePDF/samplePDFFDBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ class samplePDFFDBase : public samplePDFBase
void InitialiseSingleFDMCObject(int iSample, int nEvents);
void InitialiseSplineObject();

std::vector<std::string> oscchan_flavnames;
std::vector<std::string> mc_files;
std::vector<std::string> spline_files;
std::vector<int> sample_vecno;
std::vector<int> sample_nupdg;
std::vector<int> sample_nupdgunosc;
std::vector<bool> sample_signal;
};

0 comments on commit cc5d97f

Please sign in to comment.