JeffersonLab / hps-mc

HPS MC toolkit
1 stars 6 forks source link

alignment workflow jobs #342

Closed tomeichlersmith closed 1 year ago

tomeichlersmith commented 1 year ago

An "iteration" of alignment consists of four steps.

  1. construct a detector from a compact.xml with the defined alignment parameters
  2. rerun tracking and the GBL alignment driver with hps-java with this new detector to calculate track parameters and their derivatives
  3. run pede to determine new alignment parameters from these updated track parameter derivatives
  4. apply these updated parameters to a new version/iteration of the detector

Step (2) can already be done with hps-mc so I'm going to look into doing the other steps within hps-mc or at least shipped with hps-mc so that a full alignment "iteration" can be accomplished. The other steps already have python code written for them but that code has a different structure and is in a different repo. Good place to start though.

tomeichlersmith commented 1 year ago

@cbravo135 is there a way to have different input files for the different steps in a job.

I am thinking that an alignment iteration could be one job where step (1) has the input detector, step (2) has the full list of input slcio files dispatched over slurm to the cluster, step (3) uses the bin files generated by step (2) when all those files are done, and step (4) uses the res file from step(3). It looks like that capability may already exists, but I'm not familiar enough with hps-mc to know for sure.

tomeichlersmith commented 1 year ago

zoomed with @cbravo135

Generally idea is two hps-mc jobs and one manual task:

0. Manually Recompile hps-java

1a - don't want to have hps-mc compiling

1. Recon/Tracking

Merge 1b + 2 ==> part of running tracking requires identifying the detector and making sure it is compiled/built. Run a separate job per input file so that it can be submitted to batch

2. pede minimization

Merge 3 + 4 This is where the main update is required - need to write an hps-mc component for pede


sarahgaiser commented 1 year ago

@tomeichlersmith Maybe we can get together and think about where to put the new component(s). Most tools are in tools.py but the file is super bloated already. So it might be worth creating a new file mille_tools.py or however you'd want to name it.

tomeichlersmith commented 1 year ago

That's a good point @sarahgaiser - I will put the PEDE component in a new file.

Perhaps this brings up the larger question of factorizing the files in hpsmc. We could put each component into its own file and then import them all into a common namespace using a thoughtful __init___.py. This would allow them all to exist in the same module (from a user point of view) but would be easier to maintain (from a developer point of view). This kind of refactoring is something that is larger than the scope of this issue though.

sarahgaiser commented 1 year ago

Yeah this totally shouldn't be part of this issue. However, to make future cleanup easier we should start having these separate files for new things. I'll go ahead and create an issue for the refactoring of hpsmc -> https://github.com/JeffersonLab/hps-mc/issues/343