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 76 and Version 77 of HowToAddSample


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

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddSample

    v76 v77  
    181181
    182182which currently all have to be passed. In reality, both `rw` and `fakeDataFile` do nothing in `SetupMeasurement` but are left for legacy reasons. We will likely change this soon!
     183
     184{{{
     185#!div class="important"
     186
     187'''Optional:'''
     188Specifying `type` enables configuration of the class on run-time in the constructor. `type` is a `std::string` that gets read from the card file specified by the user at the end of each line.
     189
     190This is useful if the same measurement is made but with different kinematic cuts, e.g. ANL CC1π^+^1p has W < 1.4, 1.6 and no cut data. We could pass arguments in our card file to load different data and cut at different W values on run-time without having to add in a new class for each W cut.
     191
     192To get the `type` running smoothly you need to changed the `Measurement1D protected` members `fDefaultTypes` and `fAllowedTypes` to whatever strings you want to accept in the card file, whilst also including the defaults (`"FIX, FREE, SHAPE"`). `type` gets checked against the `fAllowedTypes` in the `SetupMeasurement` to ensure a consistent and expected loading.
     193
     194----
     195'''Example:''' I want to make ANL CC1π^+^1p accept W14 as an argument so I can cut on this variable and check how the generator performs over different W cuts vs data.
     196
     197In the constructor I'll need to add:
     198{{{
     199  fDefaultTypes = "FIX/DIAG";
     200  fAllowedTypes = "FIX,FREE,SHAPE/DIAG/W14";
     201
     202  if (type.find("W14") != std::string::npos) {
     203    ...
     204    Do different stuff because I want W14 data, e.g. set a bool
     205    ...
     206  } else {
     207    ...
     208    Do some other stuff when I don't want W14 data + cuts
     209    ...
     210  }
     211}}}
     212
     213I then act accordingly in `isSignal` and `FillEventVariables` (e.g. fill histogram only when W < 1.4, only count signal when W < 1.4).
     214
     215When I want to run with this new setting I first recompile and then edit my card file to
     216{{{
     217sample   ANL_CC1ppip_XSec_1DEnu_nu NEUT:MY_NEUT_FILE_LOCATION.root   W14
     218}}}
     219which '''should' load up whatever I specified when writing `W14` in the implementation file.
     220----
     221}}}
     222
    183223
    184224Looking at the base classes which we are inheriting our sample from (`Measurement1D` and `MeasurementBase`, both in `src/FitBase`), we minimally need to set: