ATLAS Offline Software
WriteCaloTopoEMCorrections.py
Go to the documentation of this file.
1 #!/usr/bin/env athena.py
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration.
3 #
4 # File: CaloClusterCorrection/python/WriteCaloTopoEMCorrections.py
5 # Author: scott snyder <snyder@bnl.gov>
6 # Date: May 2024, from old config version
7 # Purpose: Write cluster correction constants to pool+cool.
8 #
9 
10 
11 CALOCORR_POOLFILE = 'CaloTopoEMCorrections.pool.root'
12 CALOCORR_COOLFILE = 'topoemcool.db'
13 CaloTopoEMCorrKeys = ['ele633', 'ele420', 'gam633']
14 
15 
16 from AthenaConfiguration.MainServicesConfig import \
17  MainServicesCfg
18 from CaloClusterCorrection.WriteCorrectionsConfig import \
19  WriteCorrectionsFlags, WriteCorrectionsCfg
20 
21 flags = WriteCorrectionsFlags (CALOCORR_COOLFILE)
22 cfg = MainServicesCfg (flags)
23 
24 
25 from CaloClusterCorrection.CaloTopoEMCorrections import CaloTopoEMCorrections
26 from CaloClusterCorrection.constants import CALOCORR_EMTOPO
27 (corr_output_list, tag_list, ca) =\
28  CaloTopoEMCorrections.config_for_pool (flags,
29  CaloTopoEMCorrKeys,
30  CALOCORR_EMTOPO)
31 cfg.merge (ca)
32 
33 cfg.merge (WriteCorrectionsCfg (flags, CALOCORR_POOLFILE,
34  corr_output_list, tag_list))
35 
36 
37 sc = cfg.run (flags.Exec.MaxEvents)
38 import sys
39 sys.exit (sc.isFailure())