Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CaloAddPedShiftConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentFactory import CompFactory
4 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5 from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
6 
7 from IOVDbSvc.IOVDbSvcConfig import addFolders
8 
9 def CaloAddPedShiftCfg(flags,fileName="",output="ped.root"):
10 
11  #msg = logging.getLogger("CaloAddPedShiftCfg")
12  result=ComponentAccumulator()
13 
14  from LArGeoAlgsNV.LArGMConfig import LArGMCfg
15  result.merge(LArGMCfg(flags))
16  from TileGeoModel.TileGMConfig import TileGMCfg
17  result.merge(TileGMCfg(flags))
18 
19  from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg
20  result.merge(LArOnOffIdMappingCfg(flags))
21 
22 
23  folder= '/CALO/Ofl/Pedestal/CellPedestal'
24  result.merge(addFolders(flags,folder,'CALO_OFL',className="CondAttrListCollection"))
25 
26  result.addEventAlgo(CompFactory.CaloAddCellPedShift(FolderName=folder,inputFile=fileName))
27 
28 
29  import os
30  rootfile="ped_data.root"
31  if os.path.exists(rootfile):
32  os.remove(rootfile)
33  result.addService(CompFactory.THistSvc(Output = ["file1 DATAFILE='"+output+"' OPT='RECREATE'"]))
34  result.setAppProperty("HistogramPersistency","ROOT")
35 
36  return result
37 
38 
39 if __name__=="__main__":
40  import argparse
41  parser= argparse.ArgumentParser(description="CaloCell Pedestal shift")
42  parser.add_argument('-t', '--globaltag', type=str, help="Global conditions tag ")
43  parser.add_argument('-i','--input', type=str, default="", help="Input text file")
44  parser.add_argument('-o', '--output',type=str,default="cellped_data.root",help="name for root output files")
45  args = parser.parse_args()
46  print(args)
47 
48  from AthenaConfiguration.AllConfigFlags import initConfigFlags
49  flags = initConfigFlags()
50  flags.Input.RunNumbers=[0xFFFFFFE,]
51  flags.Input.Files=[]
52  flags.IOVDb.DatabaseInstance="CONDBR2"
53  from AthenaConfiguration.TestDefaults import defaultGeometryTags, defaultConditionsTags
54  flags.IOVDb.GlobalTag = defaultConditionsTags.RUN3_DATA
55  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
56 
57  if args.globaltag:
58  flags.IOVDb.GlobalTag=args.globaltag
59 
60  flags.lock()
62  cfg.merge(CaloAddPedShiftCfg(flags,args.input,args.output))
63 
64  print("Start running...")
65  cfg.run(1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainEvgenServicesCfg
def MainEvgenServicesCfg(flags, LoopMgr="AthenaEventLoopMgr", withSequences=True)
Definition: MainServicesConfig.py:353
python.IOVDbSvcConfig.addFolders
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
Definition: IOVDbSvcConfig.py:81
LArCablingConfig.LArOnOffIdMappingCfg
def LArOnOffIdMappingCfg(configFlags)
Definition: LArCablingConfig.py:62
LArGMConfig.LArGMCfg
def LArGMCfg(flags)
Definition: LArGMConfig.py:8
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.CaloAddPedShiftConfig.CaloAddPedShiftCfg
def CaloAddPedShiftCfg(flags, fileName="", output="ped.root")
Definition: CaloAddPedShiftConfig.py:9
TileGMConfig.TileGMCfg
def TileGMCfg(flags)
Definition: TileGMConfig.py:7