|
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 6, 2017, 5:46:48 PM (8 years ago)
- Author:
-
Clarence Wret
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v67
|
v68
|
|
9 | 9 | NUISANCE is currently fully written in '''C++03''' and we would appreciate future contributions to adhere to this standard. |
10 | 10 | |
11 | | '''If you've been using this guide we'd appreciate [mailto:nuisance@projects.hepforge.org feedback].''', thanks. |
| 11 | '''If you've been using this guide we'd much appreciate [mailto:nuisance@projects.hepforge.org feedback]''', thank you. |
12 | 12 | |
13 | 13 | {{{ |
… |
… |
|
26 | 26 | == Finding the neutrino flux and generating events == |
27 | 27 | |
28 | | The first issue at hand is to find the flux for the experiment. If we don't have this, we cant make a generator prediction---unless the measurement is a total cross-section without any phase space cuts (in which case you should probably cast a suspicious eye). |
| 28 | The first issue at hand is to find the flux for the experiment. If we don't have this, we cant make a generator prediction--unless the measurement is a total cross-section without any phase space cuts (in which case you should probably cast a suspicious eye). |
29 | 29 | |
30 | 30 | A quick search through the arxiv document points us to reference ![12]. It is also in our [wiki:ExperimentFlux flux list]. |
31 | 31 | |
32 | | I then generate events in NEUT 5.3.6 with a suitable card-file, see our [wiki:HowToNeut NEUT guide] on how to do this. The procedure is very similar for other generators too. '''We need the correct target (water) and flux, and perform the model selections we want (e.g. Rein-Sehgal or Berger-Sehgal coherent model).''' |
33 | | |
34 | | '''Aim to generate around 1M events with all interaction modes turned on.''' This way we make sure to get all interaction modes into the topologically defined cross-section. We get a small amount of CCQE events which excite a pion from the outgoing nucleon interacting in the nucleus to kick out a pion, leading to a CCQE+1π^+^ ~ CC1π^+^ final state, which is signal for this particular sample. |
| 32 | I then generate events in NEUT 5.3.6 with a suitable card-file, see our [wiki:HowToNeut NEUT guide] on how to do this. The procedure is very similar for other generators too. We need the '''correct target (water)''' and '''flux''', and perform the '''model selections''' we want (e.g. Rein-Sehgal or Berger-Sehgal coherent model).''' |
| 33 | |
| 34 | '''Aim to generate around 1M events with all interaction modes turned on.''' This way we make sure to get all interaction modes into the topologically defined cross-section. We get a small amount of CCQE events which excite a pion from the outgoing nucleon interacting in the nucleus to kick out a pion, leading to a CCQE+1π^+^ ~ CC1π^+^ final state, which is classified signal for this particular sample. |
35 | 35 | |
36 | 36 | |
37 | 37 | == Choosing a cross-section distribution == |
38 | 38 | |
39 | | The T2K CC1π^+^ 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,,µ,, and E^rec^,,ν,, shown below. |
| 39 | The T2K CC1π^+^ 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,,µ,, and E^rec^,,ν,,, shown below. |
40 | 40 | |
41 | 41 | [[Image(T2K_CC1pip_H2O_pmu.png, 300px)]][[Image(T2K_CC1pip_H2O_enurec.png, 300px)]] |
42 | 42 | |
43 | | In NUISANCE we try to add all available distributions from a publication. '''However''', some distributions will have detector effects "folded" into them (i.e. they will be raw detector-level data). We can only use these if there is some method which bring detector-level variables (e.g. p,,µ,, seen in the detector) to truth-level variable (e.g. p,,µ,, seen after correcting for the detector effects). |
| 43 | In NUISANCE we try to add all available distributions from a publication. '''However''', some distributions will have '''detector effects''' "folded" into them (i.e. they will be raw detector-level data). We can only use these if there is some method which bring detector-level variables (e.g. p,,µ,, seen in the detector) to truth-level variable (e.g. p,,µ,, seen after correcting for the detector effects). |
44 | 44 | |
45 | 45 | |
… |
… |
|
51 | 51 | 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`). |
52 | 52 | |
53 | | 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. |
| 53 | These `MeasurementBase` classes are looped over from the executables and data/MC comparisons are the result, calling functions like `MeasurementBase::Reconfigure`, `MeasurementBase::FillEventVariables`, `MeasurementBase::isSignal` and `MeasurementBase::GetLikelihood`. |
| 54 | |
| 55 | 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. |
54 | 56 | |
55 | 57 | The inheritance tree is simple and goes `Specific_Measurement -> MeasurementXD -> MeasurementBase` |
| 58 | |
56 | 59 | |
57 | 60 | [=#point_naming] |
58 | 61 | == Naming the sample == |
59 | 62 | |
60 | | 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'''. |
| 63 | Some automatic processing is done on loading up the samples to set up generator scaling factors, χ^2^ calculations and so on. These are simple string comparisons done in the base class constructors, but do '''place responsibility on the user'''. |
61 | 64 | |
62 | 65 | |
… |
… |
|
75 | 78 | '''What to do:''' |
76 | 79 | |
77 | | Following the above convention, we end up with '''`T2K_CC1pip_H2O_XSec_1Dpmu_nu`''': there is no ambiguity what the class describes and there is no way of confusing it with other classes in NUISANCE. |
| 80 | Following the above convention, we end up with '''`T2K_CC1pip_H2O_XSec_1Dpmu_nu`'''. |
| 81 | |
| 82 | This is a sufficient name: there is no ambiguity what the class describes and there is no way of confusing it with other classes in NUISANCE. |
78 | 83 | |
79 | 84 | |
… |
… |
|
100 | 105 | Furthermore, we specify another directory for the measurement topology to avoid confusion, e.g. `data/T2K/CC1pip` for our sample. |
101 | 106 | |
102 | | In some cases we might have the same topology defining the cross-section but for different targets. In this case we add another sub-directory for the target, e.g. `data/T2K/CC1pip/H2O`. |
| 107 | In some cases we might have the same topology defining the cross-section but for a different interaction target. In this case we add another sub-directory for the target, e.g. `data/T2K/CC1pip/H2O` for us. |
103 | 108 | |
104 | 109 | |
… |
… |
|
110 | 115 | {{{ |
111 | 116 | #!html |
112 | | <hr width="100%" size="4"> |
| 117 | <hr width="100%" size="10"> |
113 | 118 | }}} |
114 | 119 | = Coding up a sample = |
115 | 120 | |
116 | | Now that we have the rough structure set-up, we can finally start writing some code. |
| 121 | Now that we have the rough structure set-up, we can start writing some code. |
117 | 122 | |
118 | 123 | [=#point_header] |
119 | 124 | == Writing the header == |
120 | 125 | |
121 | | In the case of our T2K CC1π^+^ H,,2,,O data, we're dealing with 1D distributions. They should therefore inherit from the `Measurement1D` base class, as mentioned [#point_base earlier]. The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
122 | | |
123 | | NUISANCE requires a `constructor` and `destructor` for the class, and we'll need to overload `MeasurementBase` methods which define the dependent variable(s) (p,,µ,, 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). The `MeasurementBase` functions which we need to overload are `MeasurementBase::isSignal(FitEvent *event)` and `MeasurementBase::FillEventVariables(FitEvent *event)`. |
124 | | |
125 | | 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. The `FitEvent` class is implemented in `src/FitBase/FitEvent.cxx` and essentially the generator-independent common event format which NUISANCE uses for the generator events. |
| 126 | The T2K CC1π^+^ H,,2,,O data is all 1D distributions. The new classes should therefore inherit from the `Measurement1D` base class, as mentioned [#point_base earlier]. The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
| 127 | |
| 128 | NUISANCE requires a `constructor` and `destructor` for the class, and we'll need to overload `MeasurementBase` methods which define the dependent variable(s) (p,,µ,, and E^rec^,,ν,, 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). The `MeasurementBase` functions which we need to overload are `MeasurementBase::isSignal(FitEvent *event)` and `MeasurementBase::FillEventVariables(FitEvent *event)`. |
| 129 | |
| 130 | The `FitEvent` class is an object which contains information about one single event: all the particles, their kinematics and their status before and after the interaction, the interaction channel(s) which produced the final state particles, possible secondary interactions, the interaction target, and so on. The `FitEvent` class is implemented in `src/FitBase/FitEvent.cxx` and is the generator-independent "common event format" which NUISANCE uses for the generator events. |
126 | 131 | |
127 | 132 | [=#point_signal] |
|