downloading

Instructions for setting up LArSoft at KSU
Event Generation, Reconstruction and Display
Saima Farooq
Last Updated: May 14, 2014
LArSoft is a software based on Art, and is used by the Liquid Argon Time Projection
Chamber experiments (LArTPCs), which include ArgoNeuT, MicroBooNE and others.
Event generation and reconstruction both are ‘produce’ method jobs in LArSoft, in other
words these are the ones that ‘add’ the information to an art event. The following draft
takes through the process of generating and reconstructing art events (the produce methods) and using the MicroBooNE event display. Once you can successfully do this, you can
go to the link at the bottom of this draft to start with your analysis module (‘analyze’
method in LArSoft).
Note: This draft is MicroBooNE specific, however, the LArSoft is developed in a way
that transitioning from one LArTPC to another takes minimal effort.
Now to start, once you are logged in to hep1.phys.ksu.edu,
1. Set up the Environment
Set up the environment variables of LArSoft as follows:
For setting up development version at KSU
source /user/LArSoft/externals/larsoft/setup/setup larsoft ksu.sh
For setting up the frozen version S2013.06.09
source /user/LArSoft/externals/larsoft/setup/setup larsoft ksu.sh -r S2013.06.09
Currently, we have the S2012.10.02, S2013.06.09 and development (corresponding to August 24, 2013) versions of LArSoft installed at KSU physics machine. Newer frozen versions can be installed (with permission from Glenn Horton Smith) at hep1.phys.ksu.edu
if needed.
2. Make a New Test Release
The next step is to go to your working area and make a new test release corresponding
to the same version of LArSoft that you set up for in step (1);
1
cd /user/<your name>
For making a new test release for development
newrel -t development <new test release name>
For making a new test release for a frozen version S2013.06.09
newrel -t S2013.06.09 <new test release name>
This command creates a new directory and includes some basic files. Here <your name>
is your home directory name and <new test release name> is whatever you want to name
your test release.
3. Add a Package
Now go to your <new test release name> and checkout the LArSoft package that you
want to modify/use. Since we want to generate the monte carlo events, we will check out
EventGenerator package from the repository
cd <new test release name>
For development version
addpkg svn -h EventGenerator
For frozen version
addpkg svn EventGenerator S2013.06.09
If desired, you can remove this package by
rmpkg EventGenerator
4. Set up the Private Context
Also set the $SRT PRIVATE CONTEXT variable to the current directory as follows
srt setup -a
This also sets the path for compilation.
5. Edit the Package Files to Make them MicroBooNE
Specific
Make the changes in your checked out package (EventGenerator in this case) if needed.
For now, we will make the changes only in the job file ‘EventGenerator/GENIE/prodgenie.fcl’
to make it MicroBooNE specific (instead of default - ArgoNeuT specific), that is, to run
the events through the MicroBooNE configurations instead (this includes flux, beam direction, beam radius, detector size, geometry and detector simulation etc). As promised,
2
this takes minimal work.
emacs EventGenerator/GENIE/prodgenie.fcl &
Now, in ‘services’ block, replace
user: @local::argoneut simulation services
by
user: @local::microboone simulation services
Also, the ‘producers’ block in your job file should look something like (Note: use your
choice of ‘generator’ configuration. For doing so look at the configuration file: EventGenerator/GENIE/genie.fcl)
generator:
largeant:
daq:
@local::microboone genie uniform flux
@local::microboone largeant
@local::microboone simwire
You can see that the produce block in the job file specifies that our monte carlo events
are generated (generator), propagated (largeant) and simulated in the detector (daq).
6. Compile the Package
Once you are done making the changes, save them and compile the package
For compiling
make EventGenerator.all
Also, every time you save a change in any file in your package, you can compile only
the changed file by doing the above. However, if a clean compilation is desired, do the
following in the same order
make EventGenerator.clean
make EventGenerator.all
Sometimes, it is very helpful to try ‘clean-make’ at first if you see a segmentation fault
for unknown reason while you are running a job.
7. Run a Monte Carlo Generation Job
Once compiled, you can run the event generation job (generating 1 event here) as follows
lar -c job/prodgenie.fcl -n 1
This will produce the event file ‘genie gen.root’ and the corresponding histogram file ‘genie hist.root’. The names of these files can be specified with options -o and -T in the
3
command line while running the job. For more information about lar command arguments, do the following
lar --help
Notes:
• The repository (version that you are using) can be reached at
$SRT PUBLIC CONTEXT.
• Your local files can be reached at $SRT PRIVATE CONTEXT, which is your
<new test release name>.
• When you run a job, the modules that are specified in your job file are first looked
for in your test release, that is in $SRT PRIVATE CONTEXT, and used if found,
otherwise, the modules are looked for and used from the repository, that is from
$SRT PUBLIC CONTEXT.
8. Open Events in MicroBooNE Event Display
(Optional)
Now you can open the histogram file which will have histograms and/or trees in Root. To
see the generated event in the event display of MicroBooNE, you can run the following
command
lar -c $SRT PUBLIC CONTEXT/EventDisplay/evd ub.fcl -s genie gen.root
or
lar -c $SRT PUBLIC CONTEXT/job/evd ub.fcl -s genie gen.root
Since we do not have EventDisplay package in our test release, we are using the job file
directly from the repository. We can also checkout the EventDisplay package to our test
release.
For more information about EventDisplay package (or any LArSoft package in general), you can go to https://cdcvs.fnal.gov/redmine/projects/larsoftsvn/wiki/
Package_Documentation
9. Run a Reconstruction Job
Now, for the reconstruction of these events, one can use the standard reconstruction job
file from the repository, however, you may want to modify that later.
To reconstruct the generated event
lar -c $SRT PUBLIC CONTEXT/Utilities/standard reco uboone.fcl -s genie gen.root
If you open the job file in a text editor (emacs, vi etc), you will see that the producers
block in it includes signal calibration, hit reconstruction and cluster reconstruction; this
4
means that you are reconstructing the calibrated signals, hits and clusters in the events.
This job will produce 2 files as usual, event file; standard reco uboone.root, and histogram
file; reco hist.root.
10. Open Reconstructed Events in MicroBooNE Event
Display (Optional)
You can now see the reconstructed objects in the event display by
lar -c $SRT PUBLIC CONTEXT/EventDisplay/evd ub.fcl -s standard reco uboone.root
Once the event display window opens, you can check the ‘Reconstructed’ box and the
‘Grayscale’ box (optional) at the bottom of the display window and also change the event
display settings to show different ‘reconstructed objects’ such as hits, clusters, tracks etc.
To select what objects to see in the display you need to go to Edit − > RecoDrawingOptions in the event display window. For help on the display configurations, see the ‘standard recodrawingopt’ block in the configuration file at $SRT PUBLIC CONTEXT/
EventDisplay/evdservices.fcl.
11. Yay!!
Now you have successfully generated a Monte Carlo event in MicroBooNE and reconstructed it. Congratulations!!
12. Start with an Analysis Task
You can write an analysis module to read from the event file and make your own histograms, TTrees etc. To get started with an analysis task, see the link https://cdcvs.
fnal.gov/redmine/projects/larsoftsvn/wiki/Getting_started_with_an_analysis_
task
Feel free to let me know if you have any questions at [email protected]
Good Luck!
5