ATLAS Offline Software
MistimedStreamPhI_runStandalone.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 #
3 # ===============================================================
4 # __mistimedAlg(flags)__
5 # ===============================================================
6 def mistimedAlg(flags):
7 
8  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9  from AthenaConfiguration.ComponentFactory import CompFactory
10  from AthenaConfiguration.Enums import Format
11 
12  acc = ComponentAccumulator()
13 
14  type_names = [
15  # ===== CPM ================================================================
16  "xAOD::CPMTowerContainer/CPMTowers",
17  "xAOD::CPMTowerAuxContainer/CPMTowersAux.",
18  # ===== PPM ============================================================
19  "xAOD::TriggerTowerContainer/xAODTriggerTowers",
20  "xAOD::TriggerTowerAuxContainer/xAODTriggerTowersAux.",
21  # ===== JETELEMENT =========================================================
22  "xAOD::JetElementContainer/JetElements",
23  "xAOD::JetElementAuxContainer/JetElementsAux."
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)
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.set_defaults(runNumber="00455857")
77  (options,args) = parser.parse_args()
78 
79  import sys
80 
81  from AthenaConfiguration.AllConfigFlags import initConfigFlags
82  flags = initConfigFlags()
83  flags.Trigger.triggerConfig='DB'
84  flags.Exec.MaxEvents = -1
85  flags.GeoModel.AtlasVersion = 'ATLAS-R3S-2021-03-02-00'
86  flags.Trigger.EDMVersion = 3
87  flags.Trigger.enableL1CaloPhase1 = True
88  flags.IOVDb.GlobalTag = 'CONDBR2-BLKPA-2023-01'
89 
90  import glob
91  runNumber = options.runNumber
92  flags.Input.Files = glob.glob("/eos/atlas/atlastier0/rucio/data23_13p6TeV/physics_Mistimed/"+runNumber+"/data23_13p6TeV."+runNumber+".physics_Mistimed.merge.RAW/data23_13p6TeV."+runNumber+".physics_Mistimed.merge.RAW._lb*._SFO-ALL._0001.1")
93 
94  flags.Trigger.DecisionMakerValidation.Execute=False
95  flags.Trigger.DecisionMakerValidation.ErrorMode=False
96 
97  flags.Output.HISTFileName = "MistimedPhI_"+runNumber+".root"
98  flags.lock()
99 
100  # create basic infrastructure
101  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
102  sysAcc = MainServicesCfg(flags)
103 
104  # debug printout
105  sysAcc.printConfig(withDetails=True, summariseProps=True)
106 
107  # add the algorithm to the configuration
108  sysAcc.merge(mistimedAlg(flags))
109 
110  # run the job
111  status = sysAcc.run()
112 
113  # report the execution status (0 ok, else error)
114  import sys
115  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
MistimedStreamPhI_runStandalone.mistimedAlg
def mistimedAlg(flags)
Definition: MistimedStreamPhI_runStandalone.py:6
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
MistimedStreamMonitorAlgorithm.MistimedStreamMonitorConfig
def MistimedStreamMonitorConfig(flags)
Definition: MistimedStreamMonitorAlgorithm.py:6
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
L1CaloFEXByteStreamConfig.gFexByteStreamToolCfg
def gFexByteStreamToolCfg(flags, name, *writeBS=False)
Definition: L1CaloFEXByteStreamConfig.py:148
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:133