HPS-MC
track_align_job.py
Go to the documentation of this file.
1 """!
2 @file track_align_job.py
3 
4 This job is focused on running the hps-java JobManager once. The user
5 can decide which steering file to use; however, the user must know that
6 this job provides many command-line definitions to be substituted into
7 the SimpleGblAliDriver config parameters. Look at the steering files
8 in the examples/alignment/tracking directory as an example.
9 """
10 
11 import os
12 import logging
13 from hpsmc.tools import JobManager
14 
15 
16 logger = logging.getLogger('hpsmc.job')
17 
18 job.description = 'single hps-java run with input steering file'
19 
20 
21 input_files = list(job.input_files.values())
22 if len(input_files) > 1:
23  raise Exception('This script accepts only one input file.')
24 
25 java_run = JobManager(
26  steering=job.params["steering"],
27  outputs=list(job.output_files.keys())
28  )
29 
30 # update defs to include our track_align defaults for the SimpleGBLTrajAliDriver
31 traj_ali_driver_defaults = {
32  'enableAlignmentCuts': True,
33  'doCOMAlignment': True,
34  'minMom': 0.5,
35  'maxMom': 5.0,
36  'nHitsCut': 6,
37  'debugAlignmentDs': False,
38  'correctTrack': True,
39  'includeNoHitScatters': False,
40  'gblRefitIterations': 0,
41  'storeTrackStates': True,
42  'compositeAlign': True,
43  'constrainedFit': False,
44  'momC': 4.55,
45  'constrainedBSFit': False,
46  'bsZ': -7.7,
47  'trackSide': -1,
48  'writeMilleChisqCut': 5,
49  'enableStandardCuts': False,
50  'maxTrackChisqFourHits': 60.,
51  'maxTrackChisqFiveHits': 60.,
52  'maxTrackChisqSixHits': 60.,
53  'inputCollectionName': 'KalmanFullTracks'
54  }
55 if 'defs' not in job.params:
56  # no user-defined defs
57  java_run.defs = traj_ali_driver_defaults
58 else:
59  # some user defined defs, make sure others get their defaults
60  java_run.defs = job.params['defs']
61  for key, val in traj_ali_driver_defaults.items():
62  if key not in java_run.defs:
63  java_run.defs[key] = val
64 
65 job.add([java_run])
Run the hps-java JobManager class.
Definition: tools.py:160
Tools that can be used in HPSMC jobs.
Definition: tools.py:1