Skip to content
Snippets Groups Projects
Commit bce26ef3 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'add-precision-calo-to-electron-chain' into 'master'

Add precision calo to electron chain

See merge request atlas/athena!39075
parents 58f07736 dcd998f5
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!39075Add precision calo to electron chain
...@@ -76,7 +76,7 @@ def getTopoClusterLocalCalibTools(configFlags): ...@@ -76,7 +76,7 @@ def getTopoClusterLocalCalibTools(configFlags):
LCDeadMaterial = CaloLCDeadMaterialTool("LCDeadMaterial") LCDeadMaterial = CaloLCDeadMaterialTool("LCDeadMaterial")
LCDeadMaterial.HadDMCoeffKey = "HadDMCoeff2" LCDeadMaterial.HadDMCoeffKey = "HadDMCoeff2"
LCDeadMaterial.ClusterRecoStatus = 0 LCDeadMaterial.ClusterRecoStatus = 0
LCDeadMaterial.WeightModeDM = 2 LCDeadMaterial.WeightModeDM = 2
LCDeadMaterial.UseHadProbability = True LCDeadMaterial.UseHadProbability = True
LCDeadMaterial.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute LCDeadMaterial.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
...@@ -101,13 +101,13 @@ def getTopoMoments(configFlags): ...@@ -101,13 +101,13 @@ def getTopoMoments(configFlags):
TopoMoments.MaxAxisAngle = 20*deg TopoMoments.MaxAxisAngle = 20*deg
TopoMoments.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise TopoMoments.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise
TopoMoments.MinBadLArQuality = 4000 TopoMoments.MinBadLArQuality = 4000
TopoMoments.MomentsNames = ["FIRST_PHI" TopoMoments.MomentsNames = ["FIRST_PHI"
,"FIRST_ETA" ,"FIRST_ETA"
,"SECOND_R" ,"SECOND_R"
,"SECOND_LAMBDA" ,"SECOND_LAMBDA"
,"DELTA_PHI" ,"DELTA_PHI"
,"DELTA_THETA" ,"DELTA_THETA"
,"DELTA_ALPHA" ,"DELTA_ALPHA"
,"CENTER_X" ,"CENTER_X"
,"CENTER_Y" ,"CENTER_Y"
,"CENTER_Z" ,"CENTER_Z"
...@@ -115,12 +115,12 @@ def getTopoMoments(configFlags): ...@@ -115,12 +115,12 @@ def getTopoMoments(configFlags):
,"CENTER_LAMBDA" ,"CENTER_LAMBDA"
,"LATERAL" ,"LATERAL"
,"LONGITUDINAL" ,"LONGITUDINAL"
,"FIRST_ENG_DENS" ,"FIRST_ENG_DENS"
,"ENG_FRAC_EM" ,"ENG_FRAC_EM"
,"ENG_FRAC_MAX" ,"ENG_FRAC_MAX"
,"ENG_FRAC_CORE" ,"ENG_FRAC_CORE"
,"FIRST_ENG_DENS" ,"FIRST_ENG_DENS"
,"SECOND_ENG_DENS" ,"SECOND_ENG_DENS"
,"ISOLATION" ,"ISOLATION"
,"ENG_BAD_CELLS" ,"ENG_BAD_CELLS"
,"N_BAD_CELLS" ,"N_BAD_CELLS"
...@@ -222,7 +222,7 @@ def getTopoCalibMoments(configFlags): ...@@ -222,7 +222,7 @@ def getTopoCalibMoments(configFlags):
,"ENG_CALIB_FRAC_EM" ,"ENG_CALIB_FRAC_EM"
,"ENG_CALIB_FRAC_HAD" ,"ENG_CALIB_FRAC_HAD"
,"ENG_CALIB_FRAC_REST"] ,"ENG_CALIB_FRAC_REST"]
TopoCalibMoments.CalibrationHitContainerNames = ["LArCalibrationHitInactive" TopoCalibMoments.CalibrationHitContainerNames = ["LArCalibrationHitInactive"
,"LArCalibrationHitActive" ,"LArCalibrationHitActive"
,"TileCalibHitActiveCell" ,"TileCalibHitActiveCell"
...@@ -231,43 +231,11 @@ def getTopoCalibMoments(configFlags): ...@@ -231,43 +231,11 @@ def getTopoCalibMoments(configFlags):
,"TileCalibHitDeadMaterial"] ,"TileCalibHitDeadMaterial"]
return TopoCalibMoments return TopoCalibMoments
# Steering options for trigger def CaloTopoClusterToolCfg(configFlags, cellsname):
# Maybe offline reco options should be extracted from flags elsewhere
def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib=None,sequenceName='AthAlgSeq'):
result=ComponentAccumulator() result=ComponentAccumulator()
if (sequenceName != 'AthAlgSeq'):
from AthenaCommon.CFElements import seqAND
#result.mainSeq( seqAND( sequenceName ) )
result.addSequence( seqAND(sequenceName) )
if not clustersname:
clustersname = "CaloTopoClusters"
from LArGeoAlgsNV.LArGMConfig import LArGMCfg
from TileGeoModel.TileGMConfig import TileGMCfg
from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
# Schedule total noise cond alg
result.merge(CaloNoiseCondAlgCfg(configFlags,"totalNoise"))
# Schedule electronic noise cond alg (needed for LC weights)
result.merge(CaloNoiseCondAlgCfg(configFlags,"electronicNoise"))
CaloTopoClusterMaker, CaloTopoClusterSplitter, CaloClusterMaker, CaloClusterSnapshot=CompFactory.getComps("CaloTopoClusterMaker","CaloTopoClusterSplitter","CaloClusterMaker","CaloClusterSnapshot",)
result.merge(LArGMCfg(configFlags))
from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
result.merge(LArHVScaleCfg(configFlags))
result.merge(TileGMCfg(configFlags))
if not doLCCalib:
theCaloClusterSnapshot=CaloClusterSnapshot(OutputName=clustersname+"snapshot",SetCrossLinks=True)
else:
theCaloClusterSnapshot=CaloClusterSnapshot(OutputName=clustersname,SetCrossLinks=True)
# maker tools # maker tools
TopoMaker = CaloTopoClusterMaker("TopoMaker") TopoMaker = CompFactory.CaloTopoClusterMaker("TopoMaker")
TopoMaker.CellsName = cellsname TopoMaker.CellsName = cellsname
TopoMaker.CalorimeterNames=["LAREM", TopoMaker.CalorimeterNames=["LAREM",
"LARHEC", "LARHEC",
...@@ -281,7 +249,7 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib ...@@ -281,7 +249,7 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib
"TileBar0", "TileBar1", "TileBar2", "TileBar0", "TileBar1", "TileBar2",
"TileExt0", "TileExt1", "TileExt2", "TileExt0", "TileExt1", "TileExt2",
"TileGap1", "TileGap2", "TileGap3", "TileGap1", "TileGap2", "TileGap3",
"FCAL0", "FCAL1", "FCAL2"] "FCAL0", "FCAL1", "FCAL2"]
TopoMaker.NeighborOption = "super3D" TopoMaker.NeighborOption = "super3D"
TopoMaker.RestrictHECIWandFCalNeighbors = False TopoMaker.RestrictHECIWandFCalNeighbors = False
TopoMaker.RestrictPSNeighbors = True TopoMaker.RestrictPSNeighbors = True
...@@ -294,18 +262,22 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib ...@@ -294,18 +262,22 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib
TopoMaker.CutOOTseed = configFlags.Calo.TopoCluster.extendTimeCut and configFlags.Calo.TopoCluster.doTimeCut TopoMaker.CutOOTseed = configFlags.Calo.TopoCluster.extendTimeCut and configFlags.Calo.TopoCluster.doTimeCut
TopoMaker.UseTimeCutUpperLimit = configFlags.Calo.TopoCluster.useUpperLimitForTimeCut TopoMaker.UseTimeCutUpperLimit = configFlags.Calo.TopoCluster.useUpperLimitForTimeCut
TopoMaker.TimeCutUpperLimit = 20.0 TopoMaker.TimeCutUpperLimit = 20.0
# note E or AbsE # note E or AbsE
# #
# the following property must be set to TRUE in order to make double # the following property must be set to TRUE in order to make double
# sided cuts on the seed and the cluster level # sided cuts on the seed and the cluster level
# #
TopoMaker.SeedCutsInAbsE = True TopoMaker.SeedCutsInAbsE = True
TopoMaker.ClusterEtorAbsEtCut = 0.0*MeV TopoMaker.ClusterEtorAbsEtCut = 0.0*MeV
# use 2-gaussian or single gaussian noise for TileCal # use 2-gaussian or single gaussian noise for TileCal
TopoMaker.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise TopoMaker.TwoGaussianNoise = configFlags.Calo.TopoCluster.doTwoGaussianNoise
result.setPrivateTools(TopoMaker)
TopoSplitter = CaloTopoClusterSplitter("TopoSplitter") return result
def CaloTopoClusterSplitterToolCfg(configFlags):
result=ComponentAccumulator()
TopoSplitter = CompFactory.CaloTopoClusterSplitter("TopoSplitter")
# cells from the following samplings will be able to form local # cells from the following samplings will be able to form local
# maxima. The excluded samplings are PreSamplerB, EMB1, # maxima. The excluded samplings are PreSamplerB, EMB1,
# PreSamplerE, EME1, all Tile samplings, all HEC samplings and the # PreSamplerE, EME1, all Tile samplings, all HEC samplings and the
...@@ -326,6 +298,45 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib ...@@ -326,6 +298,45 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib
TopoSplitter.ShareBorderCells = True TopoSplitter.ShareBorderCells = True
TopoSplitter.RestrictHECIWandFCalNeighbors = False TopoSplitter.RestrictHECIWandFCalNeighbors = False
TopoSplitter.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute TopoSplitter.WeightingOfNegClusters = configFlags.Calo.TopoCluster.doTreatEnergyCutAsAbsolute
result.setPrivateTools(TopoSplitter)
return result
# Steering options for trigger
# Maybe offline reco options should be extracted from flags elsewhere
def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib=None,sequenceName='AthAlgSeq'):
result=ComponentAccumulator()
if (sequenceName != 'AthAlgSeq'):
from AthenaCommon.CFElements import seqAND
#result.mainSeq( seqAND( sequenceName ) )
result.addSequence( seqAND(sequenceName) )
if not clustersname:
clustersname = "CaloTopoClusters"
from LArGeoAlgsNV.LArGMConfig import LArGMCfg
from TileGeoModel.TileGMConfig import TileGMCfg
from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
# Schedule total noise cond alg
result.merge(CaloNoiseCondAlgCfg(configFlags,"totalNoise"))
# Schedule electronic noise cond alg (needed for LC weights)
result.merge(CaloNoiseCondAlgCfg(configFlags,"electronicNoise"))
CaloClusterMaker, CaloClusterSnapshot=CompFactory.getComps("CaloClusterMaker","CaloClusterSnapshot",)
result.merge(LArGMCfg(configFlags))
from LArCalibUtils.LArHVScaleConfig import LArHVScaleCfg
result.merge(LArHVScaleCfg(configFlags))
result.merge(TileGMCfg(configFlags))
if not doLCCalib:
theCaloClusterSnapshot=CaloClusterSnapshot(OutputName=clustersname+"snapshot",SetCrossLinks=True)
else:
theCaloClusterSnapshot=CaloClusterSnapshot(OutputName=clustersname,SetCrossLinks=True)
TopoMaker = result.popToolsAndMerge( CaloTopoClusterToolCfg(configFlags, cellsname=cellsname))
TopoSplitter = result.popToolsAndMerge( CaloTopoClusterSplitterToolCfg(configFlags) )
# #
# the following options are not set, since these are the default # the following options are not set, since these are the default
# values # values
...@@ -333,13 +344,13 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib ...@@ -333,13 +344,13 @@ def CaloTopoClusterCfg(configFlags,cellsname="AllCalo",clustersname="",doLCCalib
# NeighborOption = "super3D", # NeighborOption = "super3D",
# NumberOfCellsCut = 4, # NumberOfCellsCut = 4,
# EnergyCut = 500*MeV, # EnergyCut = 500*MeV,
CaloTopoCluster=CaloClusterMaker(clustersname) CaloTopoCluster=CaloClusterMaker(clustersname)
CaloTopoCluster.ClustersOutputName=clustersname CaloTopoCluster.ClustersOutputName=clustersname
CaloTopoCluster.ClusterMakerTools = [TopoMaker, TopoSplitter] CaloTopoCluster.ClusterMakerTools = [TopoMaker, TopoSplitter]
from CaloBadChannelTool.CaloBadChanToolConfig import CaloBadChanToolCfg from CaloBadChannelTool.CaloBadChanToolConfig import CaloBadChanToolCfg
caloBadChanTool = result.popToolsAndMerge( CaloBadChanToolCfg(configFlags) ) caloBadChanTool = result.popToolsAndMerge( CaloBadChanToolCfg(configFlags) )
CaloClusterBadChannelList=CompFactory.CaloClusterBadChannelList CaloClusterBadChannelList=CompFactory.CaloClusterBadChannelList
...@@ -375,20 +386,20 @@ if __name__=="__main__": ...@@ -375,20 +386,20 @@ if __name__=="__main__":
ConfigFlags.lock() ConfigFlags.lock()
from AthenaConfiguration.MainServicesConfig import MainServicesCfg from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
cfg=MainServicesCfg(ConfigFlags) cfg=MainServicesCfg(ConfigFlags)
cfg.merge(PoolReadCfg(ConfigFlags)) cfg.merge(PoolReadCfg(ConfigFlags))
# from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg # from IOVDbSvc.IOVDbSvcConfig import IOVDbSvcCfg
# cfg.mergeAll(IOVDbSvcCfg(ConfigFlags)) # cfg.mergeAll(IOVDbSvcCfg(ConfigFlags))
theKey="CaloCalTopoClustersNew" theKey="CaloCalTopoClustersNew"
topoAcc=CaloTopoClusterCfg(ConfigFlags) topoAcc=CaloTopoClusterCfg(ConfigFlags)
topoAlg = topoAcc.getPrimary() topoAlg = topoAcc.getPrimary()
topoAlg.ClustersOutputName=theKey topoAlg.ClustersOutputName=theKey
cfg.merge(topoAcc) cfg.merge(topoAcc)
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
...@@ -405,11 +416,11 @@ if __name__=="__main__": ...@@ -405,11 +416,11 @@ if __name__=="__main__":
StreamName = 'StreamAOD' StreamName = 'StreamAOD'
) )
cfg.addEventAlgo(theNegativeEnergyCaloClustersThinner,"AthAlgSeq") cfg.addEventAlgo(theNegativeEnergyCaloClustersThinner,"AthAlgSeq")
# cfg.getService("StoreGateSvc").Dump=True # cfg.getService("StoreGateSvc").Dump=True
cfg.run(10) cfg.run(10)
#f=open("CaloTopoCluster.pkl","wb") #f=open("CaloTopoCluster.pkl","wb")
#cfg.store(f) #cfg.store(f)
#f.close() #f.close()
...@@ -1707,3 +1707,85 @@ class TrigCaloClusterCalibratorMT_LC(TrigCaloClusterCalibratorMT): ...@@ -1707,3 +1707,85 @@ class TrigCaloClusterCalibratorMT_LC(TrigCaloClusterCalibratorMT):
self.MonTool.defineHistogram('Eta', path='EXPERT', type='TH1F', title="Cluster #eta; #eta ; Number of Clusters", xbins=100, xmin=-2.5, xmax=2.5) self.MonTool.defineHistogram('Eta', path='EXPERT', type='TH1F', title="Cluster #eta; #eta ; Number of Clusters", xbins=100, xmin=-2.5, xmax=2.5)
self.MonTool.defineHistogram('Phi', path='EXPERT', type='TH1F', title="Cluster #phi; #phi ; Number of Clusters", xbins=64, xmin=-3.2, xmax=3.2) self.MonTool.defineHistogram('Phi', path='EXPERT', type='TH1F', title="Cluster #phi; #phi ; Number of Clusters", xbins=64, xmin=-3.2, xmax=3.2)
self.MonTool.defineHistogram('Eta,Phi', path='EXPERT', type='TH2F', title="Number of Clusters; #eta ; #phi ; Number of Clusters", xbins=100, xmin=-2.5, xmax=2.5, ybins=128, ymin=-3.2, ymax=3.2) self.MonTool.defineHistogram('Eta,Phi', path='EXPERT', type='TH2F', title="Number of Clusters; #eta ; #phi ; Number of Clusters", xbins=100, xmin=-2.5, xmax=2.5, ybins=128, ymin=-3.2, ymax=3.2)
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
def hltCaloCellMakerCfg(flags, FS=False, roisKey='UNSPECIFIED'):
acc = ComponentAccumulator()
from TrigT2CaloCommon.TrigCaloDataAccessConfig import trigCaloDataAccessSvcCfg
acc.merge(trigCaloDataAccessSvcCfg(flags))
cellMaker = CompFactory.HLTCaloCellMaker('HLTCaloCellMaker'+ ('FS' if FS else 'RoI'),
CellsName='CaloCells',
TrigDataAccessMT=acc.getService('TrigCaloDataAccessSvc'),
monitorCells=True,
ExtraInputs=[('TileEMScale', 'ConditionStore+TileEMScale'),
('TileBadChannels', 'ConditionStore+TileBadChannels'),
('LArOnOffIdMapping', 'ConditionStore+LArOnOffIdMap')], # TODO check if this depends on data/MC
RoIs=roisKey)
acc.addEventAlgo(cellMaker)
return acc
def hltTopoClusterMakerCfg(flags, FS=False):
acc = ComponentAccumulator()
from CaloRec.CaloTopoClusterConfig import CaloTopoClusterToolCfg, CaloTopoClusterSplitterToolCfg
topoMaker = acc.popToolsAndMerge(CaloTopoClusterToolCfg(flags, cellsname='CaloCells'))
topoSplitter = acc.popToolsAndMerge(CaloTopoClusterSplitterToolCfg(flags))
topoMoments = CompFactory.CaloClusterMomentsMaker ('TrigTopoMoments')
topoMoments.MaxAxisAngle = 20*deg
topoMoments.TwoGaussianNoise = flags.Calo.TopoCluster.doTwoGaussianNoise
topoMoments.MinBadLArQuality = 4000
topoMoments.MomentsNames = ['FIRST_PHI',
'FIRST_ETA',
'SECOND_R' ,
'SECOND_LAMBDA',
'DELTA_PHI',
'DELTA_THETA',
'DELTA_ALPHA' ,
'CENTER_X',
'CENTER_Y',
'CENTER_Z',
'CENTER_MAG',
'CENTER_LAMBDA',
'LATERAL',
'LONGITUDINAL',
'FIRST_ENG_DENS',
'ENG_FRAC_EM',
'ENG_FRAC_MAX',
'ENG_FRAC_CORE' ,
'FIRST_ENG_DENS',
'SECOND_ENG_DENS',
'ISOLATION',
'ENG_BAD_CELLS',
'N_BAD_CELLS',
'N_BAD_CELLS_CORR',
'BAD_CELLS_CORR_E',
'BADLARQ_FRAC',
'ENG_POS',
'SIGNIFICANCE',
'CELL_SIGNIFICANCE',
'CELL_SIG_SAMPLING',
'AVG_LAR_Q',
'AVG_TILE_Q'
]
from TrigEDMConfig.TriggerEDMRun3 import recordable
alg = CompFactory.TrigCaloClusterMakerMT('TrigCaloClusterMaker_topo'+('FS' if FS else 'RoI'),
Cells = 'CaloCells',
CaloClusters=recordable('HLT_TopoCaloClustersRoI'),
ClusterMakerTools = [ topoMaker, topoSplitter, topoMoments] # moments are missing yet
)
acc.addEventAlgo(alg)
return acc
def hltCaloTopoClusteringCfg(flags, FS=False, roisKey='UNSPECIFIED'):
acc = ComponentAccumulator()
acc.merge(hltCaloCellMakerCfg(flags, FS=FS, roisKey=roisKey))
acc.merge(hltTopoClusterMakerCfg(flags, FS=FS))
return acc
...@@ -4,9 +4,8 @@ from AthenaCommon.SystemOfUnits import GeV ...@@ -4,9 +4,8 @@ from AthenaCommon.SystemOfUnits import GeV
def _IncTool(name, threshold, sel): def _IncTool(name, threshold, sel):
from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionCaloHypoToolInc from AthenaConfiguration.ComponentFactory import CompFactory
tool = CompFactory.TrigEgammaPrecisionCaloHypoToolInc(name)
tool = TrigEgammaPrecisionCaloHypoToolInc( name )
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
monTool = GenericMonitoringTool("MonTool_"+name) monTool = GenericMonitoringTool("MonTool_"+name)
...@@ -22,7 +21,7 @@ def _IncTool(name, threshold, sel): ...@@ -22,7 +21,7 @@ def _IncTool(name, threshold, sel):
monTool.Histograms += [ defineHistogram('CutCounter', type='TH1I', path='EXPERT', title="PrecisionCalo Hypo Passed Cuts;Cut", monTool.Histograms += [ defineHistogram('CutCounter', type='TH1I', path='EXPERT', title="PrecisionCalo Hypo Passed Cuts;Cut",
xbins=13, xmin=-1.5, xmax=12.5, opt="kCumulative", xlabels=cuts) ] xbins=13, xmin=-1.5, xmax=12.5, opt="kCumulative", xlabels=cuts) ]
monTool.HistPath = 'PrecisionCaloHypo/'+tool.name() monTool.HistPath = 'PrecisionCaloHypo/'+tool.getName()
tool.MonTool = monTool tool.MonTool = monTool
......
...@@ -106,6 +106,8 @@ acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools ...@@ -106,6 +106,8 @@ acc.foreach_component("*/L1Decoder/*Tool").OutputLevel = DEBUG # tools
acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs acc.foreach_component("*HLTTop/*Hypo*").OutputLevel = DEBUG # hypo algs
acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = INFO # hypo tools acc.foreach_component("*HLTTop/*Hypo*/*Tool*").OutputLevel = INFO # hypo tools
acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters
acc.foreach_component("*/FPrecisionCalo").OutputLevel = DEBUG# filters
acc.foreach_component("*/CHElectronFTF").OutputLevel = DEBUG# filters
acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers acc.foreach_component("*HLTTop/*Input*").OutputLevel = DEBUG # input makers
acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = WARNING # messaging from the EDM creators
acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type) acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silcence mon tools (addressing by type)
......
# #
# Copyright (C) 2002-2010 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# #
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
......
...@@ -2,101 +2,129 @@ ...@@ -2,101 +2,129 @@
from TriggerMenuMT.HLTMenuConfig.Electron.ElectronRecoSequences import l2CaloRecoCfg, l2CaloHypoCfg from TriggerMenuMT.HLTMenuConfig.Electron.ElectronRecoSequences import l2CaloRecoCfg, l2CaloHypoCfg
from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CAMenuSequence, \ from TriggerMenuMT.HLTMenuConfig.Menu.MenuComponents import CAMenuSequence, \
ChainStep, Chain, createStepView, EmptyMenuSequence, InViewReco ChainStep, Chain, EmptyMenuSequence, InViewReco, SelectionCA
from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict from TrigEgammaHypo.TrigEgammaFastCaloHypoTool import TrigEgammaFastCaloHypoToolFromDict
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from TrigEDMConfig.TriggerEDMRun3 import recordable from TrigEDMConfig.TriggerEDMRun3 import recordable
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import getChainMultFromDict from TriggerMenuMT.HLTMenuConfig.Menu.DictFromChainName import getChainMultFromDict
def generateChains( flags, chainDict ): def generateChains(flags, chainDict):
import pprint
pprint.pprint( chainDict )
firstStepName = 'FastCaloElectron' def __fastCalo():
stepReco, stepView = createStepView(firstStepName) selAcc=SelectionCA('FastCaloElectron')
selAcc.mergeReco(l2CaloRecoCfg(flags))
accCalo = ComponentAccumulator() # this alg needs EventInfo decorated with the pileup info
accCalo.addSequence(stepView) from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
selAcc.merge(LumiBlockMuWriterCfg(flags))
l2CaloReco = l2CaloRecoCfg(flags) l2CaloHypo = l2CaloHypoCfg(flags,
accCalo.merge(l2CaloReco, sequenceName=stepReco.getName()) name='L2ElectronCaloHypo',
CaloClusters=recordable('HLT_FastCaloEMClusters'))
# this alg needs EventInfo decorated with the pileup info selAcc.addHypoAlgo(l2CaloHypo)
from LumiBlockComps.LumiBlockMuWriterConfig import LumiBlockMuWriterCfg
accCalo.merge( LumiBlockMuWriterCfg(flags) )
l2CaloHypo = l2CaloHypoCfg( flags, name = 'L2ElectronCaloHypo', fastCaloSequence = CAMenuSequence(selAcc,
CaloClusters = recordable('HLT_FastCaloEMClusters')) HypoToolGen=TrigEgammaFastCaloHypoToolFromDict)
accCalo.addEventAlgo(l2CaloHypo, sequenceName=stepView.getName()) # this cannot work for asymmetric combined chains....FP
return ChainStep(name=selAcc.name, Sequences=[fastCaloSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
fastCaloSequence = CAMenuSequence(accCalo, def __ftf():
HypoToolGen = TrigEgammaFastCaloHypoToolFromDict) selAcc=SelectionCA('ElectronFTF')
accCalo.printConfig() # # # fast ID (need to be customised because require secialised configuration of the views maker - i.e. parent has to be linked)
# this cannot work for asymmetric combined chains....FP name = "IMFastElectron"
fastCaloStep = ChainStep(name=firstStepName, Sequences=[fastCaloSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict)) evtViewMaker = CompFactory.EventViewCreatorAlgorithm(name,
ViewFallThrough = True,
RoIsLink = 'initialRoI',
RoITool = CompFactory.ViewCreatorInitialROITool(),
InViewRoIs = name+'RoIs',
Views = name+'Views',
ViewNodeName = name+"InView",
RequireParentView = True)
del name
from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg
idTracking = trigInDetFastTrackingCfg(flags, roisKey=evtViewMaker.InViewRoIs, signatureName="Electron")
secondStepName = 'ElectronFTF' fastInDetReco = InViewReco('FastElectron', viewMaker=evtViewMaker)
stepReco, stepView = createStepView(secondStepName) fastInDetReco.mergeReco(idTracking)
fastInDetReco.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(name='VDVElectronFastCalo',
DataObjects=[('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_FastCaloEMClusters')]) )
accTrk = ComponentAccumulator() from TrigEgammaHypo.TrigEgammaFastElectronFexMTConfig import fastElectronFexAlgCfg
accTrk.addSequence(stepView) fastInDetReco.mergeReco(fastElectronFexAlgCfg(flags, rois=evtViewMaker.InViewRoIs))
selAcc.mergeReco(fastInDetReco)
# # # fast ID (need to be customised because require secialised configuration of the views maker - i.e. parent has to be linked) fastElectronHypoAlg = CompFactory.TrigEgammaFastElectronHypoAlgMT()
name = "IMFastElectron" fastElectronHypoAlg.Electrons = 'HLT_FastElectrons'
evtViewMaker = CompFactory.EventViewCreatorAlgorithm(name, fastElectronHypoAlg.RunInView = True
ViewFallThrough = True, selAcc.addHypoAlgo(fastElectronHypoAlg)
RoIsLink = 'initialRoI',
RoITool = CompFactory.ViewCreatorInitialROITool(),
InViewRoIs = name+'RoIs',
Views = name+'Views',
ViewNodeName = name+"InView",
RequireParentView = True)
del name
from TrigInDetConfig.TrigInDetConfig import trigInDetFastTrackingCfg from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict
idTracking = trigInDetFastTrackingCfg(flags, roisKey=evtViewMaker.InViewRoIs, signatureName="Electron") fastInDetSequence = CAMenuSequence(selAcc,
HypoToolGen=TrigEgammaFastElectronHypoToolFromDict)
fastInDetReco = InViewReco("FastElectron", viewMaker=evtViewMaker) return ChainStep( name=selAcc.name, Sequences=[fastInDetSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
fastInDetReco.mergeReco(idTracking)
fastInDetReco.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(name='VDVElectronFastCalo',
DataObjects=[('xAOD::TrigEMClusterContainer', 'StoreGateSvc+HLT_FastCaloEMClusters')]))
from TrigEgammaHypo.TrigEgammaFastElectronFexMTConfig import fastElectronFexAlgCfg
fastInDetReco.mergeReco(fastElectronFexAlgCfg(flags, rois=evtViewMaker.InViewRoIs))
accTrk.merge(fastInDetReco, sequenceName=stepReco.getName())
fastElectronHypoAlg = CompFactory.TrigEgammaFastElectronHypoAlgMT()
fastElectronHypoAlg.Electrons = "HLT_FastElectrons"
fastElectronHypoAlg.RunInView = True
accTrk.addEventAlgo(fastElectronHypoAlg, sequenceName=stepView.getName())
from TrigEgammaHypo.TrigEgammaFastElectronHypoTool import TrigEgammaFastElectronHypoToolFromDict
fastInDetSequence = CAMenuSequence(accTrk,
HypoToolGen = TrigEgammaFastElectronHypoToolFromDict)
fastInDetStep = ChainStep( name=secondStepName, Sequences=[fastInDetSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
l1Thresholds=[] l1Thresholds=[]
for part in chainDict['chainParts']: for part in chainDict['chainParts']:
l1Thresholds.append(part['L1threshold']) l1Thresholds.append(part['L1threshold'])
# # # EF calo # # # Precision calo
def __precisonCalo():
recoAcc = InViewReco('ElectronRoITopoClusterReco')
recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(name='VDV'+recoAcc.name,
DataObjects=[('TrigRoiDescriptorCollection', recoAcc.inputMaker().InViewRoIs),
('CaloBCIDAverage', 'StoreGateSvc+CaloBCIDAverage')]))
from TrigCaloRec.TrigCaloRecConfig import hltCaloTopoClusteringCfg
recoAcc.mergeReco(hltCaloTopoClusteringCfg(flags,
FS=False,
roisKey=recoAcc.inputMaker().InViewRoIs)) # RoI
copier = CompFactory.egammaTopoClusterCopier('TrigEgammaTopoClusterCopierPrecisionCaloRoIs',
InputTopoCollection='HLT_TopoCaloClustersRoI',
OutputTopoCollection='HLT_CaloEMClusters',
OutputTopoCollectionShallow='tmp_HLT_CaloEMClusters')
recoAcc.addRecoAlgo(copier)
selAcc = SelectionCA('PrecisionCalo')
selAcc.mergeReco(recoAcc)
hypoAlg = CompFactory.TrigEgammaPrecisionCaloHypoAlgMT(name='ElectronPrecisionCaloHypo',
CaloClusters=recordable('HLT_CaloEMClusters'))
selAcc.addHypoAlgo(hypoAlg)
from TrigEgammaHypo.TrigEgammaPrecisionCaloHypoTool import TrigEgammaPrecisionCaloHypoToolFromDict
menuSequence = CAMenuSequence(selAcc,
HypoToolGen=TrigEgammaPrecisionCaloHypoToolFromDict)
return ChainStep(name=selAcc.name, Sequences=[menuSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
# # # Precison tracking # # # Precison tracking
# # # offline egamma # # # offline egamma
emptyStep = ChainStep(name="EmptyElStep", Sequences=[EmptyMenuSequence("EmptyElStep")], chainDicts=[chainDict]) emptyStep = ChainStep(name="EmptyElStep", Sequences=[EmptyMenuSequence("EmptyElStep")], chainDicts=[chainDict])
chain = Chain(chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[fastCaloStep, fastInDetStep, emptyStep, emptyStep]) chain = Chain(chainDict['chainName'], L1Thresholds=l1Thresholds,
ChainSteps=[__fastCalo(), __ftf(), __precisonCalo(), emptyStep, emptyStep,])
return chain return chain
if __name__ == "__main__":
# run with: python -m TriggerMenuMT.HLTMenuConfig.Electron.generateElectron
from AthenaCommon.Configurable import Configurable
Configurable.configurableRun3Behavior=1
from AthenaConfiguration.AllConfigFlags import ConfigFlags
from AthenaConfiguration.TestDefaults import defaultTestFiles
ConfigFlags.Input.Files = defaultTestFiles.RAW
ConfigFlags.lock()
from ..Menu.DictFromChainName import dictFromChainName
chain = generateChains(ConfigFlags, dictFromChainName('HLT_e26_L1EM15'))
for step in chain.steps:
for s in step.sequences:
if not isinstance(s, EmptyMenuSequence):
s.ca.printConfig(withDetails=True, summariseProps=False) # flip the last arg to see all settings
s.ca.wasMerged() # to silence check for orphanted CAs
...@@ -927,6 +927,21 @@ class InViewReco(ComponentAccumulator): ...@@ -927,6 +927,21 @@ class InViewReco(ComponentAccumulator):
def inputMaker( self ): def inputMaker( self ):
return self.viewMakerAlg return self.viewMakerAlg
class SelectionCA(ComponentAccumulator):
def __init__(self, name):
self.name = name
super( SelectionCA, self ).__init__()
self.stepRecoSequence, self.stepViewSequence = createStepView(name)
self.addSequence(self.stepViewSequence)
def mergeReco(self, other):
self.merge(other, sequenceName=self.stepRecoSequence.name)
def mergeHypo(self, other):
self.merge(other, sequenceName=self.stepViewSequence.name)
def addHypoAlgo(self, algo):
self.addEventAlgo(algo, sequenceName=self.stepViewSequence.name)
class RecoFragmentsPool(object): class RecoFragmentsPool(object):
""" Class to host all the reco fragments that need to be reused """ """ Class to host all the reco fragments that need to be reused """
......
...@@ -400,11 +400,11 @@ def generateChains( flags, chainDict ): ...@@ -400,11 +400,11 @@ def generateChains( flags, chainDict ):
l1Thresholds.append(part['L1threshold']) l1Thresholds.append(part['L1threshold'])
log.debug('dictionary is: %s\n', pprint.pformat(chainDict)) log.debug('dictionary is: %s\n', pprint.pformat(chainDict))
def _empty(name):
return ChainStep(name="EmptyNoL2MuComb", Sequences=[EmptyMenuSequence("EmptyNoL2MuComb")], chainDicts=[chainDict])
if 'msonly' in chainDict['chainName']: if 'msonly' in chainDict['chainName']:
emptyStep = ChainStep(name="EmptyNoL2MuComb", Sequences=[EmptyMenuSequence("EmptyNoL2MuComb")], chainDicts=[chainDict]) chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, _empty("EmptyNoL2MuComb"), efmuMSStep, _empty("EmptyNoEFCB"), _empty("JustEmpty") ] )
chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, emptyStep, efmuMSStep, emptyStep ] )
else: else:
chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, l2muCombStep, efmuMSStep, efmuCBStep ] ) chain = Chain( name=chainDict['chainName'], L1Thresholds=l1Thresholds, ChainSteps=[ l2muFastStep, l2muCombStep, efmuMSStep, efmuCBStep, _empty("JustEmpty") ] )
return chain return chain
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment