MVASelect files


There are two sets of files being referred to as "anaTree"; this wiki refers to the MVASelect output

File location

You can find the v2.1 anatree files at:


They are mcc7 files processed with Nick’s latest neutrino energy reconstruction

What's in a file

  • There are 4 types of files:
    nuetest.root: nue selection on FHC files (beam, nue, nutau)
    anuetest.root: nue selection on RHC files (beam, nue, nutau)
    numutest.root: numu selection on FHC files (beam, nue, nutau)
    anumutest.root: numu selection on RHC files (beam, nue, nutau)
  • Each file consists of 3 samples:
    beam (run 20000001): numu-->numu, nue-->nue
    nue (run 20000002): numu-->nue, nue-->nutau
    nutau (run 20000003): numu-->nutau, nue-->numu
    beam (run 20000004): anumu-->anumu, anue-->anue
    nue (run 20000005): anumu-->anue, anue-->anutau
    nutau (run 20000006): anumu-->anutau, anue-->anumu
  • Each sample has ~1000 subruns with 100 events /subrun so ~100000 events in total. Each file has ~300k events in total.
  • There are two ttrees in the file: MVASelection and pottree. MVASelection saves information for each event (~300k). pottree saves information for each subrun (~3k).

How to use

  • The different samples cover all the possible oscillation channels. The idea is if you check the unoscillated flavor (beamPDG in MVASelection tree) and the oscillated flavor (neu in MVASelection tree), you can look up the above table to find out which type of file it was and find the run number and use the pottree to find the total POT.
  • For example, the file numutest.root consists of 3 runs:
    • beam run (no oscillations, numu remains numu and beam nue remains nue, run number 20000001),
    • nue run (all numu's oscillate into nue's and all beam nue's oscillate into nutau's, run number 20000002),
    • nutau run (all numu's oscillate into nutau's and all beam nue's oscillate into numu's, run number 20000003).
  • If you want to normalize the unoscillated numu events:
    • To get the total pot, you need to sum pot in the pottree ttree for run 20000001, which gives you 1.97e23. This is the total POT for unoscillated numu's.
    • For each event, you need to apply a weight target_pot/1.97e23.
    • Then you will get all events generated in the cryostat.
    • If you apply the PID cut: mvaresult>0.8, you will get events in the fiducial volume 814.3 m^3 that pass the numu selection.
    • If you only want to select CC events you need to request cc==1, etc.
  • To get the correct event count, there are two weights that need to be multiplied together: normalization and oscillation probability.

    As in the example above, for each event, you can find out which run it is (variable run in the TTree), 20000001 or 20000002 or 2000003, get the total POT for that run using the pottree. The normalization for that event would be target_pot/total_mcpot
    Oscillation probability can be calculated based on the unoscillated neutrino flavor (beamPDG) and oscillated neutrino flavor (neu).


Code lives in

See the branch names in (TODO: line number will eventually break, doxygen would be better)

Projected POT

dom_brailsford wrote a script (potWeightAppend.C) which appends the POT weight to the MVASelection tree, as well as the training trees (if you want them). This was mostly for MVA training purposes but it's generally handy to have the POT as a branch in the MVASelection tree to make weighting events a bit easier.

To use this script, you first have to hadd all of the analysis files together, including the numu, nue and nutau files into one big file.

To run, it goes something like this:

root -l 'potWeightAppend.C("path/to/hadded_files.root", new_POT)'

where new_POT is a POT that you want to scale up/down to.

After running the script, you should find 3 new branches in the MVASelection and training trees:
"pot" //the POT used to generate the sample that the particular event comes from. Generally speaking there are 3 possible values (one for numu, nue and nutau samples)
"projected_pot" //the new_POT you passed to the file. This will be the same for each event
"projected_weight" //(projected_pot/pot) * oscpro


Need to review

  • redundancy: cc, nc, ccnc
  • duplicates: sig, nc, cc, all@ folders
  • variable names (incl. changes from reco to MVASelect)
  • variable types (float in reco to doule in MVASelect)
  • osc calculator
  • POT accounting