ATLAS Offline Software
Loading...
Searching...
No Matches
runITkAlign Namespace Reference

Functions

 parser ()
 stageLocalDBFiles (db_file)

Variables

 kwargs = vars(parser())
 flags = initConfigFlags()
 accumulate
 Update flags based on parser line args.
 baseDir
 alignITk
 alignITkPixel
 alignITkStrip
 writeSilicon
 inputTFiles
 Files
 MaxEvents
 GlobalTag
 Dynamic
 AtlasVersion
 NumberOfCollisions
 Type
 Energy
 BunchSpacing
 EnableHI
 doGlobal
 solenoidOn
 barrelToroidOn
 endcapToroidOn
 AllLocal
 pixelAlignable
 stripAlignable
 NumThreads
str DBFile = ""
str DBName = "OFLCOND"
dict misalignModeMap
 get_db_name = os.path.basename(kwargs["localDB"])
 misalign_mode = int(get_db_name.removeprefix("MisalignmentSet").removesuffix(".db"))
dict alignment_tag = misalignModeMap.get(int(misalign_mode),'unknown')
 useLocalDatabase
 DBConnection
 alignmentFolder
 cfg = RecoSteering(flags)
 work_dir = os.path.join(flags.ITk.Align.baseDir,"Accumulate",)
 exist_ok

Function Documentation

◆ parser()

parser ( )

Definition at line 12 of file runITkAlign.py.

12def parser():
13 from argparse import ArgumentParser
14
15 parser = ArgumentParser(description="Script for ITk alignment")
16
17
18 parser.add_argument("-a", '--accumulate', action="store_true", help='Run accumulation step')
19 parser.add_argument("-s", '--solve', action="store_true", help='Run solve step')
20 parser.add_argument("-d", '--dryRun', action="store_true", help='Only configure, print and dont execute')
21 parser.add_argument("-b", '--baseDir', default = "./", help='Base dir where output is placed')
22
23
24 parser.add_argument("-i", "--input", default = defaultTestFiles.RDO_RUN4, nargs = "+", help='Input file(s)')
25 parser.add_argument("--maxEvents", default = -1, type = int, help='Number of maximal processed events')
26 parser.add_argument("-t", "--inputTracksCollection", default = "CombinedITkTracks", type = str, help='Name of the track collection to use')
27 parser.add_argument("--inputTFiles", default = "AlignmentTFile.root", type = str, help='ROOT file produced in MatrixTool in the accumulation step')
28
29 parser.add_argument("--alignmentConstants", default = [], nargs = "+", help='Local alignment constants to use')
30
31
32 parser.add_argument("--alignITk", action="store_true", help='Align whole ITk')
33 parser.add_argument("--alignITkPixel", action="store_true", help='Align ITkPixel')
34 parser.add_argument("--alignITkStrip", action="store_true", help='Align ITkStrip')
35
36
37 parser.add_argument("--globalTag", default = defaultConditionsTags.RUN4_MC, help='Global tag')
38 parser.add_argument("--atlasVersion", default = defaultGeometryTags.RUN4, help='Global tag')
39
40 parser.add_argument("--isBFieldOff", action="store_true", help='Check if Bfield is off')
41 parser.add_argument("--isCosmics", action="store_true", help='Check if cosmics run')
42 parser.add_argument("--isHeavyIon", action="store_true", help='Check if heavy ion run')
43
44
45 parser.add_argument("--localgeo", action="store_true", help='Use local geometry XML files')
46
47
48 parser.add_argument("--localDB", default = "", help='Use local DB file rather than from conditions tag')
49
50
51 parser.add_argument("--threads", default = 1, type = int, help='Number of threads')
52
53
54 return parser.parse_args()
55
56

◆ stageLocalDBFiles()

stageLocalDBFiles ( db_file)
Stage the local SQLite database, POOL payload file and POOL catalogue
in the current accumulation/solve working directory.

Definition at line 57 of file runITkAlign.py.

57def stageLocalDBFiles(db_file):
58 """
59 Stage the local SQLite database, POOL payload file and POOL catalogue
60 in the current accumulation/solve working directory.
61 """
62
63 db_file = os.path.abspath(db_file)
64 db_dir = os.path.dirname(db_file)
65 db_basename = os.path.basename(db_file)
66 db_stem = os.path.splitext(db_basename)[0]
67
68 files_to_stage = (
69 db_basename,
70 f"{db_stem}.pool.root",
71 "PoolFileCatalog.xml",
72 )
73
74 for filename in files_to_stage:
75 source = os.path.join(db_dir, filename)
76 destination = os.path.join(os.getcwd(), filename)
77
78 if not os.path.exists(source):
79 raise FileNotFoundError(
80 f"Required local conditions file does not exist: {source}"
81 )
82
83 if os.path.lexists(destination):
84 os.remove(destination)
85
86 os.symlink(source, destination)
87
88

Variable Documentation

◆ accumulate

runITkAlign.accumulate

Update flags based on parser line args.

Definition at line 105 of file runITkAlign.py.

◆ alignITk

runITkAlign.alignITk

Definition at line 108 of file runITkAlign.py.

◆ alignITkPixel

runITkAlign.alignITkPixel

Definition at line 109 of file runITkAlign.py.

◆ alignITkStrip

runITkAlign.alignITkStrip

