Nus 2018 -- RHC

This page relates to the NC-disappearance analysis conducted in 2018 with the RHC dataset. This is the first generation of NC-disappearance with antineutrinos on NOvA, and one of the first such analyses ever. The RHC analysis differs from the corresponding (now third generation) FHC analysis in the following ways:

  • The selections, though qualitatively the same, are tuned separately. The main PID, CVN, is trained and the cut is tuned separately. Additionally, the BDT used to reject cosmic interactions is trained and tuned independently.
  • The fitting technique uses the extrapolation method in order to make a prediction at the FD, whereas the FHC is using the new joint two-detector covariance matrix fitting approach. All the code written for the RHC analysis is extrapolation-specific.

Analysis overview

The Nus18 analysis selection is applied to the ND and FD data to select a sample of NC interactions. These cuts are defined in Cuts/NusCuts18.h as Nus18ND and Nus18FD respectively. Following selection of simulation and data at the near detector, the data are used to correct the observed energy spectrum of the simulation and then the extrapolation procedure (common on NOvA and documented extensively elsewhere, for example here) is applied to make predictions of the observed energy spectrum at the far detector, taking into account geometrical differences, affects of beam dispersion etc. These far detector predictions may then be oscillated and fit, to fake data to produce sensitivities or to the observed data spectrum.

The analysis used the simulation and data files from Production 4. They are mostly accessed using the Prod4Loaders within CAFAna, with some loader definitions (particularly for cosmics) listed in the Nus18Utilities.h file.

Data management

Multiple data files are required for use in this analysis. In order to keep a handle on this, and to allow for version control, we use a ups product, 'nusdata'. Can list the available version and set up in the usual ups way:

ups list -aK+ nusdata
setup nusdata <version>
Once set up, multiple environment variables are set:

The correct version of each of the data files should be within the directories pointed to by these variables.

For ease of data access, multiple functions are defined within the Nus18Utilities.h file. These may be called within analysis macros to access the required data specific to given running options. Examples include:

  • LoadPrediction
  • LoadCovMx (not relevant to this analysis)
  • LoadPPFX (not relevant to this analysis)
  • LoadFakeData (not relevant to this analysis)
  • LoadData
  • LoadCosmicHist
  • LoadCosmicSpectrum
  • LoadSystematics
When setting up CAFAna, a default version of nusdata, which may or may not be the most recent, is set up. This will set a default set of environment variables and therefore point to a default set of data files. This may be changed by:
  • setting up a new version of nusdata
    unsetup nusdata
    setup nusdata <new version>
  • manually exporting the relevant environment variable to a local directory (highly useful for testing with test files)
    export NUSDATA_NUS18_PRED=/nova/app/users/...

Once new versions of files are ready, Gavin will assist in making a new ups tag.

In general, most development work is being done on the R19-03-06-nus-develop-br branch. We merge trunk into this regularly so it should be quasi-up-to-date, but also serves as a buffer to protect our code base from potential breaking changes from different groups.


Since the NOvA far detector is on the surface, cosmics must be taken into account. As opposed to using simulation, predictions are made using real cosmic data, taken from both a dedicated cosmic trigger and from out-of-time NuMI triggers (data taken during the NuMI trigger window but out of time with the beam spill). Before cuts are finalized, the cosmics from the cosmic trigger are used to make predicted spectra. After finalizing the cuts, a cosmic spectrum can be created which will never need to be changed. This is made from the out-of-time NuMI samples but compared with data from the cosmic trigger.


Systematics refers to the experimental uncertainties present in the analysis. We account for these by applying relevant 'shifts' in the simulation and evaluating the effect these shifts have on the eventual event selection and analysis. Studying the effect of systematics involves the following steps:
  • producing new predictions with each shift applied to understand how each will affect the rate and shape of events selected;
  • from these predictions, producing objects in CAFAna (ISysts) which encode the amount of bin-by-bin fluctuations each systematic gives to the selected spectrum.
    Using the ISysts, we may reproduce the full analysis whilst including this additional information. This involves:
  • making new predictions, PredictionInterps, which have knowledge of the amount each bin is allowed to vary given the systematic shifts;
  • refitting the data, giving the fitter permission to 'pull' on these shifts in order to better fit the data.
In the Nus18 analysis, we considered the effects of the following systematics:
  • Beam transport
  • Kaon
  • Neutron
  • Tau
  • Cherenkov
  • Calibration (absolute and relative, flat and shape)
  • PPFX
  • Light level
  • Cross-section tuning

Relevant macros

The relevant macros live in CAFAna/nus/Nus18/, currently in trunk.

ND data/MC distributions

In order to understand the effects of the extrapolation, it may be instructive to look at ND data/MC distributions. We have some macros for this but they haven't yet been tidied up enough and committed.

