10 """Return component accumulator with configured Tile sampling fraction conditions algorithm
13 flags -- Athena configuration flags
15 Source -- source of Tile SamplingFraction conditions (COOL, FILE). Defaults to COOL.
16 TileSamplingFraction -- name of Tile sampling fraction conditions object. Defaults to TileSamplingFraction.
21 source = kwargs.get(
'Source',
'COOL')
22 samplingFraction = kwargs.get(
'TileSamplingFraction',
'TileSamplingFraction')
24 name = samplingFraction +
'CondAlg'
29 samplingFractionFolder =
'/TILE/OFL02/CALIB/SFR'
31 TileCondProxyCoolFlt = CompFactory.getComp(
"TileCondProxyCool<TileCalibDrawerFlt>")
32 samplingFractionProxy =
TileCondProxyCoolFlt(
'TileCondProxyCool_SamplingFraction', Source = samplingFractionFolder)
34 samplingFractionTag =
None
35 from SimulationConfig.SimEnums
import LArParameterization
36 if flags.GeoModel.Run >= LHCPeriod.Run4
or flags.Overlay.DataOverlay
or flags.Sim.ISF.Simulator.usesFastCaloSim()
or flags.Sim.LArParameterization
is LArParameterization.FastCaloSim:
37 samplingFractionTag =
'TileOfl02CalibSfr-SIM-07'
39 from IOVDbSvc.IOVDbSvcConfig
import addFolders
40 acc.merge(
addFolders(flags, samplingFractionFolder + f
'<key>{samplingFractionFolder}</key>',
41 detDb=
'TILE_OFL', className=
'CondAttrListCollection', tag=samplingFractionTag, db=
'OFLP200') )
43 elif source ==
'FILE':
45 TileCondProxyFileFlt = CompFactory.getComp(
"TileCondProxyFile<TileCalibDrawerFlt>")
46 samplingFractionProxy =
TileCondProxyFileFlt(
'TileCondProxyFile_SamplingFraction', Source =
'TileDefault.sfr')
48 raise(Exception(
"Invalid source: %s" % source))
50 G4Version = flags.Sim.G4Version
51 G4VersionMajor, G4VersionMinor = G4Version.split(
".")[1:3]
52 G4V =
int(G4VersionMajor) * 100 +
int(G4VersionMinor)
54 TileSamplingFractionCondAlg = CompFactory.getComp(
"TileSamplingFractionCondAlg")
56 ConditionsProxy = samplingFractionProxy,
57 TileCondData = samplingFraction)
59 acc.addCondAlgo(samplingFractionCondAlg)