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 9, 2017, 3:40:09 PM (8 years ago)
- Author:
-
Clarence Wret
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v79
|
v80
|
|
75 | 75 | Out of these, string comparisons are only made on `DataType` and `DimensionVar`. The other identifiers exist to adhere to some standard and keep sample naming tidy and consistent. |
76 | 76 | |
77 | | |
| 77 | {{{ |
| 78 | #!div class="important" |
78 | 79 | '''What to do:''' |
79 | 80 | |
… |
… |
|
81 | 82 | |
82 | 83 | 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. |
83 | | |
| 84 | }}} |
84 | 85 | |
85 | 86 | == Placing the sample in a directory == |
… |
… |
|
91 | 92 | The new files themselves for the new samples should be identical (or very similar) to the sample name to avoid confusion. |
92 | 93 | |
93 | | |
| 94 | {{{ |
| 95 | #!div class="important" |
94 | 96 | '''What to do:''' |
95 | 97 | |
96 | 98 | Make the new files '''`src/T2K/T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx`''' and '''`src/T2K/T2K_CC1pip_H2O_1Dpmu_nu.h`'''. These are the implementation and header files for the new measurement and similar goes for the `1DEnuMB` implementation. |
97 | | |
| 99 | }}} |
98 | 100 | |
99 | 101 | == Placing the data in a directory == |
… |
… |
|
107 | 109 | 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. |
108 | 110 | |
109 | | |
| 111 | {{{ |
| 112 | #!div class="important" |
110 | 113 | '''What to do:''' |
111 | 114 | |
112 | 115 | Put the ROOT file from the [http://t2k-experiment.org/results/nd280data-numu-cc1pi-xs-on-h2o-2015/ data release] into the `data/T2K/CC1pip/H2O` directory. |
113 | | |
114 | | |
115 | | {{{ |
116 | | #!html |
117 | | <hr width="100%" size="10"> |
118 | | }}} |
| 116 | }}} |
| 117 | |
| 118 | ---- |
119 | 119 | = Coding up a sample = |
120 | 120 | |
… |
… |
|
135 | 135 | If you're implementing multiple distributions for the same measurement (e.g. dσ/dp,,µ,, and dσ/dcosθ,,µ,,) we recommend adding the signal definition to the namespace rather than directly in the `isSignal(FitEvent *event)` function in the class implementation. We'll talk about implementing a signal definition [#point_signaldef later]. |
136 | 136 | |
137 | | |
| 137 | {{{ |
| 138 | #!div class="important" |
138 | 139 | '''What to do:''' |
139 | 140 | Our header file now looks like: |
… |
… |
|
164 | 165 | |
165 | 166 | Note the simple structure for the sample: we really only need to set up three functions. The inheritance from `Measurement1D` and helper function within it does most of the heavy lifting. |
166 | | |
| 167 | }}} |
167 | 168 | |
168 | 169 | [=#point_const] |
… |
… |
|
275 | 276 | }}} |
276 | 277 | |
| 278 | {{{ |
| 279 | #!div class="important" |
277 | 280 | '''What to do:''' |
278 | 281 | The data and covariance matrix are available in a ROOT file for the sample, so I used `Measurement1D::SetDataFromFile` to set up the data and `Measurement1D::SetCovarFromDataFile` to set up the covariances. |
… |
… |
|
316 | 319 | }; |
317 | 320 | }}} |
318 | | |
| 321 | }}} |
319 | 322 | |
320 | 323 | [=#point_variable] |
… |
… |
|
518 | 521 | You simply need to add the implementation files to the `set(IMPLFILES` list and the header files to the `set(HEADERFILES`. |
519 | 522 | |
| 523 | {{{ |
| 524 | #!div class="important" |
520 | 525 | '''What to do:''' |
521 | 526 | * Add `T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx` and `T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx` to `set(IMPLFILES` |
522 | 527 | |
523 | 528 | * Add `T2K_CC1pip_H2O_XSec_1Dpmu_nu.h` and `T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h` to `set(HEADERFILES` |
524 | | |
| 529 | }}} |
525 | 530 | |
526 | 531 | = Make NUISANCE aware of the sample = |
… |
… |
|
530 | 535 | As mentioned earlier, NUISANCE loads samples through `src/FCN/SampleList.cxx` and specifically `bool SampleUtils::LoadSample`. We need to add our new sample to this long `if else` statement, making sure we string compare to the name set [#point_naming previously]. |
531 | 536 | |
| 537 | {{{ |
| 538 | #!div class="important" |
532 | 539 | '''What to do:''' |
533 | 540 | |
… |
… |
|
557 | 564 | }}} |
558 | 565 | |
| 566 | }}} |
| 567 | |
559 | 568 | = Recompiling NUISANCE with the new sample = |
560 | 569 | |
561 | | Since we've added files to the `CMakeList.txt` we need to reprocess the makefiles produced by CMake. This is done by: |
| 570 | Since we've added files to the `CMakeList.txt` we need to reprocess the makefiles produced by CMake. |
| 571 | |
| 572 | {{{ |
| 573 | #!div class="important" |
| 574 | '''What to do:''' |
562 | 575 | |
563 | 576 | {{{ |
… |
… |
|
578 | 591 | |
579 | 592 | If all is well we exit without any errors and we can proceed to making predictions for our new sample in NUISANCE. |
| 593 | }}} |
580 | 594 | |
581 | 595 | = Running NUISANCE with the new sample = |
| 596 | We can now write a cardfile and run any of the NUISANCE application with the sample! |
| 597 | |
| 598 | {{{ |
| 599 | #!div class="important" |
| 600 | If you haven't got any generated MC, now's the time to generate them! Alternatively, check [https://nuisance.hepforge.org/mcfilehosting.html our generated MC] for T2K ND280 flux with H,,2,,O target; it should be available for most generators! |
| 601 | |
| 602 | Once you have your sample make a NUISANCE input card file, e.g. |
| 603 | {{{ |
| 604 | $vim my_T2KH2O_card.card |
| 605 | }}} |
| 606 | and specify the sample in the card file as |
| 607 | {{{ |
| 608 | sample T2K_CC1pip_H2O_XSec_1Dpmu_nu GENERATOR:PATH_TO_GENERATOR_OUTPUT_FILE |
| 609 | }}} |
| 610 | where you replace `GENERATOR` with whatever generator you ran with, all in caps (e.g. `GENIE`, `NEUT`, `NUWRO`, `GIBUU` or `NUANCE`). |
| 611 | |
| 612 | Then finally run any of the NUISANCE executables, specifying the input card file and output root file e.g. |
| 613 | |
| 614 | {{{ |
| 615 | $ ./nuiscomp -c my_T2KH2O_card.card -o testing_my_T2KH2O_impl.root |
| 616 | }}} |
| 617 | |
| 618 | '''Hot tip:''' If you're testing/debugging an implementation you might not want to run over several million events. You can change the number of loaded events by appending `-q input.maxevents=50000` to run with 50000 events instead. |
| 619 | |
| 620 | }}} |
582 | 621 | |
583 | 622 | [=#point_fullimp] |