- Table of contents
- Getting and building the code
- Quick example of running the code.
- Looking inside doReweight_dk2nu_original.
- About GIT
- Some Results and Plots
Getting and building the code¶
- The code can be checked out using:
git clone ssh://firstname.lastname@example.org/cvs/projects/ppfx
- Setting. This sets by default root v5_30_00, boost v1_55_0 and some environmental variables.
cd ppfx source setup.sh
- Compiling. This process creates the PPFX library (lib/libppfx.so), executables programs (stored in the bin directory) and a doxygen page.
- Note: PPFX core uses the environmental variable PPFX_DIR to locate the top directory of two subdirectories (called "data" and "uncertainties") and load them at run time. If you move these subdirectories, be sure to define PPFX_DIR correctly.
Quick example of running the code.¶
As an example, you can run "doReweight_dk2nu_original". It runs in 3 types:
Using a precalculated detector positions:
bin/doReweight_dk2nu_original [input_file] [output file] [options file] [idet]
Using a user input position:
bin/doReweight_dk2nu_original [input_file] [output file] [options file] [xpos] [ypos] [zpos]By default, this calculates the flux at MINERvA. The inputs are:
- [input file] : Some ntuples can be found at /pnfs/numix/flux/g4numi/v6/me000z200i/minervame (The same ntuples are also at /pnfs/nova/data/flux/g4numi/v6).
- [output file] : will contains histograms of the central value and multi-universes.
- [option file] : use "scripts/inputs_default.xml" for thin target based correction or "scripts/inputs_mipp_numi.xml" for primary thick target correction.
- [idet] : index of the precalculated detector (look at the location.name in the dkmeta tree of the g4numi ntuple)
- [xpos], [ypos], [zpos] : position (cm) respect to the MC NuMI coordinate system to calculate the flux
About "idet": G4NuMI ntuples store an array of weights to get the flux at different detector positions (most of them at the center of the detector's front face). "idet" is the corresponding index in that array. To see the stored detector positions open a G4NuMI flux file and read the dkmetaTree (dkmetaTree->Show(0)). The convention for this index may change depending of the dk2nu version. For instance, for NOvA flux files:[idet]:
- 0: random
- 1: MINERvA
- 2: MINOS NearDet
- 3: NOvA NearDet
- 4: NDOS
- 5: MiniBooNE
- 6: MicroBooNE
- 7: SciBooNE
- 8: MINOS FarDet
- 9: Nova FarDet
You can also calculate the ppfx weight and add it to a friend tree to the input tree. Use the executable "doReweight_dk2nu" (it needs some user modifications).
Looking inside doReweight_dk2nu_original.¶
Inside the macro "doReweight_dk2nu_original.C" there is a singleton called MakeReweight that handles all classes needed to do the job.
- Create the instance:
MakeReweight* makerew = MakeReweight::getInstance();
- Set the option file (scripts/inputs_X.xml, where X = default or mipp_numi):
- Feed them with dk2nu/dkmeta entries:
- Get the vector of universes per reweighter:
vwgt_mipp_pi = makerew->GetWeights(ReweighterName); The ReweitherNames are: - MIPPNumiPionYields - MIPPNumiKaonYields - TotalAbsorption - TargetAttenuation - ThinTargetpCPion - ThinTargetpCKaon - ThinTargetnCPion - ThinTargetpCNucleon - ThinTargetMesonIncident - ThinTargetnucleonA - Other
- Do not forget release the memory used in the job after PPFX calculates the weights for all flux tuple entries:
Some Results and Plots¶
These are some supporting plots for the results we published in Phys. Rev. D 94, 092005 (2016), i.e., NuMI LE beam prediction at MINERvA. These can be used as validation for anyone using PPFX for the first time.
- Neutrino Flux Prediction for the NuMI Beamline (thesis):
Chapter 4: "Correcting the simulation using hadron production data" describes common definitions, explains in detail the procedure we followed to correct the hadron production, presents a survey of all existing relevant data for NuMI and describes their implementation. Particularly, Section 4.8 is dedicated to introduced PPFX as a computational framework that implements the procedure described in the chapter.
- Calculating the NuMI Flux (JETP-Dec2015)
Another useful source of information is the "Joint Experimental -Theoretical Physics Seminar" talk about "Calculating the NuMI Flux". From slide 42 to the end, the MINERvA strategy and results for calculating the flux based on PPFX are presented.
Alternative building using cmake
If you do not want to use "make", you can use cmake to build PPFX ( I checked these instructions with the NOvA framework, more general in the future):
- Setup NOvA framework
- Get PPFX from the git Redmine repository (see previous section)
- In order to use cetbuildtools v7_00_03, we need to add the next product area:
- Unsetup all UPS products:
- Make a directory for building the code and move there.
- Source setup:
source [directory to the source code]/ups/setup_for_development -d
*You can access the legacy code (CVS):