Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random #194

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ try
/// @details anything longer than ~80 should go in a details
void Foo(){}
```
After making release or tag please
```bash
cd Doc
doxygen Doxyfile
```
to produce both html and latex file. To produce book like pdf file:
```bash
cd latex
pdflatex refman.tex
You can
```cpp
/// @param blarb this is parameter needed for function
/// @return returning some fancy number
int Fool(int blarb){}
```
Doxygen documentation will be updated after each commit to develop.

## Logger
MaCh3 is using spdlog logger see [here](https://github.com/gabime/spdlog/tree/master). And wraps it around MaCh3 names [here](https://github.com/mach3-software/MaCh3/blob/develop/manager/MaCh3Logger.h)
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/CIValidations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,10 @@ jobs:
fail-fast: false # Prevents cancellation of remaining jobs if one fails
matrix:
include:
- name: Spline Validations
- name: Reweight Validations
test_1: ./CIValidations/SplineValidations
test_2: ./CIValidations/SamplePDFValidations
test_3: empty
test_4: empty
test_5: empty
test_6: empty
test_7: empty

- name: Oscillation Validations
test_1: ./CIValidations/NuOscillatorInterfaceValidations
test_2: empty
test_3: empty
test_3: ./CIValidations/NuOscillatorInterfaceValidations
test_4: empty
test_5: empty
test_6: empty
Expand All @@ -42,7 +33,7 @@ jobs:
- name: Covariance Validations
test_1: ./CIValidations/CovarianceValidations
test_2: ./CIValidations/MaCh3ModeValidations
test_3: empty
test_3: ./CIValidations/UnitTests/manager_tests
test_4: empty
test_5: empty
test_6: empty
Expand Down Expand Up @@ -84,7 +75,7 @@ jobs:
cd MaCh3Validations
mkdir build
cd build
cmake ../ -DMaCh3_Branch=${{ github.head_ref }}
cmake ../ -DMaCh3_Branch=${{ github.head_ref }} -DMaCh3Tutorial_UNITTESTS_ENABLED=TRUE

- name: Build MaCh3 Validations
run: |
Expand Down
8 changes: 6 additions & 2 deletions cmake/Modules/MaCh3Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ endif()

cmessage(STATUS "ROOT_CXX_FLAGS: \"${ROOT_CXX_FLAGS}\" -> ROOT_CXX_STANDARD: ${ROOT_CXX_STANDARD}")

execute_process (COMMAND root-config --features
execute_process(COMMAND root-config --features
OUTPUT_VARIABLE ROOT_CONFIG_FEATURES OUTPUT_STRIP_TRAILING_WHITESPACE)
list (FIND ROOT_CONFIG_FEATURES "minuit2" ROOT_CONFIG_MINUIT2)
string(REPLACE " " ";" ROOT_FEATURES_LIST "${ROOT_CONFIG_FEATURES}")
# Check if "minuit2" is in the list of ROOT features
list(FIND ROOT_FEATURES_LIST "minuit2" ROOT_CONFIG_MINUIT2)

# KS: Since ROOT 6.32.0 Minuit is turned on by default
set(MaCh3_MINUIT2_ENABLED FALSE)
Expand All @@ -56,6 +58,7 @@ CPMAddPackage(
VERSION ${YAML_CPP_VERSION}
GITHUB_REPOSITORY "jbeder/yaml-cpp"
GIT_TAG "${YAML_CPP_VERSION}"
GIT_SHALLOW YES
OPTIONS
"YAML_CPP_INSTALL ON"
"YAML_CPP_BUILD_TESTS OFF"
Expand Down Expand Up @@ -100,6 +103,7 @@ if( MaCh3_PYTHON_ENABLED )
NAME pybind11
VERSION 2.13.5
GITHUB_REPOSITORY "pybind/pybind11"
GIT_SHALLOW YES
GIT_TAG v2.13.5
)
endif()
1 change: 1 addition & 0 deletions cmake/Modules/NuOscillatorSetup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ CPMAddPackage(
VERSION 1.0.1
GITHUB_REPOSITORY "dbarrow257/NuOscillator"
GIT_TAG "v1.0.1"
GIT_SHALLOW YES
OPTIONS
"UseGPU ${DAN_USE_GPU}"
"UseMultithreading ${DAN_USE_MULTITHREAD}"
Expand Down
22 changes: 13 additions & 9 deletions samplePDF/samplePDFFDBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,29 +455,30 @@ void samplePDFFDBase::fillArray() {

//DB - First, check to see if the event is still in the nominal bin
if (XVar < MCSamples[iSample].rw_upper_xbinedge[iEvent] && XVar >= MCSamples[iSample].rw_lower_xbinedge[iEvent]) {
XBinToFill = MCSamples[iSample].NomXBin[iEvent];
XBinToFill = MCSamples[iSample].NomXBin[iEvent];
}
//DB - Second, check to see if the event is outside of the binning range and skip event if it is
//ETA- note that nXBins is XBinEdges.size() - 1
else if (XVar < XBinEdges[0] || XVar >= XBinEdges[nXBins]) {
continue;
continue;
}
//DB - Thirdly, check the adjacent bins first as Eb+CC+EScale shifts aren't likely to move an Erec more than 1bin width
//Shifted down one bin from the event bin at nominal
else if (XVar < MCSamples[iSample].rw_lower_xbinedge[iEvent] && XVar >= MCSamples[iSample].rw_lower_lower_xbinedge[iEvent]) {
XBinToFill = MCSamples[iSample].NomXBin[iEvent]-1;
XBinToFill = MCSamples[iSample].NomXBin[iEvent]-1;
}
//Shifted up one bin from the event bin at nominal
else if (XVar < MCSamples[iSample].rw_upper_upper_xbinedge[iEvent] && XVar >= MCSamples[iSample].rw_upper_xbinedge[iEvent]) {
XBinToFill = MCSamples[iSample].NomXBin[iEvent]+1;
XBinToFill = MCSamples[iSample].NomXBin[iEvent]+1;
}
//DB - If we end up in this loop, the event has been shifted outside of its nominal bin, but is still within the allowed binning range
else {
for (unsigned int iBin=0;iBin<(XBinEdges.size()-1);iBin++) {
if (XVar >= XBinEdges[iBin] && XVar < XBinEdges[iBin+1]) {
XBinToFill = iBin;
}
}
for (unsigned int iBin=0;iBin<(XBinEdges.size()-1);iBin++)
{
if (XVar >= XBinEdges[iBin] && XVar < XBinEdges[iBin+1]) {
XBinToFill = iBin;
}
}
}

//DB Fill relevant part of thread array
Expand Down Expand Up @@ -1429,6 +1430,9 @@ void samplePDFFDBase::SetupNuOscillator() {

double samplePDFFDBase::GetEventWeight(int iSample, int iEntry) {
double totalweight = 1.0;
#ifdef MULTITHREAD
#pragma omp simd
#endif
for (int iParam=0;iParam<MCSamples[iSample].ntotal_weight_pointers[iEntry];iParam++) {
totalweight *= *(MCSamples[iSample].total_weight_pointers[iEntry][iParam]);
}
Expand Down
Loading