|
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:39:05 PM (8 years ago)
- Author:
-
Clarence Wret
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v22
|
v23
|
|
38 | 38 | |
39 | 39 | |
40 | | == Implementing a sample == |
| 40 | == Preparing structure for a sample == |
41 | 41 | |
42 | 42 | NUISANCE is designed to easily allow adding new samples. |
… |
… |
|
101 | 101 | |
102 | 102 | |
| 103 | == Coding up a sample == |
| 104 | |
| 105 | Now that we have the rough structure set-up, we can finally start writing some code! :) |
| 106 | |
| 107 | |
103 | 108 | === Setting up the inheritance === |
104 | 109 | |
105 | | Now that we have the rough structure set-up, we can finally start writing some code! :) |
106 | | |
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 |
| 110 | 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]. The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
| 111 | |
| 112 | |
| 113 | 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). The `MeasurementBase` functions which we need to overload are `isSignal(FitEvent *event)` and `FillEventVariables(FitEvent *event)`. |
| 114 | |
| 115 | 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. |
| 116 | |
| 117 | Our header file then looks something like: |
116 | 118 | |
117 | 119 | {{{ |
… |
… |
|
135 | 137 | #endif |
136 | 138 | }}} |
137 | | |
138 | | The `Measurement1D` class is implemented in `src/FitBase/Measurement1D.cxx`. |
139 | 139 | |
140 | 140 | === Making the constructor === |
|