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

breaking: New DetId treatment #71

Merged
merged 4 commits into from
Jan 24, 2025
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
4 changes: 2 additions & 2 deletions CIValidations/CovarianceValidations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ int main(int argc, char *argv[])
xsec->setParameters(ParProp);
xsec->acceptStep();
///// Test Params from DetId /////
const std::vector<int> Det_Id = {1, 984, 985};
for (int id = 0; id < kSystTypes; ++id)
const std::vector<std::string> Det_Id = {"Tutorial Beam", "Tutorial ATM", "tutorial beam", "blarb" "ATM"};
for (size_t id = 0; id < Det_Id.size(); ++id)
{
for (int s = 0; s < kSystTypes; ++s)
{
Expand Down
28 changes: 16 additions & 12 deletions CIValidations/TestOutputs/CovarianceOut.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
Likelihood Xsec=0.351154
Found 3 for 1 Params of type Norm
Found 5 for 1 Params of type Spline
Found 4 for 1 Params of type Functional
Found 3 for 1 From GetNormParsFromDetID
Found 3 for 984 Params of type Norm
Found 5 for 984 Params of type Spline
Found 4 for 984 Params of type Functional
Found 3 for 984 From GetNormParsFromDetID
Found 3 for 985 Params of type Norm
Found 5 for 985 Params of type Spline
Found 4 for 985 Params of type Functional
Found 3 for 985 From GetNormParsFromDetID
Found 3 for Tutorial Beam Params of type Norm
Found 5 for Tutorial Beam Params of type Spline
Found 4 for Tutorial Beam Params of type Functional
Found 3 for Tutorial Beam From GetNormParsFromDetID
Found 3 for Tutorial ATM Params of type Norm
Found 5 for Tutorial ATM Params of type Spline
Found 4 for Tutorial ATM Params of type Functional
Found 3 for Tutorial ATM From GetNormParsFromDetID
Found 3 for tutorial beam Params of type Norm
Found 5 for tutorial beam Params of type Spline
Found 4 for tutorial beam Params of type Functional
Found 3 for tutorial beam From GetNormParsFromDetID
Found 0 for blarbATM Params of type Norm
Found 0 for blarbATM Params of type Spline
Found 0 for blarbATM Params of type Functional
Found 0 for blarbATM From GetNormParsFromDetID
Inv Cov Matrix for 0 and 0 is equal to=82.6446
Inv Cov Matrix for 0 and 1 is equal to=-0
Inv Cov Matrix for 0 and 2 is equal to=-0
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON)
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)

# Create project
project(MaCh3Tutorial VERSION 1.3.4 LANGUAGES CXX)
project(MaCh3Tutorial VERSION 1.4.0 LANGUAGES CXX)
set(MaCh3Tutorial_VERSION ${PROJECT_VERSION})

set(CMAKE_CXX_STANDARD_REQUIRED True)
Expand Down Expand Up @@ -63,7 +63,7 @@ if(NOT DEFINED MaCh3_Branch)
endif()

#If MaCh3 was sourced find it, otherwise use CPM
#find_package(MaCh3 QUIET EXACT MaCh3Tutorial_VERSION)
#find_package(MaCh3 QUIET EXACT ${MaCh3Tutorial_VERSION})

