GNuMI as an output produces paw ntuple files, the flux files. There have also been converted into root format using h2root. This page will focus on how to make plots from the paw files, but the idea is the same for the root files (See below fore more info on the existing ROOT file tools.). There are some sample paw scripts in CVS in gnumi/kumacs/, especially the top level script, called plot-all.kumac.
The flux files contain information about any particle decay that yielded a neutrino in GNuMI. Information on the variables contained in the flux ntuples can be found at the GNuMI v18 documentation site. (The format of the output is the same for v18 and v19.)
The most important thing to bear in mind when making any plots from the flux files is that you have to apply the importance weight, called nimpwt, to the events. In GNuMI, to speed things up not all of the low-energy pions are tracked since there are so many of them. So, when making any plots from these files, it is necessary to apply this weight so that the true particle hadron production yields will be reflected.
Perhaps the first thing to want to get out of the flux files, is the neutrino flux. You do need to do a little bit of reweighting to get anything sensible out of these files.
Firstly, as was mentioned above, you must apply the weight stored in the variable nimpwt. This is the "importance weight". In fact, it is a good idea to apply this to pretty much any quantity in the flux files. We don't track all of the low-energy pions in GNuMI, since there would be a lot of them. This importance weight basically tells you how likely it was that the particular neutrino parent pion or kaon was produced.
Next, you need to weight for geometry. Very few of the pion or kaon decays will actually have any chance of producing a neutrino that will strike the near (or especially the far detector!) if they decay randomly. So, to speed things up, the ntuple contained som info about what happend if you force the neutrino parent to produce a neutrino that will strike the center of the detector. There is a geometrical weight, nwtnear (or nwtfar), which tells you how likely it was that a particular pion (or kaon) will be to produce a neutrino that will strike the center of the near (or far) detector. Since the pion decay is a two-body problem, if you force the neutrino to strike the center of the detector, you are also forcing it to have a particular energy in the pion rest frame. So, if you are using nwtnear (or nwtfar) you also need to used nenergyN (or nenergyF) for the neutrino energy.
Lastly, to get the absolute flux correct, you should bear in mind that the nwtnear and nwtfar are calculated for a cylindrical area with a radius of 1 m. So, there is a factor of pi that you need to divide by to get a flux in neutrinos per m^2.
You must also keep track of the total number of protons on target that you are looking at. For the v18 or v19 flux files, each file is 500,000 protons on target. So, if you chain together 100 flux files, then npot is 50 million protons on target.
So, if in paw you make a plot of the near numu (type=56) energy spectrum, you need something like
n/plot 10.nenergyn (ntype=56)*(nimpwt*nwtnear/3.1415)
n/plot 10.nenergyf (ntype=56)*(nimpwt*nwtfar/3.1415)
An example of how to make a flux plot is also in CVS in gnumi/kumacs/flux.kumac.
In order to convert from flux plots to event rate plots, you need neutrino cross sections. Francisco has placed files data files with the neutrino cross section as a fucntion of energy on Fe from neugen v3.1 into CVS in Contrib/yumiceva/BeamTools. This cross secion data has been placed into the routines xseccc.f and xsecnc.f in gnumi/kumacs/flux.kumac. Note that these cross section functions return the cross section per kton of Fe per m^2 per 3.8e20 POT/year.
So, if in paw you make a plot of the near numu (type=56) CC events per kton per 3.8e20, you need something like
n/plot 10.nenergyn (ntype=56)*(nimpwt*xseccc.f(ntype,nenergyn)*nwtnear/3.1415)/[npots]
n/plot 10.nenergyf (ntype=56)*(nimpwt*xseccc.f(ntype,nenerngyf)*nwtfar/3.1415)/[npots]
Again, you must keep track of the total number of POTs that you are using (typically 500,000 per flux file). An example of how to make a flux plot is also in CVS in gnumi/kumacs/spectra.kumac.