ATLAS Offline Software
CaloLCW_tf.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
4 
5 __doc__ = """JobTransform to run Calo LCW computation job"""
6 
7 
8 import sys
9 from PyJobTransforms.transform import transform
10 from PyJobTransforms.trfExe import athenaExecutor
11 from PyJobTransforms.trfArgs import addAthenaArguments, addDetectorArguments
12 import PyJobTransforms.trfArgClasses as trfArgClasses
13 
14 if __name__ == '__main__':
15 
16  executorSet = set()
17  executorSet.add(athenaExecutor(name = 'CaloLCW', skeletonCA='CaloLocalHadCalib.CaloLCWSkeleton',
18  substep = 'e2d', inData = ['ESD',], outData = ['HIST_CLASS','HIST_OOC','HIST_WEIGHTS','NTUP_DM']))
19 
20  trf = transform(executor = executorSet)
21  addAthenaArguments(trf.parser)
22  addDetectorArguments(trf.parser)
23  # Use arggroup to get these arguments in their own sub-section (of --help)
24  trf.parser.defineArgGroup('CaloLCW_tf', 'LCW specific options')
25  # input output files
26  trf.parser.add_argument('--inputESDFile', nargs='+',
27  type=trfArgClasses.argFactory(trfArgClasses.argPOOLFile, io='input'),
28  help='Input ESD file', group='CaloLCW_tf')
29 
30  trf.parser.add_argument('--outputHIST_CLASSFile', nargs='+',
31  type=trfArgClasses.argFactory(trfArgClasses.argHISTFile, io='output', type='hist', countable=False),
32  help='Output LCW classification file (default: classify.roo)', group='CaloLCW_tf',
33  default='classify.root')
34 
35  trf.parser.add_argument('--outputHIST_OOCFile', nargs='+',
36  type=trfArgClasses.argFactory(trfArgClasses.argHISTFile, io='output', type='hist', countable=False),
37  help='Output LCW OOC file (default: ooc.root)', group='CaloLCW_tf',
38  default='ooc.root')
39 
40  trf.parser.add_argument('--outputHIST_WEIGHTSFile', nargs='+',
41  type=trfArgClasses.argFactory(trfArgClasses.argHISTFile, io='output', type='hist', countable=False),
42  help='Output LCW Weights file (default: weights.root)', group='CaloLCW_tf',
43  default='weights.root')
44 
45  trf.parser.add_argument('--outputNTUP_DMFile', nargs='+',
46  type=trfArgClasses.argFactory(trfArgClasses.argNTUPFile, io='output', treeNames="DeadMaterialTree"),
47  help='Output LCW Dead material tree file (default: dmc.root)', group='CaloLCW_tf',
48  default='dmc.root')
49 
50  # boolean switches
51  trf.parser.add_argument('--doClassification', type=trfArgClasses.argFactory(trfArgClasses.argBool),
52  help='LCW runs classification (default: True)', group='CaloLCW_tf',
53  default=trfArgClasses.argBool(True))
54 
55  trf.parser.add_argument('--doWeighting', type=trfArgClasses.argFactory(trfArgClasses.argBool),
56  help='LCW runs weighting (default: True)', group='CaloLCW_tf',
57  default=trfArgClasses.argBool(True))
58 
59  trf.parser.add_argument('--doOOC', type=trfArgClasses.argFactory(trfArgClasses.argBool),
60  help='LCW runs OOC (default: True)', group='CaloLCW_tf',
61  default=trfArgClasses.argBool(True))
62 
63  trf.parser.add_argument('--doDeadM', type=trfArgClasses.argFactory(trfArgClasses.argBool),
64  help='LCW runs Dead Material (default: True)', group='CaloLCW_tf',
65  default=trfArgClasses.argBool(True))
66 
67  trf.parser.add_argument('--doLocalCalib', type=trfArgClasses.argFactory(trfArgClasses.argBool),
68  help='reclustering runs calibration (default: False)', group='CaloLCW_tf',
69  default=trfArgClasses.argBool(False))
70 
71  trf.parser.add_argument('--doCellWeight', type=trfArgClasses.argFactory(trfArgClasses.argBool),
72  help='reclustering runs cell weights (default: False)', group='CaloLCW_tf',
73  default=trfArgClasses.argBool(False))
74 
75  trf.parser.add_argument('--doHitMoments', type=trfArgClasses.argFactory(trfArgClasses.argBool),
76  help='reclustering runs calib. hit moments (default: True)', group='CaloLCW_tf',
77  default=trfArgClasses.argBool(True))
78 
79 
80  # string parameters
81  trf.parser.add_argument('--ClusKey', type=trfArgClasses.argFactory(trfArgClasses.argString),
82  help='key for copied clusters (default: CopyCaloTopoCluster)', group='CaloLCW_tf',
83  default='CopyCaloTopoCluster')
84 
85  trf.parseCmdLineArgs(sys.argv[1:])
86  trf.execute()
87  trf.generateReport()
python.trfArgs.addDetectorArguments
def addDetectorArguments(parser)
Options related to the setup of the ATLAS detector (used in simulation and digitisation as well as re...
Definition: trfArgs.py:229
PyJobTransforms.trfArgClasses
Transform argument class definitions.
python.trfArgs.addAthenaArguments
def addAthenaArguments(parser, maxEventsDefaultSubstep='first', addValgrind=True, addPerfMon=True, addVTune=True)
Options related to running athena in general TODO: Some way to mask certain options (perExec,...
Definition: trfArgs.py:59
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
PyJobTransforms.trfExe
Transform execution functions.
PyJobTransforms.transform
Main package for new style ATLAS job transforms.