3 @file FPGATrackSimBankConstGenConfig.py
4 @author Riley Xu - rixu@cern.ch
6 @brief This file declares functions to configure components in FPGATrackSimBankMerge
11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
18 kwargs.setdefault(
"merged_file_path", flags.Trigger.FPGATrackSim.FPGATrackSimMatrixFileRegEx)
19 kwargs.setdefault(
"region", flags.Trigger.FPGATrackSim.region)
20 kwargs.setdefault(
"CheckGood2ndStage",flags.Trigger.FPGATrackSim.CheckGood2ndStage)
21 kwargs.setdefault(
"UseHitScaleFactor",flags.Trigger.FPGATrackSim.UseHitScaleFactor)
22 kwargs.setdefault(
"IsSecondStage",flags.Trigger.FPGATrackSim.Is2ndStage)
23 kwargs.setdefault(
"missHitsConsts",flags.Trigger.FPGATrackSim.missHitsConsts)
25 from FPGATrackSimConfTools.FPGATrackSimDataPrepConfig
import FPGATrackSimMappingCfg
27 theFPGATrackSimConstGenAlg = CompFactory.FPGATrackSimConstGenAlgo(**kwargs)
28 theFPGATrackSimConstGenAlg.FPGATrackSimMappingSvc = FPGATrackSimMapping
30 eventSelector = CompFactory.FPGATrackSimEventSelectionSvc()
31 eventSelector.regions =
"HTT/TrigHTTMaps/V1/map_file/slices_v01_Jan21.txt"
32 eventSelector.regionID = 0
33 eventSelector.sampleType = flags.Trigger.FPGATrackSim.sampleType
34 eventSelector.withPU =
False
35 acc.addService(eventSelector, create=
True, primary=
True)
37 acc.addEventAlgo(theFPGATrackSimConstGenAlg)
40 if __name__ ==
"__main__":
41 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
42 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
43 from AthenaCommon.Logging
import logging
44 log = logging.getLogger(__name__)
53 acc.store(
open(
'FPGATrackSimConstsGenConfig.pkl',
'wb'))
55 from AthenaConfiguration.Utils
import setupLoggingLevels
58 MatrixFileName=flags.Trigger.FPGATrackSim.outputMergedFPGATrackSimMatrixFile
59 acc.addService(CompFactory.THistSvc(Output = [
"TRIGFPGATrackSimTREEGOODOUT DATAFILE='"+MatrixFileName+
"', OPT='RECREATE'"]))
60 acc.addService(CompFactory.THistSvc(Output = [
"TRIGFPGATrackSimCTREEOUT DATAFILE='const.root', OPT='RECREATE'"]))
62 statusCode = acc.run()
63 assert statusCode.isSuccess()
is True,
"Application execution did not succeed"