ATLAS Offline Software
WriteCorrectionsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
2 #
3 # File: CaloClusterCorrection/python/WriteCorrectionsConfig.py
4 # Author: scott snyder <snyder@bnl.gov>
5 # Date: May 2024, from old config version
6 # Purpose: Helpers for configuring jobs to write correction constants.
7 #
8 
9 
10 from AthenaConfiguration.ComponentFactory import CompFactory
11 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
12 
13 
14 def WriteCorrectionsFlags (coolfile):
15  from AthenaConfiguration.AllConfigFlags import initConfigFlags
16  from Campaigns.Utils import Campaign
17 
18  flags = initConfigFlags()
19  flags.Exec.MaxEvents = 1
20  flags.Input.isMC = True
21  flags.IOVDb.DBConnection = f'sqlite://;schema=${coolfile};dbname=OFLP200'
22  flags.IOVDb.GlobalTag = 'None'
23  flags.IOVDb.DatabaseInstance = ''
24  flags.Input.MCCampaign = Campaign.Unknown
25  flags.fillFromArgs()
26  flags.lock()
27  return flags
28 
29 
30 def WriteCorrectionsCfg (flags, poolfile,
31  corr_output_list,
32  tag_list):
33  cfg = ComponentAccumulator()
34 
35  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
36  cfg.merge (OutputConditionsAlgCfg (flags,
37  outputFile = poolfile,
38  ObjectList = corr_output_list,
39  WriteIOV = True,
40  IOVTagList = tag_list))
41 
42  from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
43  cfg.merge (IOVDbSvcCfg (flags))
44 
45  cfg.addService (CompFactory.IOVRegistrationSvc (writeKeyInfo = False))
46  return cfg
47 
WriteCorrectionsConfig.WriteCorrectionsCfg
def WriteCorrectionsCfg(flags, poolfile, corr_output_list, tag_list)
Definition: WriteCorrectionsConfig.py:30
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
WriteCorrectionsConfig.WriteCorrectionsFlags
def WriteCorrectionsFlags(coolfile)
Definition: WriteCorrectionsConfig.py:14
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19