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 36 and Version 37 of HowToAddSample


Ignore:
Timestamp:
Jan 6, 2017, 1:39:29 PM (7 years ago)
Author:
Clarence Wret
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • HowToAddSample

    v36 v37  
    146146}}}
    147147
    148 where we've copied the constructor arguments from some other class we're using as a template. I'll mention why this structure [#point_const below].
     148where we've copied the constructor arguments from some other class we're using as a template. I'll elaborate more on this [#point_const below].
     149
    149150
    150151[=#point_const]
    151152== Making the constructor ==
    152153
    153 NUISANCE loads samples through `FCN/SampleList.cxx` in the function `SampleUtils::LoadSample`, which makes a `std::list` of `MeasurementBase` pointers which it later loops over from executables.
    154 
    155 Most of the automated setting up is done in `Measurement1D::SetupMeasurement(std::string inputfile, std::string type, FitWeight *rw, std::string fakeDataFile)`, so it makes sense to have a class constructor which passes all of these on to `SetupMeasurement`.
     154NUISANCE loads samples through `FCN/SampleList.cxx` in the function `SampleUtils::LoadSample`, which makes a `std::list` of `MeasurementBase` pointers which it later loops over from the executables.
     155
     156Most of the automated setting up of histograms, titles, and so on is done in `Measurement1D::SetupMeasurement(std::string inputfile, std::string type, FitWeight *rw, std::string fakeDataFile)`. It hence makes sense to have a class constructor which passes all of these on to `SetupMeasurement`.
    156157
    157158The arguments to `Measurement1D::SetupMeasurement` are:
    158159
    159  * inputfile: the location of the input file containing generated events
    160  * type: the type of comparison we want to make with this sample
    161  * rw: the reweighting engine which may or may not be used to reweight the sample
    162  * fakeDataFile: the location of a fake-data input file which is to be used as data instead of the actual data for fake-data studies
    163 
    164 
     160 * `inputfile`: the location of the input file containing generated events
     161 * `type`: the type of comparison we want to make with this sample
     162 * `rw`: the reweighting engine which may or may not be used to reweight the sample
     163 * `fakeDataFile`: the location of a fake-data input file which is to be used as data instead of the actual data for fake-data studies
     164
     165which 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!
     166
     167Looking at the base classes which we are inheriting our sample from (`Measurement1D` and `MeasurementBase`, both in `src/FitBase`), we minimally need to set:
     168
     169 * `std::string fName`: The name of the sample
     170 * `std::string fPlotTitles`: The x and y axes of the sample
     171 * `double EnuMin`: The minimum neutrino energy in the sample signal definition
     172 * `double EnuMax`: The maximum neutrino energy in the sample signal definition
     173 * `TH1D *fDataHist`: The data histogram scanned from the provided input
     174 * `TH1D *fMCHist`: The generator histogram binning with same units as `fDataHist`
     175 * `TH1D *fMCStat`: The generator histogram without any scaling (i.e. N,,events,,)
     176 * `TH1D *fMCFine`: The generator histogram with same units as `fDataHist` but finer binning
     177 * `TH1 **fMCHist_PDF`: The mode-by-mode generator histograms
     178 * `TMatrixDSym *fFullCovar`: The covariance matrix
     179 * `TMatrixDSym *covar`: The inverted covariance matrix (bad naming, sorry!)
     180 * `double fScaleFactor`: The scaling factor we need to go from a event rate
     181
     182
     183We can set most of these by calling helper functions in `Measurement1D`, such as
     184
     185 * `Measurement1D::SetupMeasurement`: checks the naming of the sample and sets up the protected/private members, sets up the input generator processing for the sample, sets the fit options
     186 * `Measurement1D::SetDataValues`: sets the data histogram from a given file
     187 * `Measurement1D::SetCovarMatrix`: sets up the covariance matrices needed to calculate likelihoods
     188 * `Measurement1D::SetupDefaultHist`: sets all the generator histograms and their auxillary histograms (e.g. mode-by-mode generator histograms)
     189
     190or similar functions (e.g. `Measurement1D::SetDataFromFile` instead of `Measurement1D::SetDataValues`).
    165191
    166192