Definition at line 110 of file runITkAlign.py.

◆ alignment_tag

dict runITkAlign.alignment_tag = misalignModeMap.get(int(misalign_mode),'unknown')

Definition at line 188 of file runITkAlign.py.

◆ alignmentFolder

runITkAlign.alignmentFolder

Definition at line 202 of file runITkAlign.py.

◆ AllLocal

runITkAlign.AllLocal

Definition at line 153 of file runITkAlign.py.

◆ AtlasVersion

runITkAlign.AtlasVersion

Definition at line 123 of file runITkAlign.py.

◆ barrelToroidOn

runITkAlign.barrelToroidOn

Definition at line 143 of file runITkAlign.py.

◆ baseDir

runITkAlign.baseDir

Definition at line 106 of file runITkAlign.py.

◆ BunchSpacing

runITkAlign.BunchSpacing

Definition at line 131 of file runITkAlign.py.

◆ cfg

runITkAlign.cfg = RecoSteering(flags)

Definition at line 209 of file runITkAlign.py.

◆ DBConnection

runITkAlign.DBConnection

Definition at line 200 of file runITkAlign.py.

◆ DBFile

runITkAlign.DBFile = ""

Definition at line 171 of file runITkAlign.py.

◆ DBName

str runITkAlign.DBName = "OFLCOND"

Definition at line 172 of file runITkAlign.py.

◆ doGlobal

runITkAlign.doGlobal

Definition at line 136 of file runITkAlign.py.

◆ Dynamic

runITkAlign.Dynamic

Definition at line 122 of file runITkAlign.py.

◆ EnableHI

runITkAlign.EnableHI

Definition at line 135 of file runITkAlign.py.

◆ endcapToroidOn

runITkAlign.endcapToroidOn

Definition at line 144 of file runITkAlign.py.

◆ Energy

runITkAlign.Energy

Definition at line 130 of file runITkAlign.py.

◆ exist_ok

runITkAlign.exist_ok

Definition at line 226 of file runITkAlign.py.

◆ Files

runITkAlign.Files

Definition at line 116 of file runITkAlign.py.

◆ flags

runITkAlign.flags = initConfigFlags()

Definition at line 98 of file runITkAlign.py.

◆ get_db_name

runITkAlign.get_db_name = os.path.basename(kwargs["localDB"])

Definition at line 185 of file runITkAlign.py.

◆ GlobalTag

runITkAlign.GlobalTag

Definition at line 118 of file runITkAlign.py.

◆ inputTFiles

runITkAlign.inputTFiles

Definition at line 114 of file runITkAlign.py.

◆ kwargs

runITkAlign.kwargs = vars(parser())

Definition at line 89 of file runITkAlign.py.

◆ MaxEvents

runITkAlign.MaxEvents

Definition at line 117 of file runITkAlign.py.

◆ misalign_mode

runITkAlign.misalign_mode = int(get_db_name.removeprefix("MisalignmentSet").removesuffix(".db"))

Definition at line 187 of file runITkAlign.py.

◆ misalignModeMap

dict runITkAlign.misalignModeMap
Initial value:
= {0:'InDetSi_MisalignmentMode_no Misalignment',
1: 'InDetSi_MisalignmentMode_misalignment by 6 parameters',
2: 'InDetSi_MisalignmentMode_random misalignment',
3: 'InDetSi_MisalignmentMode_IBL-stave temperature dependent bowing',
7: 'InDetSi_MisalignmentMode_misalignment according to module indices',
41: 'InDetSi_MisalignmentMode_ITk endcap beam-pipe z shift',
42: 'InDetSi_MisalignmentMode_ITk pixel barrel layer bowing',
43: 'InDetSi_MisalignmentMode_ITk barrel radial expansion',
11: 'InDetSi_MisalignmentMode_R deltaR (radial expansion)', 12: 'Phi deltaR (ellipse)',13: 'Z deltaR (funnel)',
21: 'InDetSi_MisalignmentMode_R deltaPhi (curl)', 22: 'Phi deltaPhi (clamshell) ',23:'Z deltaPhi (twist)',
31: 'InDetSi_MisalignmentMode_R deltaZ (telescope)',32:'Phi deltaZ (skew)',33:'Z deltaZ (z-expansion)'}

Definition at line 173 of file runITkAlign.py.

◆ NumberOfCollisions

runITkAlign.NumberOfCollisions

Definition at line 128 of file runITkAlign.py.

◆ NumThreads

runITkAlign.NumThreads

Definition at line 161 of file runITkAlign.py.

◆ pixelAlignable

runITkAlign.pixelAlignable

Definition at line 156 of file runITkAlign.py.

◆ solenoidOn

runITkAlign.solenoidOn

Definition at line 142 of file runITkAlign.py.

◆ stripAlignable

runITkAlign.stripAlignable

Definition at line 158 of file runITkAlign.py.

◆ Type

runITkAlign.Type

Definition at line 129 of file runITkAlign.py.

◆ useLocalDatabase

runITkAlign.useLocalDatabase

Definition at line 190 of file runITkAlign.py.

◆ work_dir

runITkAlign.work_dir = os.path.join(flags.ITk.Align.baseDir,"Accumulate",)

Definition at line 225 of file runITkAlign.py.

◆ writeSilicon

runITkAlign.writeSilicon

Definition at line 112 of file runITkAlign.py.