Making predictions

The macro MakeNus18ExtrapPred.C may be used to make predictions. All prediction inherit from the base template (IPrediction) but will likely either be PredictionSterile or PredictionInterp objects, depending on whether or not systematics were included in the prediction. This is run as

cafe -bq -ss -l <n> MakeNus18ExtrapPred.C <opt>
where n is the number of files to run, and opt are running options. Opt may be a concatenation of multiple options from:
  • polarity ("fhc" or "rhc") -- required
  • input file type ("caf" or "concat") -- required
  • systematics ("syst") -- optional
  • cosmics ("cos") -- optional

For example, an acceptable opt may be "RHCCafSyst".

If "cos" is specified, the cosmic spectrum is made. If the finalized spectrum (from out-of-time NuMI data) is available, this need not be remade.

After making and testing new predictions, they may be tested by setting the relevant ups products described above. If and when they are ready to replace the files in the existing version, a new ups tag can be created.

Making cosmic prediction

There are macros developed to make the cosmic spectra for both cosmic-triggered data and out-of-time NuMI-triggered data. Not quite tidied up and committed yet, will be updated when they are.

Analyzing predictions

The macro AnalyzeNus18Pred.C may be used to analyze these predictions. It simply makes spectra and separates out the various components (and whatever else can be added). This is run as

cafe -bq AnalyzeNus18Pred.C <opt>
where opt can be:
  • polarity ("fhc" or "rhc") -- required
  • systematics ("syst") -- optional
  • cosmics ("cos") -- optional

The required data files will be extracted from the ups product as described above.

Making and drawing fits

There are some additional macros which were used to perform the fitting of the far detector predictions. The macro MakeExtrapSurface.C performs the fit and saves the ana::Surface object in an output file. It is run as

cafe -bq MakeExtrapSurface.C <opt>
where opt can be:
  • polarity ("fhc" or "rhc") -- required
  • fits to produce ("1D" or "2D") -- required (NB can't do both right now)
  • systematics ("syst") -- optional
  • cosmics ("cos") -- optional
  • data ("data") -- optional
  • scale ("scaleXX") -- optional

If "data" is specified, then a fit to the data is performed. If not, a fake data spectrum is produced which is then fit to.
If "scale" is specified, the POT is scaled to the number given (in units of e20). Only certain POTs are supported, currently 12 and 35 (expected RHC dataset by end of 2019 RHC run and end of NOvA run respectively).

Once the surface is made, they can be drawn using the DrawExtrapSurface.C macro. This is run as

cafe -bq DrawExtrapSurface.C <file> <opt>
where file contains the ana::Surface object and opt can be:
  • fits to draw ("1D" or "2D") -- required

Making and analyzing systematics

In order to make the systematic shifts, the following may be run:
cafe -bq -ss -l <n> MakeNus18Systs.C <opt>

where opt can be
  • polarity ("fhc" or "rhc") -- required
  • input file type ("caf" or "concat") -- required
  • prediction type ("nd", "fd", or "extrap") -- required
    This will make predictions, exactly as the extrapolated prediction was made previously, for either ND simulation, FD simulation, or extrapolated simulation. The extrapolation follows the same procedure as the previous extrapolation and partially cancels correlated uncertainties (more relevant in this case!). In this analysis, we are interested in the extrapolated systematics, but it is instructive to make them for ND and FD too so the shifts can be seen before and after the effects of extrapolation.

This will certainly need to be run on the grid and will take a long time for all the different shifts. When saving the NusSystematicsMaker (last part of the macro), there is an option to save the systematics either in one file, or in multiple files depending on the name of the uncertainty. When running and testing interactively, it is ok to put everything in one file. However, when running on the grid, it is recommended to save to multiple output files. This makes it much simpler to combine all the output files for each of the systematics when retrieving jobs from the grid. A script is provided to combine the systematics from multiple files: <path to input files> <path to output files>

where two paths are required: the path to the input files and the path for the script to place the output files. The script effectively just scans the input directory, looks for files to add, and calls hadd_cafana on each successively.

Once an output file with all the systematics in is made, it may be analyzed using
cafe -bq AnalyzeNus18Systs.C <input file> <opt>

where opt may be
  • polarity ("fhc" or "rhc") -- required

This will print out the shifts (individual and overall) for each of the systematics considered and draw the shifted spectra, saved in an output root file. Additionally, it will create an output file of ISyst objects (technically, NusISysts, which inherit from the ISyst template) which may be used in the analysis.

In order to include the effect of systematics in predictions and fits, the predictions and fits, described above, can be remade with the Syst option included. The file containing the ISysts must be in the $NUSDATA_NUS18_SYSTS path.