Skip to content

Commit a3aaf7d

Browse files
Merge pull request #88 from mach3-software/feature_tidy
feat: Improve Readme
2 parents bc136f5 + 1bb237d commit a3aaf7d

4 files changed

Lines changed: 20 additions & 14 deletions

File tree

CIValidations/pValueValidations.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
#include "samplePDF/samplePDFTutorial.h"
44
#include "mcmc/SampleSummary.h"
55

6-
class samplePDFpValue : virtual public samplePDFTutorial
6+
class samplePDFpValue : public samplePDFTutorial
77
{
88
public:
99
samplePDFpValue(std::string mc_version, covarianceXsec* xsec_cov, covarianceOsc* osc_cov)
1010
: samplePDFTutorial(mc_version, xsec_cov, osc_cov),
11-
samplePDFFDBase(mc_version, xsec_cov, osc_cov),
1211
SampleBlarbTitle({
1312
"FGD1_numuCC_0pi_0_protons_no_photon",
1413
"FGD1_numuCC_0pi_N_protons_no_photon",

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,19 @@ To run MCMC simply
5353
./bin/MCMCTutorial TutorialConfigs/FitterConfig.yaml
5454
```
5555
Congratulations! 🎉
56-
You have just completed finished you first MCMC chain.
56+
You have just completed finished you first MCMC chain. You can view `Test.root` for example in TBrowser like in plot below.
57+
58+
<img width="350" alt="Posterior example" src="https://github.com/user-attachments/assets/6d4c97e2-f36b-456e-8e7b-1751f142d2ac">
59+
60+
Single entry in tree represent single MCMC step. Other then debug purposes it is highly recommended to use MaCh3 processing tools.
5761

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

@@ -76,7 +81,7 @@ It is good homework to increase number of steps and see how much more smooth pos
7681
7782
**Warning**: If you modified files in main folder not build you will have to call make install!
7883
79-
Alternatively you can achieve samy way of modifying configs by using command line
84+
Alternatively you can achieve same way of modifying configs by using command line
8085
```bash
8186
./bin/MCMCTutorial TutorialConfigs/FitterConfig.yaml General:MCMC:NSteps:100000
8287
```

samplePDF/samplePDFTutorial.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
#include "samplePDF/samplePDFTutorial.h"
2-
#include <samplePDF/Structs.h>
3-
#include <splines/splineFDBase.h>
1+
#include "splines/splineFDBase.h"
42
#include "StructsTutorial.h"
53
#include "splines/BinnedSplinesTutorial.h"
4+
#include "samplePDF/samplePDFTutorial.h"
5+
#include "splines/splineFDBase.h"
66

77
// ************************************************
88
samplePDFTutorial::samplePDFTutorial(std::string mc_version_, covarianceXsec* xsec_cov_, covarianceOsc* osc_cov_) : samplePDFFDBase(mc_version_, xsec_cov_, osc_cov_) {
99
// ************************************************
10-
1110
KinematicParameters = &KinematicParametersTutorial;
1211
ReversedKinematicParameters = &ReversedKinematicParametersTutorial;
1312

1413
isATM = false;
1514
Initialise();
1615
}
1716

17+
// ************************************************
1818
samplePDFTutorial::~samplePDFTutorial() {
19+
// ************************************************
20+
1921
}
2022

2123
// ************************************************
@@ -36,15 +38,13 @@ void samplePDFTutorial::Init() {
3638
void samplePDFTutorial::SetupSplines() {
3739
// ************************************************
3840
SplineHandler = nullptr;
39-
41+
4042
if(XsecCov->GetNumParamsFromDetID(SampleDetID, SystType::kSpline) > 0){
4143
SplineHandler = std::unique_ptr<splineFDBase>(new BinnedSplineTutorial(XsecCov));
4244
InitialiseSplineObject();
4345
} else {
4446
MACH3LOG_WARN("Not using splines");
4547
}
46-
47-
return;
4848
}
4949
// ************************************************
5050
void samplePDFTutorial::SetupWeightPointers() {
@@ -59,7 +59,9 @@ void samplePDFTutorial::SetupWeightPointers() {
5959
}
6060
}
6161

62+
// ************************************************
6263
int samplePDFTutorial::setupExperimentMC(int iSample) {
64+
// ************************************************
6365

6466
tutorial_base *tutobj = &(TutorialSamples[iSample]);
6567
int nutype = sample_nupdgunosc[iSample];

samplePDF/samplePDFTutorial.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "samplePDF/samplePDFFDBase.h"
55
#include "samplePDF/StructsTutorial.h"
66

7-
class samplePDFTutorial : virtual public samplePDFFDBase
7+
class samplePDFTutorial : public samplePDFFDBase
88
{
99
public:
1010
samplePDFTutorial(std::string mc_version, covarianceXsec* xsec_cov, covarianceOsc* osc_cov = nullptr);
11-
~samplePDFTutorial();
11+
virtual ~samplePDFTutorial();
1212
enum KinematicTypes {kTrueNeutrinoEnergy, kTrueQ2};
1313

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

0 commit comments

Comments
 (0)