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`. |
| 154 | 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 the executables. |
| 155 | |
| 156 | Most 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`. |
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 | |
| 165 | which 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 | |
| 167 | Looking 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 | |
| 183 | We 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 | |
| 190 | or similar functions (e.g. `Measurement1D::SetDataFromFile` instead of `Measurement1D::SetDataValues`). |