Skip to content
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
3 changes: 1 addition & 2 deletions CIValidations/pValueValidations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
#include "samplePDF/samplePDFTutorial.h"
#include "mcmc/SampleSummary.h"

class samplePDFpValue : virtual public samplePDFTutorial
class samplePDFpValue : public samplePDFTutorial
{
public:
samplePDFpValue(std::string mc_version, covarianceXsec* xsec_cov, covarianceOsc* osc_cov)
: samplePDFTutorial(mc_version, xsec_cov, osc_cov),
samplePDFFDBase(mc_version, xsec_cov, osc_cov),
SampleBlarbTitle({
"FGD1_numuCC_0pi_0_protons_no_photon",
"FGD1_numuCC_0pi_N_protons_no_photon",
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ To run MCMC simply
./bin/MCMCTutorial TutorialConfigs/FitterConfig.yaml
```
Congratulations! 🎉
You have just completed finished you first MCMC chain.
You have just completed finished you first MCMC chain. You can view `Test.root` for example in TBrowser like in plot below.

<img width="350" alt="Posterior example" src="https://github.com/user-attachments/assets/6d4c97e2-f36b-456e-8e7b-1751f142d2ac">

Single entry in tree represent single MCMC step. Other then debug purposes it is highly recommended to use MaCh3 processing tools.

### MCMC Chain
Being able to visualise and analyse output of MCMC is standard procedure after chain has finished, you can produce simple plots with
```bash
./bin/ProcessMCMC bin/TutorialDiagConfig.yaml Test.root
```
where **Test.root** is the output of running MCMCTutorial as described [here](#how-to-run-mcmc)
where **Test.root** is the output of running MCMCTutorial as described [here](#how-to-run-mcmc).
You can find results in **Test_drawCorr.pdf**
One of plots you will encounter is:
<img width="350" alt="Posterior example" src="https://github.com/user-attachments/assets/1073a76e-5d82-4321-8952-e098d1b0717f">

Expand All @@ -76,7 +81,7 @@ It is good homework to increase number of steps and see how much more smooth pos

**Warning**: If you modified files in main folder not build you will have to call make install!

Alternatively you can achieve samy way of modifying configs by using command line
Alternatively you can achieve same way of modifying configs by using command line
```bash
./bin/MCMCTutorial TutorialConfigs/FitterConfig.yaml General:MCMC:NSteps:100000
```
Expand Down
16 changes: 9 additions & 7 deletions samplePDF/samplePDFTutorial.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
#include "samplePDF/samplePDFTutorial.h"
#include <samplePDF/Structs.h>
#include <splines/splineFDBase.h>
#include "splines/splineFDBase.h"
#include "StructsTutorial.h"
#include "splines/BinnedSplinesTutorial.h"
#include "samplePDF/samplePDFTutorial.h"
#include "splines/splineFDBase.h"

// ************************************************
samplePDFTutorial::samplePDFTutorial(std::string mc_version_, covarianceXsec* xsec_cov_, covarianceOsc* osc_cov_) : samplePDFFDBase(mc_version_, xsec_cov_, osc_cov_) {
// ************************************************

KinematicParameters = &KinematicParametersTutorial;
ReversedKinematicParameters = &ReversedKinematicParametersTutorial;

isATM = false;
Initialise();
}

// ************************************************
samplePDFTutorial::~samplePDFTutorial() {
// ************************************************

}

// ************************************************
Expand All @@ -36,15 +38,13 @@ void samplePDFTutorial::Init() {
void samplePDFTutorial::SetupSplines() {
// ************************************************
SplineHandler = nullptr;

if(XsecCov->GetNumParamsFromDetID(SampleDetID, SystType::kSpline) > 0){
SplineHandler = std::unique_ptr<splineFDBase>(new BinnedSplineTutorial(XsecCov));
InitialiseSplineObject();
} else {
MACH3LOG_WARN("Not using splines");
}

return;
}
// ************************************************
void samplePDFTutorial::SetupWeightPointers() {
Expand All @@ -59,7 +59,9 @@ void samplePDFTutorial::SetupWeightPointers() {
}
}

// ************************************************
int samplePDFTutorial::setupExperimentMC(int iSample) {
// ************************************************

tutorial_base *tutobj = &(TutorialSamples[iSample]);
int nutype = sample_nupdgunosc[iSample];
Expand Down
4 changes: 2 additions & 2 deletions samplePDF/samplePDFTutorial.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#include "samplePDF/samplePDFFDBase.h"
#include "samplePDF/StructsTutorial.h"

class samplePDFTutorial : virtual public samplePDFFDBase
class samplePDFTutorial : public samplePDFFDBase
{
public:
samplePDFTutorial(std::string mc_version, covarianceXsec* xsec_cov, covarianceOsc* osc_cov = nullptr);
~samplePDFTutorial();
virtual ~samplePDFTutorial();
enum KinematicTypes {kTrueNeutrinoEnergy, kTrueQ2};

std::vector<double> ReturnKinematicParameterBinning(std::string KinematicParameter) override;
Expand Down