ATLAS Offline Software
CaloGetLCDMConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 def GetLCDMCfg(flags):
7 
9 
10  GetLCDM = CompFactory.GetLCDeadMaterial("GetLCDM")
11 
12  GetLCDM.HadDMCoeffInputFile = "CaloHadDMCoeff_init_v2.txt"
13 
14  GetLCDM.HadDMCoeffOutputFile = flags.LCW.outDirDM+"/CaloLocalHadCoeff_output_"+flags.LCW.outsfxDM+".txt"
15  GetLCDM.ReportProfiles = flags.LCW.outDirDM+"/report_CaloLocalHadCoeff_profiles_"+flags.LCW.outsfxDM+".ps"
16  GetLCDM.ReportMinimization = flags.LCW.outDirDM+"/report_CaloLocalHadCoeff_minim_"+flags.LCW.outsfxDM+".ps"
17  GetLCDM.ReportCheck = flags.LCW.outDirDM+"/report_CaloLocalHadCoeff_check_"+flags.LCW.outsfxDM+".ps"
18 
19 
20  GetLCDM.DoFit = True
21  GetLCDM.DoMinimization = True
22  GetLCDM.DoPool = True
23  GetLCDM.DoCheck = True
24  # new feature to run on dmtrees from di-jets
25  #GetLCDM.NormalizationTypeForFit="const"
26  #GetLCDM.NormalizationTypeForMinim="const"
27  #GetLCDM.ClassificationType = "particleid"
28 
29  GetLCDM.InputRootFiles = flags.LCW.inRootDM
30 
31  GetLCDM.CorrectionKey="HadDMCoeff2"
32 
33  cfg.addEventAlgo(GetLCDM)
34 
35  # Output pool+sqlite
36  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
37  cfg.merge(OutputConditionsAlgCfg(flags,
38  outputFile=flags.LCW.outDirDM+"/"+flags.LCW.outsfxDM+".pool.root",
39  ObjectList=["CaloLocalHadCoeff#HadDMCoeff2#/CALO/HadCalibration2/CaloDMCorr2",],
40  IOVTagList=[flags.LCW.outTagDM,],
41  WriteIOV = True,
42  Run1 = 0,
43  Run2 = 0x7FFFFFFF
44  ))
45 
46  return cfg
47 
48 
49 if __name__=="__main__":
50  from AthenaConfiguration.AllConfigFlags import initConfigFlags
51  flags = initConfigFlags()
52  from CaloLocalHadCalib.LCWConfigFlags import addLCWFlags
53  addLCWFlags(flags)
54 
55 
56  flags.fillFromArgs()
57 
58  # inputless job
59  flags.Input.Files=[]
60 
61  # for debugging
62  from AthenaCommon.Constants import DEBUG
63  flags.Exec.OutputLevel=DEBUG
64 
65  # choose input file
66  flags.LCW.inRootDM = ["dmc.root"]
67 
68  # output sqlite
69  flags.IOVDb.DatabaseInstance=""
70  flags.IOVDb.DBConnection = "sqlite://;schema=myDm.db;dbname=OFLP200"
71 
72  flags.lock()
73 
74  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
75  cfg = MainServicesCfg(flags)
76  from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
77  cfg.merge(IOVDbSvcCfg(flags))
78 
79  cfg.merge(GetLCDMCfg(flags))
80 
81  cfg.getService("AthenaPoolCnvSvc").PoolAttributes += [ "STREAM_MEMBER_WISE = '0'" ]
82 
83  # for debugging purposes:
84  cfg.getService("StoreGateSvc").Dump=True
85  cfg.getService("MessageSvc").defaultLimit=999999
86 
87  cfg.run(1)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.IOVDbSvcConfig.IOVDbSvcCfg
def IOVDbSvcCfg(flags, **kwargs)
Definition: IOVDbSvcConfig.py:19
CaloGetLCDMConfig.GetLCDMCfg
def GetLCDMCfg(flags)
Definition: CaloGetLCDMConfig.py:6
LCWConfigFlags.addLCWFlags
def addLCWFlags(flags)
Definition: LCWConfigFlags.py:3
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19