HPS-MC
 
All Classes Namespaces Files Functions Variables Pages
Loading...
Searching...
No Matches
alignment

Generally, alignment occurs with several iterations of tracking and parameter optimization. Below, is an outline on how to do a single iteration of this procedure.

0. Intentional Misalignment

This is step 0 since it will only occur once at the beginning and only if you wish to study a specific type of misalignment. In this example, we are doing an extremely simple misalignment where we translate a single sensor along the local u direction.

Look at the misalignment example for more detail on how to run this job.

hps-mc-job run misalign misalign/job.json

1. Run Tracking

This is done with the Tracking for Alignment example in this directory. Edit the list of input files to include the slcio files you wish to use for alignment, the job.json.templ to change the steering file (or other "static" parameters), and the vars.json file to list parameter options you wish the jobs to include.

First, we generate a list of jobs to run tracking over. The files are separated into different jobs so that they could be run in parallel on a batch system.

hps-mc-job-template \
-j 1 \ # one job per each combination of inputs
-a tracking/vars.json \ # extra variables to supply to jinja template engine
-i events tracking/events.txt 1 \ # inputs: NAME FILE_LIST NUM_PER_JOB
tracking/job.json.templ \ # template job JSON
tracking_jobs.json # output file to write jobs to

Then we run this list of jobs. In this example, there is only one file we are running tracking over, so we just run the single job directly.

hps-mc-job run \
-d $PWD/scratch \ # choose running/working/scratch directory
track_align \ # job to run
tracking_jobs.json \ # list of jobs to pull from
-i 1 # job ID number to run

Alternatively, the list of jobs (a.k.a. a "job store") could be provided to a batch system. For example, we can run the different tracking jobs via slurm when working at SLAC.

hps-mc-batch slurm \ # choose batch system
--env /sdf/path/to/hps-mc-env.sh \ # point system to your env script
track_align tracking_jobs.json # run java job with the entire job store generated

2. Run pede, Apply Parameters, and Construct Detector

This is done within the pede minimizer example in this directory. Edit job.json to include the list of all bin files generated by hps-java during step 1. This step runs the pede minimizer to "optimize" the alignment parameters and then writes a new iteration of the detector including these updated parameters.

hps-mc-job run \
-c pede/.hpsmc \ # extra configuration for pede job
-d $PWD/scratch \ # choose scratch directory
pede pede/job.json