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 67 and Version 68 of HowToAddSample


Ignore:
Timestamp:
Jan 6, 2017, 5:46:48 PM (8 years ago)
Author:
Clarence Wret
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddSample

    v67 v68  
    99NUISANCE is currently fully written in '''C++03''' and we would appreciate future contributions to adhere to this standard.
    1010
    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.
    1212
    1313{{{
     
    2626== Finding the neutrino flux and generating events ==
    2727
    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).
     28The 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).
    2929
    3030A quick search through the arxiv document points us to reference ![12]. It is also in our [wiki:ExperimentFlux flux list].
    3131
    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.
     32I 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.
    3535
    3636
    3737== Choosing a cross-section distribution ==
    3838
    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.
     39The 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.
    4040
    4141[[Image(T2K_CC1pip_H2O_pmu.png​, 300px)]][[Image(T2K_CC1pip_H2O_enurec.png​, 300px)]]
    4242
    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).
     43In 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).
    4444
    4545
     
    5151Each 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`).
    5252
    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.
     53These `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
     55A 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.
    5456
    5557The inheritance tree is simple and goes `Specific_Measurement -> MeasurementXD -> MeasurementBase`
     58
    5659
    5760[=#point_naming]
    5861== Naming the sample ==
    5962
    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'''.
     63Some 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'''.
    6164
    6265
     
    7578'''What to do:'''
    7679
    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.
     80Following the above convention, we end up with '''`T2K_CC1pip_H2O_XSec_1Dpmu_nu`'''.
     81
     82This 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.
    7883
    7984
     
    100105Furthermore, we specify another directory for the measurement topology to avoid confusion, e.g. `data/T2K/CC1pip` for our sample.
    101106
    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`.
     107In 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.
    103108
    104109
     
    110115{{{
    111116#!html
    112 <hr width="100%" size="4">
     117<hr width="100%" size="10">
    113118}}}
    114119= Coding up a sample =
    115120
    116 Now that we have the rough structure set-up, we can finally start writing some code.
     121Now that we have the rough structure set-up, we can start writing some code.
    117122
    118123[=#point_header]
    119124== Writing the header ==
    120125
    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.
     126The 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
     128NUISANCE 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
     130The `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.
    126131
    127132[=#point_signal]