10from AthenaConfiguration.AllConfigFlags
import initConfigFlags
11from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
13from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
14from AthenaConfiguration.ComponentFactory
import CompFactory
15from TileConditions.TileCablingSvcConfig
import TileCablingSvcCfg
16from TileConditions.TileSamplingFractionConfig
import TileSamplingFractionCondAlgCfg
17from LArConfiguration.LArElecCalibDBConfig
import LArElecCalibDBCfg
18from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
22 acc = ComponentAccumulator()
24 acc.addService(CompFactory.THistSvc(name=
"THistSvc", Output=[ f
"AANT DATAFILE='{flags.Output.HISTFileName}' OPT='RECREATE'" ]))
26 kwargs.setdefault(
'Calibration',
True)
28 acc.merge( TileCablingSvcCfg(flags) )
29 acc.merge( TileSamplingFractionCondAlgCfg(flags) )
30 acc.getCondAlgo(
'TileSamplingFractionCondAlg').G4Version=-1
31 requiredConditons=[
"Shape",
"AutoCorr",
"Noise",
"Pedestal",
"fSampl",
"MinBias"]
32 acc.merge(LArElecCalibDBCfg(flags,requiredConditons))
33 acc.merge(LArGMCfg(flags))
34 acc.addEventAlgo(CompFactory.LArFCalSamplingFraction(name, **kwargs))
38if __name__ ==
"__main__":
40 flags = initConfigFlags()
41 flags.IOVDb.GlobalTag =
'OFLCOND-MC23-SDR-RUN3-04'
42 flags.Input.Files = [
'test.root']
43 flags.Output.HISTFileName =
'LArFCal_SF.root'
44 flags.Exec.MaxEvents = -1
50 acc = MainServicesCfg(flags)
51 acc.merge(PoolReadCfg(flags))
53 acc.printConfig(withDetails=
True)
56 sys.exit( acc.run().isFailure() )
LarFCalSamplingFractionCfg(flags, name="LarFCalSamplingFraction", **kwargs)