LDMX Software
|
Python package focused on comparing two or more "similar" LDMX event or histogram files.
One may use this python module either inside or outside the ldmx-sw development container.
ldmx-sw
Run the dedicated just
command to install
ldmx-sw
Outside container it is helpful to put the Validation module inside a virtual environment. This makes it easier to keep track of what you are doing and isolate the dependencies of Validation
from other python packages that may be on your system.
I store the virtual environment files in a directory called .venv/valid
and tell venv
to use valid
as the prompt so I can see in my terminal that I have access to the Validation package. After activating the virtual environment, I install an editable version of Validation. Using --editable
means that python
will look at the original source files when attempting to use the module while running which is helpful when planning to edit the Validation source files. You can omit the --editable
option in which case the code will be copied and (slightly) optimized and you will need to re-install
if you make changes to the source code.
Using Validation without a virtual environment and outside of the container is not recommended.
The Validation module is constructed to do some common tasks quickly on the command line. Printing out its help message shows how to run it and gives you the details on what parameters to provide.
For example if you would like to compare the ECAL shower features, put the input histograms into a directory, e.g. compareDir
with names that are separated with an underscore, e.g. histo_new.root
and histo_ref.root
, then run the following command.
This will produce plots in the compareDir
directory and will include "new" and "ref" in the plot legend.
Similar to the CLI, you can develop your own python script using Validate. Simply import Validate
where you want to be using it. Remember: The plotting functions assume the user is in an interactive notebook unless the out_dir
parameter is provided.
Again, accessing this module post-installation is the same as other modules import Validate
. This can help you develop plots that don't come pre-made within the Validation module. If you are developing Validate and testing within a notebook, you will need to reboot the python kernel anytime you wish to test changes to the Validation module. This is necessary because Jupyter keeps modules cached in memory during normal running in order to save time