exercises » History » Version 6

« Previous - Version 6/42 (diff) - Next » - Current version
Eric Church, 02/08/2014 03:50 PM


Run a simple lar job to create mu-'s of momentum 1.5 GeV/c from a point source.

We will create a file containing events that each have a single muon using the code in the public development release. That means you will not need to build any code at this stage. So, go to your test release, that is your working directory. You made this in the guide. Set yourself up to run there with an appropriate mrb working directory, which we call lgm here. All this is explained at In this first exercise you are going to run from fcl files and .so libraries -- the heart of the framework -- that live in the official places. You will setup to run against uboonecode nightly (or v1_00_02, say) and against larsoft nightly (or v1_00_02). Namely, you are not using your own code. So, let's first show the setup, which we urge you perform via an alias, like the following. (Use an alias and hand-execute the alias commands each login; do not shove this stuff into your shell-initiated start up scripts like ~/.profile or ~/.bashrc.)

<> alias ulgmr='source /grid/fermiapp/uboone/software/; cd /uboone/app/users/username/lgm/build; setup uboonecode nightly -qe4:prof; source mrb slp;'  # a potential setup alias
<> ulgmr # actually execute the commands in the alias

And now, run the executable on this canned fcl job script file.

lar -c prodsingle_uboone.fcl

This fcl file will produce 5 muons through the set of modules SingleGen, LArG4, and DetSim. That's pretty cool. But where did it find prodsingle_uboone.fcl? How do I know it will run 5 events?
The answer comes from looking at our job script fcl file. We find our fcl files from sleuthing from the key environment variable $FHICL_FILE_PATH.

<> more /grid/fermiapp/uboone/software/products/uboonecode/nightly/job/prodsingle_uboone.fcl 

The job starts each event with a clean slate as indicated by the EmptyEvent key word. If you're running a job with recon modules in it only, EmptyEvent instead says RootInput, as you'll be sucking up an already-written root file in a previous job. Note that in prodsingle_uboone.fcl maxEvents is 5. Note the output root file full of histograms (that we declared and filled in the source code) is specified to be at single_hist_uboone.root and the output ART root file (which serves is the one that we'll pass onto any further modules in subsequent lar jobs) is to be called single_gen_uboone.root. Note, that these did indeed appear in your directory!

How did I make 1.5GeV/c muons and not, say, Higgsinos? The answer comes from drilling down into the included fcl files. Note that for the generator we need the fcl parameter set called microboone_singlep. fcl parameter sets are in fcl files in the same places as the job script fcl files: at all possible directories in $FHICL_SEARCH_PATH. So, let's search

<> grep microboone_singlep /grid/fermiapp/uboone/software/products/uboonecode/nightly/job/*
grep microboone_singlep /grid/fermiapp/products/larsoft/lar*/nightly/job/*
The relevant return line is from the second effort: /grid/fermiapp/products/larsoft/larsim/nightly/job/singles.fcl:microboone_singlep: @local::standard_singlep. That's the only place where microboone_singlep appears on the left hand side of a colon, and that's where the parameter set is defined. Although, what we've learned is that this parameter set is equated to standard_singlep, which hwe must now hunt down itself. Note that the return from the greps shows us that after defining microboone_singlep to be standard_singlep, we then proceed to over-write some parameters like X0 and Z0, meaning we force the particles to be generated from a particular point in the TPC. We grep the lar* job areas again for singlep and discover the motherlode at /grid/fermiapp/products/larsoft/larsim/nightly/job/singles.fcl, which upon investigation shows the full single particle parameter set, including the line PDG: [13]. Hence, we have generated mu-s.

Let's move to the next exercise.

Change the mu-'s to K+'s of lower momentum and originating throughout the TPC.

Here we want to still use canned code:: stuff from the nightly's or the vX_YY_ZZ's.

But we have to get ahold of the prodsingle_uboone.fcl. For now, let's just grab a copy and put it in our local area and use that. (Note this will work cuz the very first item in $FHICL_SEARCH_PATH is "."). So, go cp /grid/fermiapp/uboone/software/products/uboonecode/nightly/job/prodsingle_uboone.fcl .

Add a module to capture some truth information in histograms and TTree branches.