-
Notifications
You must be signed in to change notification settings - Fork 4
File Format
The input file format for SBNfit used to construct covariance matrices and central value predictions was decided during the 2017 Columbia workshop to be as simple and straightforward as possible in order to ensure that it could be used in all generic situations.
Input files are simple root files containing one or more TTrees that each analyzer constructs post-analysis from reconstructed variables that they wish to fit in.
The only two compulsory requirements in the input TTree are:
- A branch called
weightsthat is a std::map<std::string, std::vector<double>> . The name of the branch is by defaultweightsbut can be set to anything via theeventweight_branch_name = "mcweight"attribute in the xml - A branch corresponding to whichever reconstructed variable the final fit and covariance matrix is to be build with, currently required to be a double
The reconstructed variable that one uses is not restricted at all, it can be anything from reconstructed neutrino energy or reconstructed lepton angle to hadron multiplicity.
The weights branch is the standard EventWeight class format in which the string corresponds to the variation name (must be unique) and the vector corresponds to each individual weight for each universe. Note that each vector must be of identical size across different files for the same variation (string) but can change between different variations. Although this form was chosen for ease of use in moving from the artroot EventWeights, in reality so long as the weights are stored in this form it matters not how they were constructed.
If the EventWeight class your are using is in the form std::map<std::string, std::vector<float>> (like in SBNcode) you can toggle this in the inc/SBNconfig.h file by uncommenting the define TYPE_FLOAT line
If the weights branch has a variation corresponding to the bnbcorrection weight, then this is used as a overall weight to all universes and not included in the covariance matrix calculation.
Multiple such files (or multiple TTrees in a single file), each corresponding to a different sample or background that one wishes to treat independently, are then used together in SBNfit to construct the covariance matrix. See Constructing a covariance matrix.
If one wishes to do neutrino oscillation studies then in addition to the above two branches the file (or associated friend tree) must also contain
- A branch corresponding to true neutrino energy
- A branch corresponding to true neutrino oscillation length
Some examples of such a simple file can be found at /uboone/data/users/markross/SBNfit_example_data/1e1p.root which contains a single tree (events) with the weights branch and a reconstructed energy variable ereco.
There are multiple example files as used in the examples at /uboone/data/users/markross/SBNfit_example_data