nuisance is hosted by Hepforge, IPPP Durham
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.

Changes between Version 79 and Version 80 of HowToAddSample


Ignore:
Timestamp:
Jan 9, 2017, 3:40:09 PM (8 years ago)
Author:
Clarence Wret
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddSample

    v79 v80  
    7575Out 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.
    7676
    77 
     77{{{
     78#!div class="important"
    7879'''What to do:'''
    7980
     
    8182
    8283This 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}}}
    8485
    8586== Placing the sample in a directory ==
     
    9192The new files themselves for the new samples should be identical (or very similar) to the sample name to avoid confusion.
    9293
    93 
     94{{{
     95#!div class="important"
    9496'''What to do:'''
    9597
    9698Make 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}}}
    98100
    99101== Placing the data in a directory ==
     
    107109In 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.
    108110
    109 
     111{{{
     112#!div class="important"
    110113'''What to do:'''
    111114
    112115Put 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----
    119119= Coding up a sample =
    120120
     
    135135If 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].
    136136
    137 
     137{{{
     138#!div class="important"
    138139'''What to do:'''
    139140Our header file now looks like:
     
    164165
    165166Note 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}}}
    167168
    168169[=#point_const]
     
    275276}}}
    276277
     278{{{
     279#!div class="important"
    277280'''What to do:'''
    278281The 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.
     
    316319};
    317320}}}
    318 
     321}}}
    319322
    320323[=#point_variable]
     
    518521You simply need to add the implementation files to the `set(IMPLFILES` list and the header files to the `set(HEADERFILES`.
    519522
     523{{{
     524#!div class="important"
    520525'''What to do:'''
    521526 * Add `T2K_CC1pip_H2O_XSec_1Dpmu_nu.cxx` and `T2K_CC1pip_H2O_XSec_1DEnuMB_nu.cxx` to `set(IMPLFILES`
    522527
    523528 * Add `T2K_CC1pip_H2O_XSec_1Dpmu_nu.h` and `T2K_CC1pip_H2O_XSec_1DEnuMB_nu.h` to `set(HEADERFILES`
    524 
     529}}}
    525530
    526531= Make NUISANCE aware of the sample =
     
    530535As 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].
    531536
     537{{{
     538#!div class="important"
    532539'''What to do:'''
    533540
     
    557564}}}
    558565
     566}}}
     567
    559568= Recompiling NUISANCE with the new sample =
    560569
    561 Since we've added files to the `CMakeList.txt` we need to reprocess the makefiles produced by CMake. This is done by:
     570Since 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:'''
    562575
    563576{{{
     
    578591
    579592If all is well we exit without any errors and we can proceed to making predictions for our new sample in NUISANCE.
     593}}}
    580594
    581595= Running NUISANCE with the new sample =
     596We can now write a cardfile and run any of the NUISANCE application with the sample!
     597
     598{{{
     599#!div class="important"
     600If 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
     602Once you have your sample make a NUISANCE input card file, e.g.
     603{{{
     604$vim my_T2KH2O_card.card
     605}}}
     606and specify the sample in the card file as
     607{{{
     608sample T2K_CC1pip_H2O_XSec_1Dpmu_nu GENERATOR:PATH_TO_GENERATOR_OUTPUT_FILE
     609}}}
     610where you replace `GENERATOR` with whatever generator you ran with, all in caps (e.g. `GENIE`, `NEUT`, `NUWRO`, `GIBUU` or `NUANCE`).
     611
     612Then 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}}}
    582621
    583622[=#point_fullimp]