topSequence += theLArDBAlg

from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool
theLArBadChannelTool = LArBadChanTool()
theLArBadChannelTool.ReadFromASCII = True

theLArBadChannelTool.EMECAfile = InputFile
theLArBadChannelTool.HECAfile = InputFile
theLArBadChannelTool.FCALAfile = InputFile

theLArBadChannelTool.EMECCfile = InputFile
theLArBadChannelTool.HECCfile = InputFile
theLArBadChannelTool.FCALCfile = InputFile

theLArBadChannelTool.EMBAfile = InputFile
theLArBadChannelTool.EMBCfile = InputFile

theLArBadChannelTool.CoolFolder = ""
theLArBadChannelTool.CoolMissingFEBsFolder = ""

theLArBadChannelTool.OutputLevel = DEBUG
ToolSvc += theLArBadChannelTool

OutputList = ["CondAttrListCollection#" + Folder]
Tag = join(split(Folder, '/'), '') + TagPostfix
OutputTagList = [Tag]

from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
theOutputConditionsAlg = OutputConditionsAlg("OutputConditionsAlg",
                                             "dummy.pool.root", OutputList,
                                             OutputTagList, True)
from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr, ToolSvc)

theApp.EvtMax = 10

from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelTimingAlg
theTester = LArBadChannelTimingAlg()
theTester.ReallyCheck = True
topSequence += theTester

from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool
theLArBadChannelTool = LArBadChanTool()
theLArBadChannelTool.ReadFromASCII = False
theLArBadChannelTool.DumpCache = False

#theLArBadChannelTool.EMBAfile = "badchan1.txt"
theLArBadChannelTool.EMBCfile = "badchan1.txt"

theLArBadChannelTool.OutputLevel = DEBUG
ToolSvc += theLArBadChannelTool

svcMgr.IOVDbSvc.Folders += [
    "/LAR/ElecCalib/BadChannels<tag>TestTag</tag><dbConnection>sqlite://;schema=BadChannels.db;dbname=CONDBR2</dbConnection>"
]

svcMgr += CfgMgr.AthenaEventLoopMgr(OutputLevel=WARNING)

from AthenaCommon.AppMgr import theAuditorSvc
from AthenaCommon.ConfigurableDb import getConfigurable
theAuditorSvc += getConfigurable("MemStatAuditor")(OutputLevel=WARNING)
theAuditorSvc += getConfigurable("ChronoAuditor")()
theAuditorSvc += getConfigurable("NameAuditor")()