ATLAS Offline Software
MistimedStreamPhI_runStandalone.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 #
3 # ===============================================================
4 # __mistimedAlg(flags)__
5 # ===============================================================
6 def mistimedAlg(flags, legacy, phaseI):
7 
8  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9 
10  acc = ComponentAccumulator()
11 
12  type_names = [
13  # ===== CPM ================================================================
14  "xAOD::CPMTowerContainer/CPMTowers",
15  "xAOD::CPMTowerAuxContainer/CPMTowersAux.",
16  # ===== PPM ============================================================
17  "xAOD::TriggerTowerContainer/xAODTriggerTowers",
18  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersAux.",
19  # ===== JETELEMENT =========================================================
20  "xAOD::JetElementContainer/JetElements",
21  "xAOD::JetElementAuxContainer/JetElementsAux.",
22  # ====== CTP ============================================================
23  "CTP_RDO/CTP_RDO"
24  ]
25 
26  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
27  acc.merge(ByteStreamReadCfg(flags, type_names=type_names))
28 
29  from TrigT1ResultByteStream.TrigT1ResultByteStreamConfig import L1TriggerByteStreamDecoderCfg
30  acc.merge(L1TriggerByteStreamDecoderCfg(flags))
31 
32  from TriggerJobOpts.TriggerRecoConfig import TriggerRecoCfg
33  acc.merge(TriggerRecoCfg(flags))
34 
35  #Decoder eFex TOBs
36  from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import eFexByteStreamToolCfg
37  acc.popToolsAndMerge(eFexByteStreamToolCfg(flags, 'eFexBSDecoder', xTOBs=True, multiSlice=True))
38 
39  #Decoder gFex TOBs
40  from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import gFexByteStreamToolCfg
41  acc.popToolsAndMerge(gFexByteStreamToolCfg(flags, 'gFexBSDecoder'))
42 
43  #Decoder jFex TOBs
44  from L1CaloFEXByteStream.L1CaloFEXByteStreamConfig import jFexRoiByteStreamToolCfg
45  acc.popToolsAndMerge(jFexRoiByteStreamToolCfg(flags, 'jFexBSDecoder'))
46 
47  #Decodes LATOME into SCell container
48  from L1CaloFEXSim.L1CaloFEXSimCfg import ReadSCellFromByteStreamCfg
49  acc.merge(ReadSCellFromByteStreamCfg(flags))
50 
51  #Decorator jFex towers
52  from L1CaloFEXAlgos.L1CaloFEXAlgosConfig import L1CalojFEXDecoratorCfg
53  acc.merge(L1CalojFEXDecoratorCfg(flags,ExtraInfo = False))
54 
55  #jFex emulated towers
56  from L1CaloFEXAlgos.FexEmulatedTowersConfig import jFexEmulatedTowersCfg
57  acc.merge(jFexEmulatedTowersCfg(flags,"jFexEmulatedTowerMaker", "L1_jFexEmulatedTowers"))
58 
59  #mistimed algorithm
60  from TrigT1CaloMonitoring.MistimedStreamMonitorAlgorithm import MistimedStreamMonitorConfig
61  MistimedStreamMonitorCfg = MistimedStreamMonitorConfig(flags, Legacy=legacy, PhaseI=phaseI)
62  acc.merge(MistimedStreamMonitorCfg)
63 
64  MistimedStreamMonitorCfg.OutputLevel = 1 # 1/2 INFO/DEBUG
65 
66  # Return our accumulator
67  return acc
68 
69 # ===============================================================
70 # __main__
71 # ===============================================================
72 if __name__ == "__main__": # typically not needed in top level script
73  from optparse import OptionParser
74  parser = OptionParser(usage = "usage: %prog arguments", version="%prog")
75  parser.add_option("-r", dest="runNumber",type="string", help="Input raw data run number (default: %default)")
76  parser.add_option("-v", dest="systemVersion",type="string", help="Input legacy or phaseI (default: %default)")
77  parser.set_defaults(runNumber="00455857", systemVersion="phaseI")
78  (options,args) = parser.parse_args()
79 
80  from AthenaConfiguration.AllConfigFlags import initConfigFlags
81  flags = initConfigFlags()
82  flags.Trigger.triggerConfig='DB'
83  flags.Exec.MaxEvents = -1
84  flags.GeoModel.AtlasVersion = 'ATLAS-R3S-2021-03-02-00'
85  flags.Trigger.EDMVersion = 3
86  flags.Trigger.L1.doCTP = True
87  flags.Trigger.enableL1CaloPhase1 = True
88  flags.IOVDb.GlobalTag = 'CONDBR2-BLKPA-2023-01'
89 
90  import glob
91  runNumber = options.runNumber
92  systemVersion = options.systemVersion
93  flags.Input.Files = glob.glob("/eos/atlas/atlastier0/rucio/data24_13p6TeV/physics_Mistimed/"+runNumber+"/data24_13p6TeV."+runNumber+".physics_Mistimed.merge.RAW/data24_13p6TeV."+runNumber+".physics_Mistimed.merge.RAW._lb*._SFO-ALL._0001.1")
94 
95  flags.Trigger.DecisionMakerValidation.Execute=False
96  flags.Trigger.DecisionMakerValidation.ErrorMode=False
97 
98  flags.Output.HISTFileName = "MistimedPhI_"+runNumber+"_"+systemVersion+".root"
99  flags.lock()
100 
101  # create basic infrastructure
102  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
103  sysAcc = MainServicesCfg(flags)
104 
105  # debug printout
106  sysAcc.printConfig(withDetails=True, summariseProps=True)
107 
108  # add the algorithm to the configuration
109  if (systemVersion=="legacy") :
110  sysAcc.merge(mistimedAlg(flags, legacy=True, phaseI=False))
111  else :
112  sysAcc.merge(mistimedAlg(flags, legacy=False, phaseI=True))
113 
114  # run the job
115  status = sysAcc.run()
116 
117  # report the execution status (0 ok, else error)
118  import sys
119  sys.exit(not status.isSuccess())
L1CaloFEXSimCfg.ReadSCellFromByteStreamCfg
def ReadSCellFromByteStreamCfg(flags, key='SCell', SCmask=True)
Definition: L1CaloFEXSimCfg.py:24
L1CaloFEXAlgosConfig.L1CalojFEXDecoratorCfg
def L1CalojFEXDecoratorCfg(flags, name="jFexTower2SCellDecorator", jTowersReadKey="L1_jFexDataTowers", ExtraInfo=False, SCMasking=True)
Definition: L1CaloFEXAlgosConfig.py:12
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
L1CaloFEXByteStreamConfig.gFexByteStreamToolCfg
def gFexByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:148
MistimedStreamMonitorAlgorithm.MistimedStreamMonitorConfig
def MistimedStreamMonitorConfig(flags, Legacy, PhaseI)
Definition: MistimedStreamMonitorAlgorithm.py:6
MistimedStreamPhI_runStandalone.mistimedAlg
def mistimedAlg(flags, legacy, phaseI)
Definition: MistimedStreamPhI_runStandalone.py:6
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.TriggerRecoConfig.TriggerRecoCfg
def TriggerRecoCfg(flags)
Definition: TriggerRecoConfig.py:17
L1CaloFEXByteStreamConfig.jFexRoiByteStreamToolCfg
def jFexRoiByteStreamToolCfg(flags, name, *writeBS=False, xTOBs=False)
Definition: L1CaloFEXByteStreamConfig.py:87
FexEmulatedTowersConfig.jFexEmulatedTowersCfg
def jFexEmulatedTowersCfg(flags, name="jFexEmulatedTowerMaker", writeKey="L1_jFexEmulatedTowers")
Definition: FexEmulatedTowersConfig.py:9
L1CaloFEXByteStreamConfig.eFexByteStreamToolCfg
def eFexByteStreamToolCfg(flags, name, *writeBS=False, TOBs=True, xTOBs=False, multiSlice=False, decodeInputs=False)
Definition: L1CaloFEXByteStreamConfig.py:8
TrigT1ResultByteStreamConfig.L1TriggerByteStreamDecoderCfg
def L1TriggerByteStreamDecoderCfg(flags, returnEDM=False)
Definition: TrigT1ResultByteStreamConfig.py:132