3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from IOVDbSvc.IOVDbSvcConfig
import addFolders
6 CaloNoiseCondAlg=CompFactory.CaloNoiseCondAlg
7 from AthenaCommon.Logging
import logging
8 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
12 if noisetype
not in (
"electronicNoise",
"pileupNoise",
"totalNoise"):
13 raise RuntimeError(
"Requested noise of unknown type %s" % noisetype)
15 noiseAlgName=
"Calo_"+noisetype+
"Alg"
18 log = logging.getLogger(
"CaloNoiseCondAlgCfg")
22 fixedLumi=flags.Calo.Noise.fixedLumiForNoise
23 useCaloLumi=flags.Calo.Noise.useCaloNoiseLumi
26 from AtlasGeoModel.GeoModelConfig
import GeoModelCfg
31 from LArCabling.LArCablingConfig
import LArOnOffIdMappingCfg
36 if flags.Common.isOnline:
37 log.info(
"Configuring CaloNoiseCondAlg for online case")
39 result.merge(
addFolders(flags,
"/CALO/Noise/CellNoise",
'CALO_ONL',className=
"CondAttrListCollection"))
40 theCaloNoiseAlg.CaloNoiseFolder=
"/CALO/Noise/CellNoise"
41 theCaloNoiseAlg.LArNoiseFolder=
""
42 theCaloNoiseAlg.TileNoiseFolder=
""
44 theCaloNoiseAlg.Luminosity = fixedLumi
45 log.info(
"online mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
48 lumiFolder=
'/CALO/Noise/PileUpNoiseLumi'
49 result.merge(
addFolders(flags,lumiFolder,
'CALO',className=
"CondAttrListCollection"))
50 theCaloNoiseAlg.LumiFolder = lumiFolder
51 theCaloNoiseAlg.Luminosity = -1.
52 log.info(
"online mode: use luminosity from /CALO/Noise/PileUpNoiseLumi to scale pileup noise")
54 theCaloNoiseAlg.Luminosity = 0.
55 log.info(
"online mode: ignore pileup noise")
57 result.addCondAlgo(theCaloNoiseAlg)
62 log.info(
"Configuring CaloNoiseCondAlg for MC data processing")
64 theCaloNoiseAlg.Luminosity=fixedLumi
65 log.info(
"Luminosity (in 10**33) units used for pileup noise from CaloNoiseFlags : %f", fixedLumi)
68 lumiFolder=
'/CALO/Ofl/Noise/PileUpNoiseLumi'
69 result.merge(
addFolders(flags,lumiFolder,
'CALO_OFL',className=
"CondAttrListCollection"))
70 log.info(
"offline mode: use luminosity from /CALO/Ofl/Noise/PileUpNoiseLumi to scale pileup noise")
71 theCaloNoiseAlg.LumiFolder = lumiFolder
72 theCaloNoiseAlg.Luminosity=-1.
74 estimatedLumi=flags.Beam.estimatedLuminosity
75 theCaloNoiseAlg.Luminosity=estimatedLumi/1e+33
76 log.info(
" Luminosity (in 10**33) units used for pileup noise from Beam flags: %f", theCaloNoiseAlg.Luminosity)
78 theCaloNoiseAlg.LArNoiseFolder=
"/LAR/NoiseOfl/CellNoise"
79 result.merge(
addFolders(flags,
"/LAR/NoiseOfl/CellNoise",
"LAR_OFL",className=
"CondAttrListCollection"))
80 theCaloNoiseAlg.TileNoiseFolder=
"/TILE/OFL02/NOISE/CELL"
81 result.merge(
addFolders(flags,
"/TILE/OFL02/NOISE/CELL",
"TILE_OFL",className=
"CondAttrListCollection"))
82 theCaloNoiseAlg.CaloNoiseFolder=
"/CALO/Ofl/Noise/CellNoise"
83 result.merge(
addFolders(flags,
"/CALO/Ofl/Noise/CellNoise",
"CALO_OFL",className=
"CondAttrListCollection"))
89 theCaloNoiseAlg.Luminosity = fixedLumi
90 log.info(
"offline mode: use fixed luminosity for scaling pileup noise: %f", fixedLumi)
92 theCaloNoiseAlg.Luminosity = -1
94 lumiFolder=
'/CALO/Ofl/Noise/PileUpNoiseLumi'
95 result.merge(
addFolders(flags,lumiFolder,
'CALO_OFL',className=
"CondAttrListCollection"))
96 log.info(
"offline mode: use luminosity from /CALO/Ofl/Noise/PileUpNoiseLumi to scale pileup noise")
98 lumiFolder =
'/TRIGGER/LUMI/LBLESTONL'
99 result.merge(
addFolders(flags,lumiFolder,
'TRIGGER_ONL',className=
"CondAttrListCollection"))
100 log.info(
"offline mode: use luminosity = f(Lumiblock) to scale pileup noise")
101 theCaloNoiseAlg.LumiFolder = lumiFolder
103 if flags.IOVDb.DatabaseInstance==
"CONDBR2":
104 log.info(
"Configuring CaloNoiseCondAlg for Run2 real data processing")
105 theCaloNoiseAlg.CaloNoiseFolder=
""
106 theCaloNoiseAlg.LArNoiseFolder=
"/LAR/NoiseOfl/CellNoise"
107 theCaloNoiseAlg.TileNoiseFolder=
"/TILE/OFL02/NOISE/CELL"
108 result.merge(
addFolders(flags,
"/LAR/NoiseOfl/CellNoise",
"LAR_OFL",className=
"CondAttrListCollection"))
109 result.merge(
addFolders(flags,
"/TILE/OFL02/NOISE/CELL",
"TILE_OFL",className=
"CondAttrListCollection"))
112 if flags.LAr.doHVCorr:
113 log.info(
"Run2 & doLArHVCorr=True: Will rescale noise automatically for HV trips")
114 theCaloNoiseAlg.useHVCorr=
True
115 from LArCalibUtils.LArHVScaleConfig
import LArHVScaleCfg
120 log.info(
"Configuring CaloNoiseCondAlg for Run1 real data processing")
122 theCaloNoiseAlg.CaloNoiseFolder=
"/CALO/Ofl/Noise/CellNoise"
123 theCaloNoiseAlg.LArNoiseFolder=
"/LAR/NoiseOfl/CellNoise"
124 theCaloNoiseAlg.TileNoiseFolder=
"/TILE/OFL02/NOISE/CELL"
125 result.merge(
addFolders(flags,
"/CALO/Ofl/Noise/CellNoise",
"CALO_OFL",className=
"CondAttrListCollection"))
126 result.merge(
addFolders(flags,
"/LAR/NoiseOfl/CellNoise",
"LAR_OFL",className=
"CondAttrListCollection"))
127 result.merge(
addFolders(flags,
"/TILE/OFL02/NOISE/CELL",
"TILE_OFL",className=
"CondAttrListCollection"))
132 result.addCondAlgo(theCaloNoiseAlg)
135 if __name__ ==
"__main__":
136 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
137 from AthenaConfiguration.TestDefaults
import defaultTestFiles
139 flags.Input.Files = defaultTestFiles.ESD
142 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
144 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg