ATLAS Offline Software
LArNoiseFromRawSkeleton.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 import sys
4 
5 from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
6 from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
7 from LArCafJobs.LArNoiseConfig import LArNoiseFromRawCfg
8 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
9 
10 
11 def fromRunArgs(runArgs):
12  from AthenaConfiguration.AllConfigFlags import initConfigFlags
13  flags=initConfigFlags()
14 
15  from LArCafJobs.LArNoiseFlags import addNoiseFlags
16  addNoiseFlags(flags)
17 
18  commonRunArgsToFlags(runArgs, flags)
19 
20  processPreInclude(runArgs, flags)
21  processPreExec(runArgs, flags)
22 
23  flags.Input.Files=runArgs.inputBSFile
24 
25  if hasattr(runArgs,"outputHIST_LARNOISEFile"):
26  flags.LArNoise.outHistLAr=runArgs.outputHIST_LARNOISEFile
27  flags.Output.HISTFileName =runArgs.outputHIST_LARNOISEFile
28 
29  if hasattr(runArgs,"outputNTUP_LARNOISEFile"):
30  flags.LArNoise.outNtupLAr=runArgs.outputNTUP_LARNOISEFile
31 
32  if hasattr(runArgs,"outputNTUP_HECNOISEFile"):
33  flags.LArNoise.HECNoiseNtup=runArgs.outputNTUP_HECNOISEFile
34 
35  if not hasattr(runArgs,"conditionsTag") or runArgs.conditionsTag=="CURRENT":
36  print("Resolving 'CURRENT' express conditions tag ...")
37  sys.path.append('/afs/cern.ch/user/a/atlcond/utils22/')
38  from CondUtilsLib.AtlCoolBKLib import resolveAlias
39  resolver=resolveAlias()
40  currentGlobalES=resolver.getCurrentES().replace("*","ST")
41  print("Found ",currentGlobalES)
42  flags.IOVDb.GlobalTag=currentGlobalES
43  else:
44  flags.IOVDb.GlobalTag=runArgs.conditionsTag
45 
46  if hasattr(runArgs,"skipEvents"):
47  flags.Exec.SkipEvents=runArgs.skipEvents
48 
49  if hasattr(runArgs,"maxEvents"):
50  flags.Exec.MaxEvents=runArgs.maxEvents
51 
52  from AthenaConfiguration.TestDefaults import defaultGeometryTags
53  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
54  flags.Trigger.triggerConfig = 'DB'
55  flags.Trigger.L1.doCTP = True
56  flags.Trigger.doID=False
57  flags.Trigger.doMuon=False
58  flags.Trigger.doLVL1=False
59  flags.Trigger.doHLT=False
60 
61  flags.Calo.Cell.doDeadCellCorr=True
62 
63  # To respect --athenaopts
64  flags.fillFromArgs()
65 
66  flags.lock()
67 
68  cfg=MainServicesCfg(flags)
69  cfg.merge(LArNoiseFromRawCfg(flags))
70 
71  #OFL LUMI tag not connected to ES tak, doing it here:
72  cfg.getService("IOVDbSvc").overrideTags+=['<prefix>/TRIGGER/OFLLUMI/OflPrefLumi</prefix><tag>OflPrefLumi-RUN2-UPD4-12</tag>']
73  processPostInclude(runArgs, flags, cfg)
74  processPostExec(runArgs, flags, cfg)
75 
76  # Run the final accumulator
77  sc = cfg.run()
78  sys.exit(not sc.isSuccess())
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
python.TransformUtils.processPreExec
def processPreExec(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:41
python.TransformUtils.processPostExec
def processPostExec(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:50
LArNoiseFlags.addNoiseFlags
def addNoiseFlags(flags)
Definition: LArNoiseFlags.py:3
python.TransformUtils.processPostInclude
def processPostInclude(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:69
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
LArNoiseFromRawSkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: LArNoiseFromRawSkeleton.py:11
LArNoiseConfig.LArNoiseFromRawCfg
def LArNoiseFromRawCfg(flags)
Definition: LArNoiseConfig.py:59
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70