|
close
Warning:
Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.
- Timestamp:
-
Jan 5, 2017, 4:35:42 PM (8 years ago)
- Author:
-
Clarence Wret
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v21
|
v22
|
|
6 | 6 | |
7 | 7 | For this tutorial I'll be adding the T2K CC1pi+ H,,2,,O data. The data comes from the [http://t2k-experiment.org/results/nd280data-numu-cc1pi-xs-on-h2o-2015/ T2K site] and [https://arxiv.org/abs/1605.07964 arxiv]. The data is supplied both in a ROOT file and a number of .csv files: I'll be using the ROOT file here. |
| 8 | |
| 9 | After this we'll be able to make data/MC comparisons to the T2K CC1pi+ H,,2,,O data-set for NEUT, GENIE, GiBUU and NuWro; all in the same framework. We'll get MC predictions, chi2 values, interaction mode contributions, and more using a consistent signal definition, guaranteed the same across the generators. |
8 | 10 | |
9 | 11 | {{{ |
… |
… |
|
27 | 29 | |
28 | 30 | |
29 | | === Choosing a distribution === |
| 31 | === Choosing a cross-section distribution === |
30 | 32 | |
31 | 33 | The T2K CC1pi+ H,,2,,O data release contains various distributions in FIG 4. In this tutorial I'll look at adding one kinematic distribution and one derived distribution: p,,mu,, and E^rec^,,nu,, shown below. |
… |
… |
|
40 | 42 | NUISANCE is designed to easily allow adding new samples. |
41 | 43 | |
42 | | Each experimental measurement is its own class. To simplify including new samples we supply a base class for 1D (`Measurement1D`) and 2D (`Measurement2D`) measurements, which in turn inherits from the virtual base class (`MeasurementBase`). |
43 | | |
44 | | These `MeasurementBase` classes are then looped over in the executables and data/MC comparisons are the result. |
| 44 | [=#point_base] |
| 45 | Each experimental measurement is its own class. To simplify including new samples we supply a base class for 1D (`Measurement1D`) and 2D (`Measurement2D`) measurements, which in turn inherits from the virtual base class (`MeasurementBase`). |
| 46 | |
| 47 | These `MeasurementBase` classes are then looped over in the executables and data/MC comparisons are the result. A class has to at least inherit from `MeasurementBase` and implement the necessary methods to be "looped over". The recommended method is to use and expand the supplied `Measurement1D` and `Measurement2D` classes; anything else may require expert knowledge and won't be covered here. |
45 | 48 | |
46 | 49 | The inheritance tree is simple and goes `Specific_Measurement -> MeasurementXD -> MeasurementBase` |
… |
… |
|
50 | 53 | |
51 | 54 | Some automatic processing is done on loading up the samples to set up generator scaling factors, chi2 calculations and so on. These are simple string comparisons done in the base class constructors, but do '''place responsibility on the user'''. |
| 55 | |
52 | 56 | |
53 | 57 | The structure is `Experiment_Measurement_Target_DataType_DimensionVar_Neutrino`: |
… |
… |
|
101 | 105 | Now that we have the rough structure set-up, we can finally start writing some code! :) |
102 | 106 | |
103 | | In the case of our T2K CC1pi+ H,,2,,O data, we're dealing with 1D distributions. They should therefore inherit from the `Measurement1D` class. |
104 | | |
105 | | Starting at the header we do |
| 107 | In the case of our T2K CC1pi+ H,,2,,O data, we're dealing with 1D distributions. They should therefore inherit from the `Measurement1D` class, as mentioned [#point_base earlier]. |
| 108 | |
| 109 | We will also require a `constructor` and `destructor` for the class, and we'll need to overload `MeasurementBase` methods which define the dependent variable(s) (p,,mu,, in our case) and what our signal is (CC interaction with one muon and one positive pion with no other pions or mesons and any number of nucleons in our case). |
| 110 | |
| 111 | The `MeasurementBase` functions which we need to overload are `isSignal(FitEvent *event)` and `FillEventVariables(FitEvent *event)`. The `FitEvent` class is an object which contains information about one single event: all the particles, their kinematics and their status after the interaction, the interaction channel which produced the final state, possible secondary interactions, the interaction target, and so on. |
| 112 | |
| 113 | The `FitEvent` class is implemented in `src/FitBase/FitEvent.cxx` and essentially the native format which NUISANCE uses. |
| 114 | |
| 115 | The signal is defined in the |
106 | 116 | |
107 | 117 | {{{ |
… |
… |
|
110 | 120 | |
111 | 121 | #include "Measurement1D.h" |
112 | | |
113 | | class T2K_CC1pip_H2O_XSec_1Dpmu_nu : public Measurement1D |
114 | | #endif |
115 | | }}} |
116 | | |
117 | | to set up the inheritance. The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
118 | | |
| 122 | #include "T2K_SignalDef.h" |
| 123 | |
| 124 | class T2K_CC1pip_H2O_XSec_1Dpmu_nu : public Measurement1D { |
| 125 | public: |
| 126 | T2K_CC1pip_H2O_XSec_1Dpmu_nu(std::string inputfile, FitWeight *rw, std::string type, std::string fakeDataFile); |
| 127 | virtual ~T2K_CC1pip_H2O_XSec_1Dpmu_nu() {}; |
| 128 | |
| 129 | void FillEventVariables(FitEvent *event); |
| 130 | bool isSignal(FitEvent *event); |
| 131 | |
| 132 | private: |
| 133 | }; |
| 134 | |
| 135 | #endif |
| 136 | }}} |
| 137 | |
| 138 | The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
119 | 139 | |
120 | 140 | === Making the constructor === |
… |
… |
|
184 | 204 | |
185 | 205 | `T2K_CC1pip_H2O_XSec_1Dpmu_nu.h`: |
186 | | |
| 206 | {{{ |
187 | 207 | #ifndef T2K_CC1PIP_H2O_XSEC_1DPMU_NU_H_SEEN |
188 | 208 | #define T2K_CC1PIP_H2O_XSEC_1DPMU_NU_H_SEEN |
… |
… |
|
203 | 223 | |
204 | 224 | #endif |
205 | | |
| 225 | }}} |
206 | 226 | |
207 | 227 | === Make NUISANCE aware of the sample === |
|