ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
EFTracking
FPGATrackSim
FPGATrackSimBankGen
python
FPGATrackSimBankMergeConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
'''
3
@file FPGATrackSimBankMergeConfig.py
4
@author Riley Xu - rixu@cern.ch
5
@date Sept 22, 2020
6
@brief This file declares functions to configure components in FPGATrackSimBankMerge
7
'''
8
9
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
10
11
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
12
from
AthenaConfiguration.ComponentFactory
import
CompFactory
13
import
glob
14
15
def
getListOfFiles
(regex):
16
path = []
17
for
item
in
regex.split(
','
):
18
if
(
'matrix'
in
item
and
'root'
in
item):
19
path += glob.glob(item)
20
return
path
21
22
def
FPGATrackSimMatrixMergeCfg
(flags, **kwargs):
23
24
acc = ComponentAccumulator()
25
26
kwargs.setdefault(
"nbank"
,flags.Trigger.FPGATrackSim.FPGATrackSimNBanks)
27
kwargs.setdefault(
"allregion"
,flags.Trigger.FPGATrackSim.FPGATrackSimallBanks)
28
kwargs.setdefault(
"region"
,flags.Trigger.FPGATrackSim.region)
29
30
theFPGATrackSimMatrixMergeAlg = CompFactory.FPGATrackSimMatrixMergeAlgo()
31
file_path =
getListOfFiles
(flags.Trigger.FPGATrackSim.FPGATrackSimMatrixFileRegEx)
32
33
if
flags.Trigger.FPGATrackSim.FPGATrackSimMaxnMatrixInputFiles > 0:
34
theFPGATrackSimMatrixMergeAlg.file_path = file_path[0:flags.Trigger.FPGATrackSim.MaxInputFiles]
35
else
:
36
theFPGATrackSimMatrixMergeAlg.file_path = file_path
37
38
acc.addEventAlgo(theFPGATrackSimMatrixMergeAlg)
39
return
acc
40
41
42
if
__name__ ==
"__main__"
:
43
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
44
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
45
from
AthenaCommon.Logging
import
logging
46
log = logging.getLogger(__name__)
47
48
flags = initConfigFlags()
49
flags.fillFromArgs()
50
flags.lock()
51
52
acc=MainServicesCfg(flags)
53
54
acc.merge(
FPGATrackSimMatrixMergeCfg
(flags))
55
acc.store(open(
'FPGATrackSimMatrixMergeConfig.pkl'
,
'wb'
))
56
57
from
AthenaConfiguration.Utils
import
setupLoggingLevels
58
setupLoggingLevels(flags, acc)
59
60
MatrixFileName=flags.Trigger.FPGATrackSim.outputMergedFPGATrackSimMatrixFile
61
acc.addService(CompFactory.THistSvc(Output = [
"TRIGFPGATrackSimMATRIXOUT DATAFILE='"
+MatrixFileName+
"', OPT='RECREATE'"
]))
62
63
statusCode = acc.run()
64
assert
statusCode.isSuccess()
is
True
,
"Application execution did not succeed"
65
FPGATrackSimBankMergeConfig.getListOfFiles
getListOfFiles(regex)
Definition
FPGATrackSimBankMergeConfig.py:15
FPGATrackSimBankMergeConfig.FPGATrackSimMatrixMergeCfg
FPGATrackSimMatrixMergeCfg(flags, **kwargs)
Definition
FPGATrackSimBankMergeConfig.py:22
Generated on
for ATLAS Offline Software by
1.17.0