ATLAS Offline Software
TrigT1CaloSimRun2Config.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory import CompFactory
6 from AthenaConfiguration.Enums import Format
7 
8 
9 
10 def Run2TriggerTowerMakerCfg(flags, name='Run2TriggerTowerMaker25ns'):
11  '''
12  Basic setup of tower maker cfg for new JO
13  WARNING: need to add dependencies on digi flags (as above) that are missing as of now
14  '''
15 
16  acc = ComponentAccumulator()
17  # TODO this is only needed when re-running
18  # from SGComps.AddressRemappingConfig import InputRenameCfg
19  # acc.merge(InputRenameCfg('xAOD::TriggerTowerContainer', 'xAODTriggerTowers_rerun', 'xAODTriggerTowers'))
20 
21  # Configure conditions used by R2TTMaker
22  from CaloConditions.CaloConditionsConfig import CaloTTIdMapCfg
23  from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
24  acc.merge(CaloTTIdMapCfg(flags))
25  acc.merge(TileInfoLoaderCfg(flags))
26 
27  from TrigT1CaloCondSvc.L1CaloCondConfig import L1CaloCondAlgCfg
28  acc.merge(L1CaloCondAlgCfg(flags,Physics=True, Calib1=False, Calib2=False))
29 
30 
31  # R2TTMaker reads TTL1 containers from input POOL file (RDO, ESD, ...)
32  if flags.Input.Format is Format.POOL:
33  ttl1Containers = [
34  ('LArTTL1Container', 'LArTTL1EM'),
35  ('LArTTL1Container', 'LArTTL1HAD'),
36  ('TileTTL1Container', 'TileTTL1Cnt'),
37  ]
38  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
39  acc.merge(SGInputLoaderCfg(flags, Load=ttl1Containers))
40 
41  # R2TTMaker reads L1Menu in BeginRun incident, so needs L1ConfigSvc
42  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
43  acc.merge(L1ConfigSvcCfg(flags))
44 
45  # R2TTMaker needs the mu information available as EventInfo decoration
46  from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
47  acc.merge(LumiBlockMuWriterCfg(flags))
48 
49  condalgo = acc.getCondAlgo("L1CaloCondAlg")
50  alg = CompFactory.LVL1.Run2TriggerTowerMaker(name,
51  DigiEngine = "{}_Digitization".format(name),
52  # TODO make these settings flags dependent
53  CellType = 3,
54  inputTTLocation = 'unused',
55  TriggerTowerLocationRerun = 'also_unused',
56  ZeroSuppress = True,
57  ChanCalibFolderKey = condalgo.OutputKeyPPr,
58  ChanDefaultsFolderKey = condalgo.OutputKeyDef,
59  DisabledTowersFolderKey = condalgo.OutputKeyDisTowers,
60  DeadChannelsFolderKey = condalgo.OutputKeyPpmDeadChannels,
61  TTTool = CompFactory.LVL1.L1TriggerTowerTool("L1TriggerTowerTool",
62  InputKeyRunParameters=condalgo.OutputKeyRunParameters,
63  InputKeyPprConditionsRun2=condalgo.OutputKeyPprConditionsRun2,
64  InputKeyDisabledChannelRun2=condalgo.OutputKeyDisabledChannelRun2,
65  InputKeyTimeRefs=condalgo.OutputKeyTimeRefs)
66  #ExtraInputs = {'LArTTL1Container#LArTTL1EM', 'LArTTL1Container#LArTTL1HAD', 'TileTTL1Container#TileTTL1Cnt'}
67  )
68  acc.addEventAlgo(alg)
69 
70  return acc
71 
72 
73 
74 def L1CaloLegacySimCfg(flags):
75  '''
76  Configures Legacy 1 calo in new JO style
77  '''
78  acc = ComponentAccumulator()
79  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
80  acc.merge (GeoModelCfg (flags))
81 
82  from CaloConditions.CaloConditionsConfig import CaloTriggerTowerCfg,LArTTCellMapCfg,CaloTTIdMapCfg
83  acc.merge(CaloTriggerTowerCfg(flags))
84  acc.merge(LArTTCellMapCfg(flags))
85  acc.merge(CaloTTIdMapCfg(flags))
86 
87  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
88  from TileGeoModel.TileGMConfig import TileGMCfg
89 
90  acc.merge(LArGMCfg(flags))
91  acc.merge(TileGMCfg(flags))
92 
93  # necessary conditions
94  from LArBadChannelTool.LArBadChannelConfig import LArBadChannelCfg, LArBadFebCfg
95  acc.merge(LArBadChannelCfg(flags))
96  acc.merge(LArBadFebCfg(flags))
97 
98  from TileConditions.TileInfoLoaderConfig import TileInfoLoaderCfg
99  acc.merge(TileInfoLoaderCfg(flags))
100 
101  from TileGeoModel.TileGMConfig import TileGMCfg
102  acc.merge(TileGMCfg(flags))
103 
104  from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
105  acc.merge( TileEMScaleCondAlgCfg(flags) )
106 
107  from TrigConfigSvc.TrigConfigSvcCfg import L1ConfigSvcCfg
108  acc.merge(L1ConfigSvcCfg(flags))
109 
110  if not flags.Input.isMC:
111  from TrigT1CaloByteStream.LVL1CaloRun2ByteStreamConfig import LVL1CaloRun2ReadBSCfg
112  acc.merge(LVL1CaloRun2ReadBSCfg(flags))
113 
114  if flags.Input.isMC:
115  acc.merge(Run2TriggerTowerMakerCfg(flags))
116  acc.addEventAlgo(CompFactory.LVL1.Run2CPMTowerMaker('CPMTowerMaker'))
117  acc.addEventAlgo(CompFactory.LVL1.Run2JetElementMaker('JetElementMaker'))
118 
119  acc.addEventAlgo(CompFactory.LVL1.CPMSim('CPMSim'))
120  acc.addEventAlgo(CompFactory.LVL1.JEMJetSim('JEMJetSim'))
121  acc.addEventAlgo(CompFactory.LVL1.JEMEnergySim('JEMEnergySim'))
122  acc.addEventAlgo(CompFactory.LVL1.CPCMX('CPCMX'))
123  acc.addEventAlgo(CompFactory.LVL1.JetCMX('JetCMX'))
124  acc.addEventAlgo(CompFactory.LVL1.EnergyCMX('EnergyCMX'))
125  acc.addEventAlgo(CompFactory.LVL1.RoIROD('RoIROD'))
126  if flags.Input.isMC:
127  acc.addEventAlgo(CompFactory.LVL1.TrigT1MBTS())
128  return acc
129 
130 if __name__ == '__main__':
131  import sys
132 
133  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
134  from AthenaConfiguration.AllConfigFlags import initConfigFlags
135 
136  flags = initConfigFlags()
137  flags.Input.Files = ['/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.merge.RDO.e4993_s3214_r11315/RDO.17533168._000001.pool.root.1']
138  flags.Common.isOnline=False
139  flags.Exec.MaxEvents=25
140  flags.Concurrency.NumThreads = 1
141  flags.Concurrency.NumConcurrentEvents=1
142  flags.fillFromArgs()
143  flags.lock()
144 
145  acc = MainServicesCfg(flags)
146  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
147  acc.merge(PoolReadCfg(flags))
148 
149  from TrigConfigSvc.TrigConfigSvcCfg import generateL1Menu
150  generateL1Menu(flags)
151 
152  from AthenaCommon.CFElements import seqAND
153  acc.addSequence(seqAND('L1CaloLegacySimSeq'), parentName='AthAlgSeq')
154  acc.merge(L1CaloLegacySimCfg(flags), sequenceName='L1CaloLegacySimSeq')
155 
156  acc.printConfig(withDetails=True, summariseProps=True, printDefaults=True)
157  with open("L1CaloSim.pkl", "wb") as p:
158  acc.store(p)
159  p.close()
160 
161  sys.exit(acc.run().isFailure())
python.CaloConditionsConfig.CaloTriggerTowerCfg
def CaloTriggerTowerCfg(flags)
Definition: CaloConditionsConfig.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
python.TrigConfigSvcCfg.generateL1Menu
def generateL1Menu(flags)
Definition: TrigConfigSvcCfg.py:184
python.LArBadChannelConfig.LArBadChannelCfg
def LArBadChannelCfg(configFlags, tag=None, isSC=False)
Definition: LArBadChannelConfig.py:8
LVL1CaloRun2ByteStreamConfig.LVL1CaloRun2ReadBSCfg
def LVL1CaloRun2ReadBSCfg(flags, forRoIBResultToxAOD=False)
Definition: LVL1CaloRun2ByteStreamConfig.py:121
python.LumiBlockMuWriterConfig.LumiBlockMuWriterCfg
def LumiBlockMuWriterCfg(flags, name='LumiBlockMuWriter', seqName="AthAlgSeq")
Definition: LumiBlockMuWriterConfig.py:14
python.TileInfoLoaderConfig.TileInfoLoaderCfg
def TileInfoLoaderCfg(flags, **kwargs)
Definition: TileInfoLoaderConfig.py:12
python.LArBadChannelConfig.LArBadFebCfg
def LArBadFebCfg(configFlags, tag=None)
Definition: LArBadChannelConfig.py:45
python.CFElements.seqAND
def seqAND(name, subs=[])
Definition: CFElements.py:25
TrigT1CaloSimRun2Config.L1CaloLegacySimCfg
def L1CaloLegacySimCfg(flags)
Definition: TrigT1CaloSimRun2Config.py:74
python.CaloConditionsConfig.LArTTCellMapCfg
def LArTTCellMapCfg(flags)
Definition: CaloConditionsConfig.py:17
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
L1CaloCondConfig.L1CaloCondAlgCfg
def L1CaloCondAlgCfg(flags, readTest=False, Physics=True, Calib1=False, Calib2=False)
Definition: L1CaloCondConfig.py:6
python.TileEMScaleConfig.TileEMScaleCondAlgCfg
def TileEMScaleCondAlgCfg(flags, **kwargs)
Definition: TileEMScaleConfig.py:10
python.TrigConfigSvcCfg.L1ConfigSvcCfg
def L1ConfigSvcCfg(flags)
Definition: TrigConfigSvcCfg.py:198
Trk::open
@ open
Definition: BinningType.h:40
TrigT1CaloSimRun2Config.Run2TriggerTowerMakerCfg
def Run2TriggerTowerMakerCfg(flags, name='Run2TriggerTowerMaker25ns')
Definition: TrigT1CaloSimRun2Config.py:10
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.CaloConditionsConfig.CaloTTIdMapCfg
def CaloTTIdMapCfg(flags)
Definition: CaloConditionsConfig.py:31
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7