Skip to content

Commit edc49a5

Browse files
Merge pull request #375 from mach3-software/dbarrow257/bugfix/GetEventSplineFix
bugfix: Correctly handle duplicate modes in GetEventSplines
2 parents 1c9c88d + 12152a7 commit edc49a5

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
33
# CMake version check
44
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
55

6-
project(MaCh3 VERSION 1.4.5 LANGUAGES CXX)
6+
project(MaCh3 VERSION 1.4.7 LANGUAGES CXX)
77
set(MaCh3_VERSION ${PROJECT_VERSION})
88

99
option(MaCh3_PYTHON_ENABLED "Whether to build MaCh3 python bindings" OFF)

splines/splineFDBase.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,19 @@ std::vector< std::vector<int> > splineFDBase::GetEventSplines(std::string Sample
769769
}
770770

771771
int nSplineSysts = static_cast<int>(indexvec[SampleIndex][iOscChan].size());
772-
//ETA- this is already a MaCh3 mode
773-
int Mode = EventMode;
772+
773+
774+
int Mode = -1;
775+
std::string SuffixForEventMode = Modes->GetSplineSuffixFromMaCh3Mode(EventMode);
776+
for (int iMode=0;iMode<Modes->GetNModes();iMode++) {
777+
if (SuffixForEventMode == Modes->GetSplineSuffixFromMaCh3Mode(iMode)) {
778+
Mode = iMode;
779+
break;
780+
}
781+
}
782+
if (Mode == -1) {
783+
return ReturnVec;
784+
}
774785

775786
int Var1Bin = SplineBinning[SampleIndex][iOscChan][0]->FindBin(Var1Val)-1;
776787
if (Var1Bin < 0 || Var1Bin >= SplineBinning[SampleIndex][iOscChan][0]->GetNbins()) {

0 commit comments

Comments
 (0)