if(NOT MaCh3_FOUND)
set(MaCh3_OPTIONS
Expand Down
18 changes: 9 additions & 9 deletions Inputs/Osc_Test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Systematics:
FancyName: sin2th_12
ParameterName: sin2th_12

DetID: 984
DetID: ["Tutorial *"]
Error: 0.0129961532770277840
FlatPrior: false
ParameterBounds: [0, 1]
Expand All @@ -24,7 +24,7 @@ Systematics:
FancyName: sin2th_23
ParameterName: sin2th_23

DetID: 984
DetID: ["Tutorial *"]
Error: 0.021
FlatPrior: true
ParameterBounds: [0, 1]
Expand All @@ -41,7 +41,7 @@ Systematics:
FancyName: sin2th_13
ParameterName: sin2th_13

DetID: 984
DetID: ["Tutorial *"]
Error: 0.0007
FlatPrior: true
ParameterBounds: [0, 1]
Expand All @@ -58,7 +58,7 @@ Systematics:
FancyName: delm2_12
ParameterName: delm2_12

DetID: 984
DetID: ["Tutorial *"]
Error: 0.0000018
FlatPrior: false
ParameterBounds: [-999, 999]
Expand All @@ -75,7 +75,7 @@ Systematics:
FancyName: delm2_23
ParameterName: delm2_23

DetID: 984
DetID: ["Tutorial *"]
Error: 0.000034
FlatPrior: true
ParameterBounds: [-999, 999]
Expand All @@ -92,7 +92,7 @@ Systematics:
FancyName: delta_cp
ParameterName: delta_cp

DetID: 984
DetID: ["Tutorial *"]
Error: 6.28331122896200340
FlatPrior: true
# It has special treatment as it is continuous param
Expand All @@ -110,7 +110,7 @@ Systematics:
FancyName: baseline
ParameterName: baseline

DetID: 984
DetID: ["Tutorial Beam"]
Error: 1.0
FlatPrior: true
ParameterBounds: [0, 999]
Expand All @@ -127,7 +127,7 @@ Systematics:
FancyName: density
ParameterName: density

DetID: 984
DetID: ["Tutorial Beam"]
Error: 0.01
FlatPrior: true
ParameterBounds: [0, 999]
Expand All @@ -144,7 +144,7 @@ Systematics:
FancyName: Ye
ParameterName: Ye

DetID: 984
DetID: ["Tutorial Beam"]
Error: 0.001
FlatPrior: true
ParameterBounds: [0, 999]
Expand Down
20 changes: 10 additions & 10 deletions Inputs/PCATest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Systematics:
- b_7: '0.48619159418126073'
- b_8: '0.49407392294957464'
- b_9: '0.27270216972314404'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.059243759525005685'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -48,7 +48,7 @@ Systematics:
- b_7: '0.6363766022443161'
- b_8: '0.6436654970393295'
- b_9: '0.37257173123032966'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.052534917752228155'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -79,7 +79,7 @@ Systematics:
- b_7: '0.6361099941519401'
- b_8: '0.7111552414980179'
- b_9: '0.3809408100022248'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.05293373520097801'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -110,7 +110,7 @@ Systematics:
- b_7: '0.620095554502362'
- b_8: '0.7780068069310814'
- b_9: '0.3976387942751631'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.05145497551998185'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -141,7 +141,7 @@ Systematics:
- b_7: '0.5169026277364072'
- b_8: '0.6804627678149072'
- b_9: '0.4301371250858676'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.07381951635860204'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -172,7 +172,7 @@ Systematics:
- b_7: '0.5535800561827778'
- b_8: '0.5054211016174668'
- b_9: '0.40696262517009857'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.0875849864515004'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -203,7 +203,7 @@ Systematics:
- b_7: '0.7790841764941654'
- b_8: '0.5630092548705312'
- b_9: '0.6009864264160337'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.06983573708919912'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -234,7 +234,7 @@ Systematics:
- b_7: '1.0'
- b_8: '0.8494242119047807'
- b_9: '0.684018671339497'
DetID: '1'
DetID: ["Tutorial *"]
Error: '0.04979912201292179'
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -264,7 +264,7 @@ Systematics:
- b_7: '0.8494242119047807'
- b_8: '1.0'
- b_9: '0.7440340603749211'
DetID: '1'
DetID: ["Tutorial *"]
Error: 0.05020509536942895
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down Expand Up @@ -294,7 +294,7 @@ Systematics:
- b_7: '0.684018671339497'
- b_8: '0.7440340603749211'
- b_9: '1.0'
DetID: '1'
DetID: ["Tutorial *"]
Error: 0.07016589681893176
KinematicCuts:
- HornCurrent: [0.5, 1.5]
Expand Down
2 changes: 1 addition & 1 deletion Inputs/SamplePDF_Tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ InputFiles:
# No Splines
splineprefix: "Inputs/MC/BinnedSplinesTutorialInputs"
splinesuffix: "2D.root"
DetID: 1
DetID: "Tutorial Beam"
NuOsc:
NuOscConfigFile: "Inputs/NuOscillator/NuFASTLinear.yaml"

Expand Down
24 changes: 12 additions & 12 deletions Inputs/SystematicModel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Systematics:
ParameterValues:
Generated: 1.
PreFitValue: 1.
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Norm
Expand All @@ -35,7 +35,7 @@ Systematics:
ParameterValues:
Generated: 1.
PreFitValue: 1.
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Norm
Expand All @@ -57,7 +57,7 @@ Systematics:
ParameterValues:
Generated: 1.
PreFitValue: 1.
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Norm
Expand All @@ -78,7 +78,7 @@ Systematics:
Mode: [0]
InterpolationType: TSpline3
SplineName: mysyst1
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Spline
Expand All @@ -99,7 +99,7 @@ Systematics:
Mode: [2]
InterpolationType: Linear
SplineName: mysyst2
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Spline
Expand All @@ -120,7 +120,7 @@ Systematics:
Mode: [1]
InterpolationType: Monotonic
SplineName: mysyst3
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Spline
Expand All @@ -141,7 +141,7 @@ Systematics:
Mode: [9]
InterpolationType: Akima
SplineName: mysyst4
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Spline
Expand All @@ -162,7 +162,7 @@ Systematics:
Mode: [0]
InterpolationType: Linear
SplineName: mysyst5
DetID: 985
DetID: ["Tutorial *"]
StepScale:
MCMC: 0.2
Type: Spline
Expand All @@ -184,7 +184,7 @@ Systematics:
- Func_Param_3: 0.653
StepScale:
MCMC: 0.2
DetID: 985
DetID: ["Tutorial *"]
Type: Functional

- Systematic:
Expand All @@ -205,7 +205,7 @@ Systematics:
- Func_Param_3: 0.778
StepScale:
MCMC: 0.2
DetID: 985
DetID: ["Tutorial *"]
Type: Functional

- Systematic:
Expand All @@ -226,7 +226,7 @@ Systematics:
- Func_Param_3: 0.870
StepScale:
MCMC: 0.2
DetID: 985
DetID: ["Tutorial *"]
Type: Functional

- Systematic:
Expand All @@ -247,5 +247,5 @@ Systematics:
- Func_Param_1: 0.778
StepScale:
MCMC: 0.2
DetID: 985
DetID: ["Tutorial *"]
Type: Functional
2 changes: 0 additions & 2 deletions samplePDF/samplePDFTutorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ void samplePDFTutorial::setupFDMC(int iSample) {
tutorial_base *tutobj = &(TutorialSamples[iSample]);
auto &fdobj = MCSamples[iSample];

fdobj.SampleDetID = SampleDetID;

for(int iEvent = 0 ;iEvent < fdobj.nEvents ; ++iEvent) {
fdobj.rw_etru[iEvent] = &(tutobj->TrueEnu[iEvent]);
fdobj.mode[iEvent] = &(tutobj->Mode[iEvent]);
Expand Down
Loading