def __init__(self, name = "EFCaloHypoNoiseConfig",ef_thr=20*GeV,etaMin=0,etaMax=10): super( EFCaloHypoNoiseConfig, self ).__init__( name ) self.Etcut = ef_thr self.BadFEBCut=3 if 'COMP200' not in conddb.GetInstance() and not conddb.isMC: if not hasattr(svcMgr.ToolSvc, "KnownBADFEBsTool"): theBadFebTool=LArBadChanTool("KnownBADFEBsTool") theBadFebTool.CoolMissingFEBsFolder="/LAR/BadChannels/KnownBADFEBs" havefolder=False for fld in conddb.iovdbsvc.Folders: if "KnownBADFEBs" in fld: havefolder=True pass if not havefolder: conddb.addFolder("LAR_ONL","/LAR/BadChannels/KnownBADFEBs") svcMgr.ToolSvc+=theBadFebTool else: theBadFebTool=svcMgr.ToolSvc.KnownBADFEBsTool if not hasattr(svcMgr.ToolSvc, "KnownMNBFEBsTool"): theMNBFebTool=LArBadChanTool("KnownMNBFEBsTool") theMNBFebTool.CoolMissingFEBsFolder="/LAR/BadChannels/KnownMNBFEBs" havefolder=False for fld in conddb.iovdbsvc.Folders: if "KnownMNBFEBs" in fld: havefolder=True pass if not havefolder: conddb.addFolder("LAR_ONL","/LAR/BadChannels/KnownMNBFEBs") svcMgr.ToolSvc+=theMNBFebTool else: theMNBFebTool=svcMgr.ToolSvc.KnownMNBFEBsTool theLArNoisyROTool=LArNoisyROTool(SaturatedCellTightCut=20,MNBLooseCut=5,MNBTightCut=17,KnownBADFEBsTool=theBadFebTool,KnownMNBFEBsTool=theMNBFebTool) else: theLArNoisyROTool=LArNoisyROTool(SaturatedCellTightCut=20,MNBLooseCut=5,MNBTightCut=17) self.NoiseTool = theLArNoisyROTool
if IOVEndLB <= 0: svcMgr.EventSelector.FirstEvent = 1 else: svcMgr.EventSelector.FirstEvent = 0 svcMgr.EventSelector.FirstLB = IOVEndLB ## get a handle to the default top-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() ## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr, ToolSvc) conddb.addFolder("", folderStr + tagStr + dbStr) #conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs") svcMgr.IOVDbSvc.GlobalTag = "CONDBR2-ES1PA-2014-01" from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool = LArBadChanTool() theLArBadChannelTool.CoolFolder = folderStr theLArBadChannelTool.CoolMissingFEBsFolder = "" ToolSvc += theLArBadChannelTool from LArBadChannelTool.LArBadChannelToolConf import LArBadChannel2Ascii theLArBadChannels2Ascii = LArBadChannel2Ascii() theLArBadChannels2Ascii.FileName = OutputFile theLArBadChannels2Ascii.WithMissing = False theLArBadChannels2Ascii.ExecutiveSummaryFile = "" topSequence += theLArBadChannels2Ascii
def configure(self): from AthenaCommon.Logging import logging mlog = logging.getLogger('LArNoisyROSummaryGetter::configure:') mlog.info('entering') # get handle to upstream CaloCell object import traceback try: from CaloRec.CaloCellGetter import CaloCellGetter theCaloCellGetter = CaloCellGetter() except: mlog.error("could not get handle to CaloCell Quit") print traceback.format_exc() return False if not theCaloCellGetter.usable(): if not self.ignoreConfigError(): mlog.error("CaloCellGetter unusable. Quit.") return False else: mlog.error("CaloCellGetter unusable. Continue nevertheless") # now configure the algorithm # cannot have same name try: from LArCellRec.LArCellRecConf import LArNoisyROAlg, LArNoisyROTool except: mlog.error("could not import LArNoisyROAlg or LArNoisyROTool") print traceback.format_exc() return False from AthenaCommon.AppMgr import ToolSvc # Noise and MNB Febs from COOL only for data from AthenaCommon.GlobalFlags import globalflags from IOVDbSvc.CondDB import conddb if globalflags.DataSource.get_Value() != 'geant4' and ( 'COMP200' not in conddb.GetInstance()): from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theBadFebTool = LArBadChanTool("KnownBADFEBsTool") theBadFebTool.CoolMissingFEBsFolder = "/LAR/BadChannels/KnownBADFEBs" ToolSvc += theBadFebTool theMNBFebTool = LArBadChanTool("KnownMNBFEBsTool") theMNBFebTool.CoolMissingFEBsFolder = "/LAR/BadChannels/KnownMNBFEBs" ToolSvc += theMNBFebTool theLArNoisyROTool = LArNoisyROTool( PrintSummary=True, CellQualityCut=larNoisyROFlags.CellQualityCut(), BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(), BadFEBCut=larNoisyROFlags.BadFEBCut(), MNBLooseCut=larNoisyROFlags.MNBLooseCut(), MNBTightCut=larNoisyROFlags.MNBTightCut(), MNBTight_PsVetoCut=larNoisyROFlags.MNBTight_PsVetoCut(), KnownBADFEBsTool=theBadFebTool, KnownMNBFEBsTool=theMNBFebTool) else: theLArNoisyROTool = LArNoisyROTool( PrintSummary=True, CellQualityCut=larNoisyROFlags.CellQualityCut(), BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(), BadFEBCut=larNoisyROFlags.BadFEBCut(), ) pass theLArNoisyROAlg = LArNoisyROAlg() theLArNoisyROAlg.Tool = theLArNoisyROTool self._LArNoisyROMakerHandle = theLArNoisyROAlg theLArNoisyROAlg.OutputKey = self.outputKey() # register output in objKeyStore from RecExConfig.ObjKeyStore import objKeyStore objKeyStore.addStreamESD(self.outputType(), self.outputKey()) # now add algorithm to topSequence # this should always come at the end from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += theLArNoisyROAlg return True
## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) BadChanTag=join(split(BadChanFolder, '/'),'') + TagPostfix FEBTag=join(split(FEBFolder, '/'),'') + TagPostfix DBConnection = "<dbConnection>sqlite://;schema=BadChannels.db;dbname=CONDBR2</dbConnection>" DBBadChanFolder = BadChanFolder + "<tag>" + BadChanTag + "</tag>" + DBConnection DBFebFolder = FEBFolder + "<tag>" + FEBTag + "</tag>" + DBConnection svcMgr.IOVDbSvc.Folders+=[DBBadChanFolder] svcMgr.IOVDbSvc.Folders+=[DBFebFolder] #svcMgr.IOVDbSvc.Folders+=["/LAR/BadChannels/BadChannels<tag>LARBadChannelsBadChannels-M6-01</tag><dbConnection>sqlite://;schema=BadChannels.db;dbname=CONDBR2</dbConnection>" ] #svcMgr.IOVDbSvc.Folders+=["/LAR/BadChannels/MissingFEBs<tag>LARBadChannelsMissingFEBs-M6-01</tag><dbConnection>sqlite://;schema=BadChannels.db;dbname=CONDBR2</dbConnection>" ] #conddb.addFolder("LAR","/LAR/BadChannels/BadChannels") svcMgr.IOVDbSvc.GlobalTag=GlobalTag from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelToolTest theLArBadChannels=LArBadChannelToolTest() #theLArBadChannels.FileName="bc_out.txt" topSequence+=theLArBadChannels from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.OutputLevel=DEBUG theLArBadChannelTool.DumpCache = True theLArBadChannelTool.CoolMissingFEBsFolder = "/LAR/BadChannels/MissingFEBs" # read missing FEBs folder #theLArBadChannelTool.CoolMissingFEBsFolder = "" # deactivate missing FEBs folder ToolSvc+=theLArBadChannelTool
###### LAr Coverage Tool Configuration ############### from LArMonTools.LArMonToolsConf import LArCoverage theLArCoverage = LArCoverage(name="LArCoverage", ProcessNEvents=EventBlockSize, LArDigitContainerKey=LArMonFlags.LArDigitKey(), LArBadChannelMask=theLArBadChannelsMasker, Nevents=40) ToolSvc += theLArCoverage LArMon.AthenaMonTools += [theLArCoverage] # BadChannelTool configuration from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool = LArBadChanTool() theLArBadChannelTool.ReadFromASCII = False ToolSvc += theLArBadChannelTool ToolSvc.LArCoverage.LArBadChannelTool = theLArBadChannelTool # KnownMNBFEBsTool configuration if 'COMP200' not in conddb.GetInstance(): theMNBFebTool = LArBadChanTool("KnownMNBFEBsTool") theMNBFebTool.CoolMissingFEBsFolder = "/LAR/BadChannels/KnownMNBFEBs" ToolSvc += theMNBFebTool ToolSvc.LArCoverage.LArKnownMNBFEBsTool = theMNBFebTool # CaloNoiseTool configuration from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault theLArCoverageCaloNoiseTool = CaloNoiseToolDefault() ToolSvc += theLArCoverageCaloNoiseTool ToolSvc.LArCoverage.LArCaloNoiseTool = theLArCoverageCaloNoiseTool
svcMgr.EventSelector.FirstLB = LBNumber ## get a handle to the default top-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() ## get a handle to the ApplicationManager, to the ServiceManager and to the ToolSvc from AthenaCommon.AppMgr import (theApp, ServiceMgr as svcMgr,ToolSvc) if "sqlite" in dir(): conddb.addFolder("","/LAR/BadChannelsOfl/MissingFEBs<db>sqlite://;schema="+sqlite+";dbname="+DBInstance+"</db><tag>LARBadChannelsOflMissingFEBs-RUN2-UPD3-01</tag>") else: conddb.addFolder("LAR_OFL","/LAR/BadChannelsOfl/MissingFEBs")#<tag>LARBadChannelsMissingFEBs-empty</tag>") svcMgr.IOVDbSvc.GlobalTag="CONDBR2-ES1PA-2017-04" from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool theLArBadChannelTool=LArBadChanTool() theLArBadChannelTool.CoolFolder="" theLArBadChannelTool.CoolMissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" ToolSvc+=theLArBadChannelTool from LArBadChannelTool.LArBadChannelToolConf import LArBadFeb2Ascii theLArBadFeb2Ascii=LArBadFeb2Ascii() theLArBadFeb2Ascii.FileName=OutputFile topSequence+=theLArBadFeb2Ascii