Commit dc9f73ca authored by Tomasz Bold's avatar Tomasz Bold Committed by Johannes Elmsheuser
Browse files

Integrate precision tracking in electron chain

parent 3ac47c59
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentFactory import CompFactory
def _IncTool(name, tool=None):
if not tool:
from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionTrackingHypoTool
tool = TrigEgammaPrecisionTrackingHypoTool( name )
tool = CompFactory.TrigEgammaPrecisionTrackingHypoTool( name )
tool.AcceptAll = True
return tool
......
......@@ -48,6 +48,7 @@ flags.Exec.MaxEvents = 50
# TODO this two should be resolved in a smarter way (i.e. required passing the tag from the driver test, however now, parsing of string with - fails)
flags.IOVDb.GlobalTag = lambda f: 'OFLCOND-MC16-SDR-25' if f.Input.isMC else "CONDBR2-HLTP-2018-01"
flags.Common.isOnline = lambda f: not f.Input.isMC
flags.Common.MsgSourceLength=70
flags.Trigger.doLVL1=True # run L1 sim also on data
flags.Concurrency.NumThreads = 1
......@@ -127,7 +128,7 @@ acc.foreach_component("*HLTTop/RoRSeqFilter/*").OutputLevel = INFO# filters
acc.foreach_component("*/FPrecisionCalo").OutputLevel = INFO# filters
acc.foreach_component("*/CHElectronFTF").OutputLevel = INFO# filters
acc.foreach_component("*HLTTop/*Input*").OutputLevel = INFO # input makers
acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = DEBUG # messaging from the EDM creators
acc.foreach_component("*HLTTop/*HLTEDMCreator*").OutputLevel = INFO # messaging from the EDM creators
acc.foreach_component("*HLTTop/*GenericMonitoringTool*").OutputLevel = WARNING # silence mon tools (addressing by type)
if log.getEffectiveLevel() <= logging.DEBUG:
......
......@@ -63,7 +63,7 @@ def _ftf(flags, chainDict):
return ChainStep( name=selAcc.name, Sequences=[fastInDetSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
def _precisonCalo(flags, chainDict):
recoAcc = InViewRecoCA('ElectronRoITopoClusterReco')
recoAcc = InViewRecoCA('ElectronRoITopoClusterReco', RequireParentView = True)
recoAcc.addRecoAlgo(CompFactory.AthViews.ViewDataVerifier(name='VDV'+recoAcc.name,
DataObjects=[('TrigRoiDescriptorCollection', recoAcc.inputMaker().InViewRoIs),
('CaloBCIDAverage', 'StoreGateSvc+CaloBCIDAverage')]))
......@@ -71,7 +71,7 @@ def _precisonCalo(flags, chainDict):
from TrigCaloRec.TrigCaloRecConfig import hltCaloTopoClusteringCfg
recoAcc.mergeReco(hltCaloTopoClusteringCfg(flags,
namePrefix="Electron",
roisKey=recoAcc.inputMaker().InViewRoIs)) # RoI
roisKey=recoAcc.inputMaker().InViewRoIs) ) # RoI
copier = CompFactory.egammaTopoClusterCopier('TrigEgammaTopoClusterCopierPrecisionCaloRoIs',
InputTopoCollection='HLT_TopoCaloClustersRoI',
......@@ -90,6 +90,33 @@ def _precisonCalo(flags, chainDict):
return ChainStep(name=selAcc.name, Sequences=[menuSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
def _precisionTracking(flags, chainDict):
selAcc=SelectionCA('ElectronPrecision')
name = "IMPrecisionTrackingElectron"
evtViewMaker = CompFactory.EventViewCreatorAlgorithm(name,
ViewFallThrough = True,
RoIsLink = 'initialRoI',
RoITool = CompFactory.ViewCreatorPreviousROITool(),
InViewRoIs = flags.Trigger.InDetTracking.Electron.roi, #this will then be renamed to: flags.InDet.Tracking.roi
Views = name+'Views',
ViewNodeName = 'PrecisionElectronInView',
RequireParentView = True)
del name
precisionInDetReco = InViewRecoCA('PrecionTrackingElectron', viewMaker=evtViewMaker)
from TrigInDetConfig.TrigInDetConfig import trigInDetPrecisionTrackingCfg
idTracking = trigInDetPrecisionTrackingCfg(flags, signatureName="Electron")
precisionInDetReco.mergeReco(idTracking)
selAcc.mergeReco(precisionInDetReco)
from TrigEgammaHypo.TrigEgammaPrecisionTrackingHypoTool import TrigEgammaPrecisionTrackingHypoToolFromDict
hypoAlg = CompFactory.TrigEgammaPrecisionTrackingHypoAlg("ElectronprecisionEtcutHypo")
selAcc.addHypoAlgo(hypoAlg)
menuSequence = MenuSequenceCA(selAcc,
HypoToolGen=TrigEgammaPrecisionTrackingHypoToolFromDict)
return ChainStep(name=selAcc.name, Sequences=[menuSequence], chainDicts=[chainDict], multiplicity=getChainMultFromDict(chainDict))
def generateChains(flags, chainDict):
l1Thresholds=[]
......@@ -98,7 +125,10 @@ def generateChains(flags, chainDict):
# # # offline egamma
chain = Chain(chainDict['chainName'], L1Thresholds=l1Thresholds,
ChainSteps=[_fastCalo(flags, chainDict), _ftf(flags, chainDict), _precisonCalo(flags, chainDict)])
ChainSteps=[_fastCalo(flags, chainDict),
_ftf(flags, chainDict),
_precisonCalo(flags, chainDict),
_precisionTracking(flags, chainDict)])
return chain
......
......@@ -457,7 +457,7 @@ def generateDecisionTree(flags, chains):
for inIndex, input in enumerate(filterAlg.Input):
log.info("%s filered chains from input: %s : %s",
stepCounter, input, ", ".join(filterAlg.ChainsPerInput[inIndex]))
assert len(filterAlg.IOMapping) == len(filterAlg.Output), "Not all output will be filled in filter"
assert len(filterAlg.IOMapping) == len(filterAlg.Output), "Not all output will be filled in filter, while processing chain {}".format(chain.name)
imAlgs = findAllInputMakers( stepCounter, step.name )
for imAlg in imAlgs:
......
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from TriggerMenuMT.HLTMenuConfig.Menu.ChainDefInMenu import ChainProp
# def get_flag_item(chainName, L1itemsChainParts, groups):
# PhysicsStream = 'Main'
# if L1itemsChainParts == []:
# L1item = 'L1_'+chainName.split('_L1')[-1]
# L1thresholds = L1item.split('_')[1:]
# L1itemsChainParts = [L1item, L1thresholds ]
# elif L1itemsChainParts[0] is None:
# L1item = 'L1_'+chainName.split('_L1')[-1]
# L1itemsChainParts[0] = L1item
#return [chainName, L1itemsChainParts, [PhysicsStream], groups, -1]
def setupMenu():
"""
Assign chains for LS2_v1
......
......@@ -1044,7 +1044,7 @@ class InEventRecoCA( ComponentAccumulator ):
class InViewRecoCA(ComponentAccumulator):
""" Class to handle in-view reco, sets up the View maker if not provided and exposes InputMaker so that more inputs to it can be added in the process of assembling the menu """
def __init__(self, name, viewMaker=None, roisKey=None):
def __init__(self, name, viewMaker=None, roisKey=None, RequireParentView=None):
super( InViewRecoCA, self ).__init__()
self.name = name
self.mainSeq = seqAND( name )
......@@ -1054,6 +1054,8 @@ class InViewRecoCA(ComponentAccumulator):
if viewMaker:
self.viewMakerAlg = viewMaker
assert RequireParentView is None, "Can not specify viewMaker and settings (RequreParentView) of default ViewMaker"
assert roisKey is None, "Can not specify viewMaker and settings (roisKey) of default ViewMaker"
else:
self.viewMakerAlg = CompFactory.EventViewCreatorAlgorithm("IM"+name,
ViewFallThrough = True,
......@@ -1061,7 +1063,8 @@ class InViewRecoCA(ComponentAccumulator):
RoITool = ViewCreatorInitialROITool(),
InViewRoIs = roisKey if roisKey else name+'RoIs',
Views = name+'Views',
ViewNodeName = name+"InView")
ViewNodeName = name+"InView",
RequireParentView = RequireParentView if RequireParentView else False)
self.addEventAlgo( self.viewMakerAlg, self.mainSeq.name )
self.viewsSeq = parOR( self.viewMakerAlg.ViewNodeName )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment