Skip to content
Snippets Groups Projects
Commit d1dbdb0e authored by Adam Edward Barton's avatar Adam Edward Barton
Browse files

Merge branch 'afp-reorganize-reco-setup-ATR-24733' into 'master'

Reorganization of AFP trigger setup

Closes ATR-24733

See merge request atlas/athena!49651
parents 4a043c67 815eb606
No related branches found
No related tags found
No related merge requests found
Showing
with 297 additions and 376 deletions
...@@ -14,7 +14,7 @@ atlas_add_component( AFP_GlobReco ...@@ -14,7 +14,7 @@ atlas_add_component( AFP_GlobReco
# Install files from the package: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_python_modules( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
atlas_install_runtime( share/*.txt ) atlas_install_runtime( share/*.txt )
......
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
#============================================================== #==============================================================
# Job options file for the AFP_GlobReco package # Job options file for the AFP_GlobReco package
#============================================================== #==============================================================
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
from TrigEDMConfig.TriggerEDMRun3 import recordable
# side A = 0, side C = 1
afpProtonRecoToolA = CompFactory.getComp("AFP_ProtonRecoAnalytical")("AFP_ProtonRecoAnalyticalA", parametrizationFileName="param_mad_b1_def.txt", side=0) def AFP_GlobReco_Cfg(kwargs={}):
afpProtonRecoToolC = CompFactory.getComp("AFP_ProtonRecoAnalytical")("AFP_ProtonRecoAnalyticalC", parametrizationFileName="param_mad_b2_def.txt", side=1) # side A = 0, side C = 1
afpProtonRecoToolA = CompFactory.AFP_ProtonRecoAnalytical("AFP_ProtonRecoAnalyticalA", parametrizationFileName="param_mad_b1_def.txt", side=0, **kwargs)
protonsToolsList=[afpProtonRecoToolA, afpProtonRecoToolC] afpProtonRecoToolC = CompFactory.AFP_ProtonRecoAnalytical("AFP_ProtonRecoAnalyticalC", parametrizationFileName="param_mad_b2_def.txt", side=1, **kwargs)
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_GlobRecoTool::initialize() will complain protonsToolsList=[afpProtonRecoToolA, afpProtonRecoToolC]
outputProtonList=[]
for protonTool in protonsToolsList: # collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_GlobRecoTool::initialize() will complain
try: outputProtonList=[]
# in case the "protonsContainerName" is set for protonTool in protonsToolsList:
contName=getattr(protonTool, "protonsContainerName") try:
except AttributeError: # in case the "protonsContainerName" is set
# in case the "protonsContainerName" is not set contName=getattr(protonTool, "protonsContainerName")
contName=protonTool.getDefaultProperty("protonsContainerName") except AttributeError:
if contName not in outputProtonList: # in case the "protonsContainerName" is not set
outputProtonList.append(contName) contName=protonTool.getDefaultProperty("protonsContainerName")
if contName not in outputProtonList:
# prepare proton reco tool outputProtonList.append(contName)
protonRecoTool = CompFactory.getComp("AFP_GlobRecoTool")("AFP_GlobRecoTool", RecoToolsList=protonsToolsList, AFPProtonContainerList=outputProtonList )
# prepare proton reco tool
# actually setup the track reco protonRecoTool = CompFactory.AFP_GlobRecoTool("AFP_GlobRecoTool", RecoToolsList=protonsToolsList, AFPProtonContainerList=outputProtonList )
from AFP_GlobReco.AFP_GlobRecoConf import AFP_GlobReco
topSequence += AFP_GlobReco("AFP_GlobReco", recoTool = protonRecoTool) # actually setup the track reco
return CompFactory.AFP_GlobReco("AFP_GlobReco", recoTool = protonRecoTool)
def AFP_GlobReco_HLT():
AFP_Pr = AFP_GlobReco_Cfg({"AFPTrackContainerKey": "HLT_AFPTrackContainer", "protonsContainerName": recordable("HLT_AFPProtonContainer")})
return AFP_Pr
...@@ -16,5 +16,5 @@ atlas_add_component( AFP_LocReco ...@@ -16,5 +16,5 @@ atlas_add_component( AFP_LocReco
# Install files from the package: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_python_modules( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
#============================================================== #==============================================================
# Job options file for the AFP_LocReco package # Job options file for the AFP_LocReco package
#============================================================== #==============================================================
from AthenaCommon.GlobalFlags import globalflags
#-- SiD part ------------------------------------------------------------
# convert EventInfo to xAOD::EventInfo
if( not globalflags.InputFormat.is_bytestream() and ( not objKeyStore.isInInput( "xAOD::EventInfo") ) and ( not hasattr( topSequence, "xAODMaker::EventInfoCnvAlg" ) ) ):
from xAODEventInfoCnv.xAODEventInfoCnvAlgDefault import xAODEventInfoCnvAlgDefault
xAODEventInfoCnvAlgDefault (sequence = topSequence)
# get geometry tool
from AthenaConfiguration.ComponentFactory import CompFactory
afpGeometryTool = CompFactory.getComp("AFP_GeometryTool")("AFP_Geometry_tool")
# prepare clustering tool
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
clusterNeighbour = CompFactory.getComp("AFPSiClusterBasicNearestNeighbour")("AFPSiClusterBasicNearestNeighbour") from TrigEDMConfig.TriggerEDMRun3 import recordable
# it's also possible to get the same clustering tool as in AFPAnalysisToolbox
# clusterNeighbour = CompFactory.getComp("AFPSiClusterAllNeighbours")("AFPSiClusterAllNeighbours", neighbourhoodType="X") def AFP_LocReco_SiD_Cfg(kwargs={}):
rowColToLocal = CompFactory.getComp("AFPSiRowColToLocalCSTool")("AFPSiRowColToLocalCSTool", AFP_Geometry=afpGeometryTool) # prepare track reconstruction algorithm tools - one for each station
kalmanTool0 = CompFactory.AFPSiDBasicKalmanTool("AFPSiDBasicKalmanTool0", stationID=0, **kwargs)
clusterTool = CompFactory.getComp("AFPSiClusterTool")("AFPSiClusterTool", clusterAlgTool=clusterNeighbour, rowColToLocalCSTool = rowColToLocal)
# number of layers in each station, size of the vector determines number of stations
# actually setup the cluster reco # kalmanTool1.numberOfLayersInStation = 3
from AFP_SiClusterTools.AFP_SiClusterToolsConf import AFPSiCluster
topSequence += AFPSiCluster("AFPSiCluster", clusterRecoTool = clusterTool) # Maximal distance at which cluster can be joined to the track
# kalmanTool1.maxAllowedDistance = 10
# prepare track reconstruction algorithm tools - one for each station # Minimal number of clusters in track. If there are less clusters track is rejected
kalmanTool0 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool0", stationID=0) # kalmanTool1.minClustersNumber = 3
# number of layers in each station, size of the vector determines number of stations kalmanTool1 = CompFactory.AFPSiDBasicKalmanTool("AFPSiDBasicKalmanTool1", stationID=1, **kwargs)
# kalmanTool1.numberOfLayersInStation = 3 kalmanTool2 = CompFactory.AFPSiDBasicKalmanTool("AFPSiDBasicKalmanTool2", stationID=2, **kwargs)
kalmanTool3 = CompFactory.AFPSiDBasicKalmanTool("AFPSiDBasicKalmanTool3", stationID=3, **kwargs)
# Maximal distance at which cluster can be joined to the track
# kalmanTool1.maxAllowedDistance = 10 # it's also possible to have the same track reco tool as in AFPAnalysisToolbox
# linRegTool0 = CompFactory.AFPSiDLinRegTool("AFPSiDLinRegTool0", stationID=0, **kwargs)
# Minimal number of clusters in track. If there are less clusters track is rejected # linRegTool1 = CompFactory.AFPSiDLinRegTool("AFPSiDLinRegTool1", stationID=1, **kwargs)
# kalmanTool1.minClustersNumber = 3 # linRegTool2 = CompFactory.AFPSiDLinRegTool("AFPSiDLinRegTool2", stationID=2, **kwargs)
# linRegTool3 = CompFactory.AFPSiDLinRegTool("AFPSiDLinRegTool3", stationID=3, **kwargs)
kalmanTool1 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool1", stationID=1)
kalmanTool2 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool2", stationID=2) kalmanToolsList=[kalmanTool0, kalmanTool1, kalmanTool2, kalmanTool3]
kalmanTool3 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool3", stationID=3)
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain
# it's also possible to have the same track reco tool as in AFPAnalysisToolbox outputKalmanList=[]
# linRegTool0 = CompFactory.getComp("AFPSiDLinRegTool")("AFPSiDLinRegTool0", stationID=0) for kalmanTool in kalmanToolsList:
# linRegTool1 = CompFactory.getComp("AFPSiDLinRegTool")("AFPSiDLinRegTool1", stationID=1) try:
# linRegTool2 = CompFactory.getComp("AFPSiDLinRegTool")("AFPSiDLinRegTool2", stationID=2) # in case the "tracksContainerName" is set
# linRegTool3 = CompFactory.getComp("AFPSiDLinRegTool")("AFPSiDLinRegTool3", stationID=3) contName=getattr(kalmanTool, "tracksContainerName")
except AttributeError:
kalmanToolsList=[kalmanTool0, kalmanTool1, kalmanTool2, kalmanTool3] # in case the "tracksContainerName" is not set
contName=kalmanTool.getDefaultProperty("tracksContainerName")
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain if contName not in outputKalmanList:
outputKalmanList=[] outputKalmanList.append(contName)
for kalmanTool in kalmanToolsList:
try: # prepare track reco tool
# in case the "tracksContainerName" is set trackRecoTool = CompFactory.AFP_SIDLocRecoTool("AFP_SIDLocRecoTool", RecoToolsList=kalmanToolsList, AFPTrackContainerList=outputKalmanList )
contName=getattr(kalmanTool, "tracksContainerName")
except AttributeError: # actually setup the track reco
# in case the "tracksContainerName" is not set return CompFactory.AFP_SIDLocReco("AFP_SIDLocReco", recoTool = trackRecoTool)
contName=kalmanTool.getDefaultProperty("tracksContainerName")
if contName not in outputKalmanList:
outputKalmanList.append(contName) def AFP_LocReco_TD_Cfg(kwargs={}):
# prepare track reco tool # Prepare ToF reconstruction algorithm tools - one for each station
trackRecoTool = CompFactory.getComp("AFP_SIDLocRecoTool")("AFP_SIDLocRecoTool", RecoToolsList=kalmanToolsList, AFPTrackContainerList=outputKalmanList ) BarWeight = [1.0, 1.0, 1.0, 1.0]
TimeOffset0 = [ 105707, 105670, 105675, 105638,
# actually setup the track reco 105834, 105819, 105778, 105754,
from AFP_LocReco.AFP_LocRecoConf import AFP_SIDLocReco 105900, 105892, 105870, 105820,
topSequence += AFP_SIDLocReco("AFP_SIDLocReco", recoTool = trackRecoTool) 105953, 105924, 105905, 105877]
basicTool0 = CompFactory.AFPTDBasicTool("AFPTDBasicTool0", stationID=0, maxAllowedLength=100, TimeOffset=TimeOffset0, BarWeight=BarWeight, **kwargs)
#-- TiD part ------------------------------------------------------------
TimeOffset3 = [ 105796, 105761, 105742, 105696,
105890, 105871, 105839, 105816,
# Prepare ToF reconstruction algorithm tools - one for each station 105923, 105899, 105862, 105853,
BarWeight = [1.0, 1.0, 1.0, 1.0] 105953, 105930, 105908, 105879]
TimeOffset0 = [105707, 105670, 105675, 105638,
105834, 105819, 105778, 105754, basicTool3 = CompFactory.AFPTDBasicTool("AFPTDBasicTool3", stationID=3, maxAllowedLength=100, TimeOffset=TimeOffset3, BarWeight=BarWeight, **kwargs)
105900, 105892, 105870, 105820, basicToolsList=[basicTool0, basicTool3]
105953, 105924, 105905, 105877]
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain
basicTool0 = CompFactory.getComp("AFPTDBasicTool")("AFPTDBasicTool0", stationID=0, maxAllowedLength=100, TimeOffset=TimeOffset0, BarWeight=BarWeight) outputBasicList=[]
for basicTool in basicToolsList:
TimeOffset3 = [105796, 105761, 105742, 105696, try:
105890, 105871, 105839, 105816, # in case the "tracksContainerName" is set
105923, 105899, 105862, 105853, contName=getattr(basicTool, "tracksContainerName")
105953, 105930, 105908, 105879] except AttributeError:
# in case the "tracksContainerName" is not set
basicTool3 = CompFactory.getComp("AFPTDBasicTool")("AFPTDBasicTool3", stationID=3, maxAllowedLength=100, TimeOffset=TimeOffset3, BarWeight=BarWeight) contName=basicTool.getDefaultProperty("tracksContainerName")
basicToolsList=[basicTool0, basicTool3] if contName not in outputBasicList:
outputBasicList.append(contName)
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain
outputBasicList=[] # prepare track reco tool
for basicTool in basicToolsList: ToFtrackRecoTool = CompFactory.AFP_TDLocRecoTool("AFP_TDLocRecoTool", RecoToolsList=basicToolsList, AFPToFTrackContainerList=outputBasicList )
try:
# in case the "tracksContainerName" is set # actually setup the ToF track reco
contName=getattr(basicTool, "tracksContainerName") return CompFactory.AFP_TDLocReco("AFP_TDLocReco", recoTool=ToFtrackRecoTool)
except AttributeError:
# in case the "tracksContainerName" is not set
contName=basicTool.getDefaultProperty("tracksContainerName") def AFP_LocReco_SiD_HLT():
if contName not in outputBasicList:
outputBasicList.append(contName) AFP_SID = AFP_LocReco_SiD_Cfg({"tracksContainerName": recordable("HLT_AFPTrackContainer"), "AFPSiHitsClusterContainerKey": "HLT_AFPSiHitsClusterContainer"})
# prepare track reco tool from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
ToFtrackRecoTool = CompFactory.getComp("AFP_TDLocRecoTool")("AFP_TDLocRecoTool", RecoToolsList=basicToolsList, AFPToFTrackContainerList=outputBasicList )
monTool_AFP_SIDLocRecoTool = GenericMonitoringTool("MonTool_AFP_SIDLocRecoTool")
# actually setup the ToF track reco monTool_AFP_SIDLocRecoTool.defineHistogram( 'TrkSize', path='EXPERT', type='TH1F', title='AFP tracks size',xbins=50, xmin=0, xmax=100 )
from AFP_LocReco.AFP_LocRecoConf import AFP_TDLocReco AFP_SID.recoTool.MonTool = monTool_AFP_SIDLocRecoTool
topSequence += AFP_TDLocReco("AFP_TDLocReco", recoTool=ToFtrackRecoTool)
for i, kalmanTool in enumerate(AFP_SID.recoTool.RecoToolsList):
monTool_AFP_BasicKalman = GenericMonitoringTool("MonTool_AFP_"+kalmanTool.name())
monTool_AFP_BasicKalman.defineHistogram( 'TrkStationID', path='EXPERT', type='TH1F', title='Track station ID',xbins=4, xmin=0, xmax=4 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkXLocal', path='EXPERT', type='TH1F', title='Track xLocal',xbins=100, xmin=-200, xmax=200 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkYLocal', path='EXPERT', type='TH1F', title='Track yLocal',xbins=100, xmin=-30, xmax=30 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkZLocal', path='EXPERT', type='TH1F', title='Track zLocal',xbins=100, xmin=-500000, xmax=500000 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkXSlope', path='EXPERT', type='TH1F', title='Track x slope',xbins=100, xmin=-0.5, xmax=0.5 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkYSlope', path='EXPERT', type='TH1F', title='Track y slope',xbins=100, xmin=-0.5, xmax=0.5 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkNClusters', path='EXPERT', type='TH1F', title='Track number of clusters',xbins=100, xmin=0, xmax=100 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkNHoles', path='EXPERT', type='TH1F', title='Track number of holes',xbins=100, xmin=0, xmax=100 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkChi2', path='EXPERT', type='TH1F', title='Track chi2',xbins=50, xmin=0, xmax=10 )
AFP_SID.recoTool.RecoToolsList[i].MonTool = monTool_AFP_BasicKalman
return AFP_SID
def AFP_LocReco_TD_HLT():
AFP_TD = AFP_LocReco_TD_Cfg({"tracksContainerName": recordable("HLT_AFPToFTrackContainer")})
return AFP_TD
#-- SiAlignDBTester part ------------------------------------------------------------ #-- SiAlignDBTester part ------------------------------------------------------------
# this is a setup for ReadCondHandle (see AFP_DBTools/SiAlignDBTester) # this is a setup for ReadCondHandle (see AFP_DBTools/SiAlignDBTester)
......
#==============================================================
# Job options file for Geant4 Simulations
# AFP_LocReco
#==============================================================
#import jobOptionValues
#jobOptionValues=jobOptionValues
#strInputRootCollection = 'AFP_digi_step_100ev_203900_test18_r3.pool.root'
strInputRootCollection = 'AFP_digi_new.pool.root'
strOutputRootFile = 'AFP_locreco.root'
print strInputRootCollection
print strOutputRootFile
#--------------------------------------------------------------
# Load POOL support
include( "AthenaPoolCnvSvc/ReadAthenaPool_jobOptions.py" )
ServiceMgr.EventSelector.InputCollections = [strInputRootCollection]
#--------------------------------------------------------------
# Event related parameters
#theApp.EvtMax = jobOptionValues.iEventCountLocRecCorr
theApp.EvtMax = 63
#--------------------------------------------------------------
# Application: AthenaPoolTest options
theApp.Dlls += [ "AFP_TDLocReco" ]
theApp.TopAlg += [ "AFP_TDLocReco" ]
# AFP_LocReco properties
from AFP_LocReco.AFP_LocRecoConf import AFP_TDLocReco
# select between a real data or a simulation mode - Simulation = 0, RealData = 1
AFP_TDLocReco.DataType = 0
# select algo for timing reco
AFP_TDLocReco.ListAlgoTD = ["TDZVertex"]
AFP_TDLocReco.AmpThresh = 10.
#--------------------------------------------------------------
# Application: AthenaPoolTest options
theApp.Dlls += [ "AFP_SIDLocReco" ]
theApp.TopAlg += [ "AFP_SIDLocReco" ]
# AFP_LocReco properties
from AFP_LocReco.AFP_LocRecoConf import AFP_SIDLocReco
# select between a real data or a simulation mode - Simulation = 0, RealData = 1
AFP_SIDLocReco.DataType = 0
# select algo for timing reco
AFP_SIDLocReco.ListAlgoSID = ["SIDBasicKalman"]
AFP_SIDLocReco.AmpThresh = 5000.
#--------------------------------------------------------------
# Output options
# LAr Hit
# Converters:
include( "EventAthenaPool/EventAthenaPool_joboptions.py" )
#include( "AFP_EventAthenaPool/AFP_EventAthenaPool_joboptions.py" )
# ItemList:
include( "EventAthenaPool/EventAthenaPoolItemList_joboptions.py" )
#include( "AFP_EventAthenaPool/AFP_EventAthenaPoolItemList_joboptions.py" )
print fullItemList
from AthenaPoolCnvSvc.WriteAthenaPool import AthenaPoolOutputStream
Stream1 = AthenaPoolOutputStream( "Stream1" )
Stream1.OutputFile = strOutputRootFile
# List of DO's to write out - we don't use fullItemList, just list a
# few we want
#Stream1.ItemList += fullItemList
Stream1.ItemList+= ["EventInfo#*", "McEventCollection#TruthEvent"] # mc truth (hepmc)
#Stream1.ItemList+= ["AFP_TDDigiCollection#*"]
Stream1.ItemList+= ["AFP_TDLocRecoEvCollection#*"]
#Stream1.ItemList+= ["AFP_SiDigiCollection#*"]
Stream1.ItemList+= ["AFP_SIDLocRecoEvCollection#*"]
#--------------------------------------------------------------
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
MessageSvc = Service( "MessageSvc" )
MessageSvc.OutputLevel = 3
MessageSvc.defaultLimit = 9999999
ClassIDSvc = Service( "ClassIDSvc" )
ClassIDSvc.OutputLevel = 3
AthenaSealSvc.OutputLevel = 3
#--- End *.py file -------------------------------------------
...@@ -22,5 +22,5 @@ atlas_add_component( AFP_SiClusterTools ...@@ -22,5 +22,5 @@ atlas_add_component( AFP_SiClusterTools
# Install files from the package: # Install files from the package:
atlas_install_headers( AFP_SiClusterTools ) atlas_install_headers( AFP_SiClusterTools )
#atlas_install_joboptions( share/*.py )
atlas_install_python_modules( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
#==============================================================
# Job options file for the AFP_SiClusterTools package
#==============================================================
from AthenaConfiguration.ComponentFactory import CompFactory
from TrigEDMConfig.TriggerEDMRun3 import recordable
def AFP_SiClusterTools_Cfg(kwargs={}):
afpGeometryTool = CompFactory.AFP_GeometryTool("AFP_Geometry_tool")
clusterNeighbour = CompFactory.AFPSiClusterBasicNearestNeighbour("AFPSiClusterBasicNearestNeighbour")
# it's also possible to get the same clustering tool as in AFPAnalysisToolbox
# clusterNeighbour = CompFactory.AFPSiClusterAllNeighbours("AFPSiClusterAllNeighbours", neighbourhoodType="X")
rowColToLocal = CompFactory.AFPSiRowColToLocalCSTool("AFPSiRowColToLocalCSTool", AFP_Geometry=afpGeometryTool)
clusterTool = CompFactory.AFPSiClusterTool("AFPSiClusterTool", clusterAlgTool=clusterNeighbour, rowColToLocalCSTool = rowColToLocal)
return CompFactory.AFPSiCluster("AFPSiCluster", clusterRecoTool = clusterTool, **kwargs)
def AFP_SiClusterTools_HLT():
AFP_SiCl = AFP_SiClusterTools_Cfg({"AFPSiHitsClusterContainerKey": recordable("HLT_AFPSiHitsClusterContainer")})
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
monTool_AFP_SiClusterTool = GenericMonitoringTool("MonTool_AFP_SiClusterTool")
monTool_AFP_SiClusterTool.defineHistogram( 'HitsSize', path='EXPERT', type='TH1F', title='SID hits size',xbins=50, xmin=0, xmax=50 )
monTool_AFP_SiClusterTool.defineHistogram( 'ClusterSize', path='EXPERT', type='TH1F', title='SID cluster size',xbins=50, xmin=0, xmax=50 )
AFP_SiCl.clusterRecoTool.MonTool = monTool_AFP_SiClusterTool
return AFP_SiCl
...@@ -9,9 +9,9 @@ find_package( ROOT COMPONENTS Core MathCore Hist RIO ) ...@@ -9,9 +9,9 @@ find_package( ROOT COMPONENTS Core MathCore Hist RIO )
atlas_add_component( AFP_VertexReco atlas_add_component( AFP_VertexReco
src/*.cxx src/components/*.cxx AFP_VertexReco/*.h src/*.cxx src/components/*.cxx AFP_VertexReco/*.h
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} AthContainers AthenaBaseComps AthenaKernel GaudiKernel PathResolver StoreGateLib xAODForward ) LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthContainers AthenaBaseComps AthenaKernel GaudiKernel PathResolver StoreGateLib xAODForward )
# Install files from the package: # Install files from the package:
atlas_install_joboptions( share/*.py ) atlas_install_python_modules( share/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
#============================================================== #==============================================================
# Job options file for the AFP_VertexReco package # Job options file for the AFP_VertexReco package
#============================================================== #==============================================================
from AthenaConfiguration.ComponentFactory import CompFactory from AthenaConfiguration.ComponentFactory import CompFactory
from TrigEDMConfig.TriggerEDMRun3 import recordable
# Prepare Vertex reconstruction algorithm tools # Prepare Vertex reconstruction algorithm tools
def AFP_VertexReco_Cfg(kwargs={}):
TimeOffsetA = [64,57,30,52] TimeOffsetA = [64,57,30,52]
TimeSlopeA = [-8.6,-10.4,-9.7,-17.] TimeSlopeA = [-8.6,-10.4,-9.7,-17.]
TimeOffsetC = [-4,1,17,7] TimeOffsetC = [-4,1,17,7]
TimeSlopeC = [9.6,11,11,11] TimeSlopeC = [9.6,11,11,11]
TrainEdgesA = [-18.7,-13.2,-8.1,-4.0,-2.5] TrainEdgesA = [-18.7,-13.2,-8.1,-4.0,-2.5]
TrainEdgesC = [-18.7,-13.2,-8.1,-4.0,-2.5] TrainEdgesC = [-18.7,-13.2,-8.1,-4.0,-2.5]
TimeGlobalOffset = 0 TimeGlobalOffset = 0
afpVertexRecoTool = CompFactory.getComp("AFP_VertexRecoBasic")("AFP_VertexRecoBasic",TrackDistance=0.5,TimeOffsetA = TimeOffsetA, TimeSlopeA = TimeSlopeA, TimeOffsetC = TimeOffsetC, TimeSlopeC = TimeSlopeC, TimeGlobalOffset = TimeGlobalOffset, TrainEdgesA = TrainEdgesA, TrainEdgesC = TrainEdgesC) afpVertexRecoTool = CompFactory.AFP_VertexRecoBasic("AFP_VertexRecoBasic",TrackDistance=0.5,TimeOffsetA = TimeOffsetA, TimeSlopeA = TimeSlopeA, TimeOffsetC = TimeOffsetC, TimeSlopeC = TimeSlopeC, TimeGlobalOffset = TimeGlobalOffset, TrainEdgesA = TrainEdgesA, TrainEdgesC = TrainEdgesC, **kwargs)
verticesToolsList=[afpVertexRecoTool] verticesToolsList=[afpVertexRecoTool]
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_VertexRecoTool::initialize() will complain # collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_VertexRecoTool::initialize() will complain
outputVertexList=[] outputVertexList=[]
for vertexTool in verticesToolsList: for vertexTool in verticesToolsList:
try: try:
# in case the "verticesContainerName" is set # in case the "verticesContainerName" is set
contName=getattr(vertexTool, "verticesContainerName") contName=getattr(vertexTool, "verticesContainerName")
except AttributeError: except AttributeError:
# in case the "verticesContainerName" is not set # in case the "verticesContainerName" is not set
contName=vertexTool.getDefaultProperty("verticesContainerName") contName=vertexTool.getDefaultProperty("verticesContainerName")
if contName not in outputVertexList: if contName not in outputVertexList:
outputVertexList.append(contName) outputVertexList.append(contName)
# prepare vertex reco tool # prepare vertex reco tool
vertexRecoTool = CompFactory.getComp("AFP_VertexRecoTool")("AFP_VertexRecoTool", RecoToolsList=verticesToolsList, AFPVertexContainerList=outputVertexList ) vertexRecoTool = CompFactory.AFP_VertexRecoTool("AFP_VertexRecoTool", RecoToolsList=verticesToolsList, AFPVertexContainerList=outputVertexList )
# actually setup the vertex reco # actually setup the vertex reco
from AFP_VertexReco.AFP_VertexRecoConf import AFP_VertexReco return CompFactory.AFP_VertexReco("AFP_VertexReco", recoTool = vertexRecoTool)
topSequence += AFP_VertexReco("AFP_VertexReco", recoTool = vertexRecoTool)
def AFP_VertexReco_HLT():
AFP_Vtx = AFP_VertexReco_Cfg({"AFPToFTrackContainerKey": "HLT_AFPToFTrackContainer", "AFPProtonContainerKey": "HLT_AFPProtonContainer", "verticesContainerName": recordable("HLT_AFPVertexContainer")})
return AFP_Vtx
...@@ -41,17 +41,29 @@ if rec.doAlfa() and rec.doESD(): ...@@ -41,17 +41,29 @@ if rec.doAlfa() and rec.doESD():
include("ALFA_CLinkAlg/ALFA_CLinkAlg_joboption.py") include("ALFA_CLinkAlg/ALFA_CLinkAlg_joboption.py")
if rec.doAFP() and rec.doESD(): if rec.doAFP() and rec.doESD():
# Real-data reconstruction: # Real-data reconstruction:
if DetFlags.readRDOBS.AFP_on(): if DetFlags.readRDOBS.AFP_on():
from AFP_ByteStream2RawCnv.AFP_ByteStream2RawCnvConf import AFP_RawDataProvider from AFP_ByteStream2RawCnv.AFP_ByteStream2RawCnvConf import AFP_RawDataProvider
topSequence+=AFP_RawDataProvider() topSequence+=AFP_RawDataProvider()
from AFP_Raw2Digi.AFP_Raw2DigiConf import AFP_Raw2Digi from AFP_Raw2Digi.AFP_Raw2DigiConf import AFP_Raw2Digi
topSequence+=AFP_Raw2Digi() topSequence+=AFP_Raw2Digi()
#cluster reconstruction
from AFP_SiClusterTools.AFP_SiClusterTools_joboption import AFP_SiClusterTools_Cfg
topSequence+=AFP_SiClusterTools_Cfg()
# tracks reconstruction # tracks reconstruction
include("AFP_LocReco/AFP_LocReco_joboption.py") from AFP_LocReco.AFP_LocReco_joboption import AFP_LocReco_SiD_Cfg, AFP_LocReco_TD_Cfg
topSequence+=AFP_LocReco_SiD_Cfg()
topSequence+=AFP_LocReco_TD_Cfg()
# protons reconstruction # protons reconstruction
include("AFP_GlobReco/AFP_GlobReco_joboption.py") from AFP_GlobReco.AFP_GlobReco_joboption import AFP_GlobReco_Cfg
topSequence+=AFP_GlobReco_Cfg()
# vertex reconstruction # vertex reconstruction
include("AFP_VertexReco/AFP_VertexReco_joboption.py") from AFP_VertexReco.AFP_VertexReco_joboption import AFP_VertexReco_Cfg
topSequence+=AFP_VertexReco_Cfg()
\ No newline at end of file
...@@ -871,8 +871,16 @@ TriggerHLTListRun3 = [ ...@@ -871,8 +871,16 @@ TriggerHLTListRun3 = [
('xAOD::TrigCompositeContainer#HLT_vtx_z', 'BS ESD AODFULL', 'MinBias' ,'inViews:ZVertFinderRecoViews'), ('xAOD::TrigCompositeContainer#HLT_vtx_z', 'BS ESD AODFULL', 'MinBias' ,'inViews:ZVertFinderRecoViews'),
('xAOD::TrigCompositeAuxContainer#HLT_vtx_zAux.zfinder_vtx_z.zfinder_vtx_weight.zfinder_tool', 'BS ESD AODFULL', 'MinBias'), ('xAOD::TrigCompositeAuxContainer#HLT_vtx_zAux.zfinder_vtx_z.zfinder_vtx_weight.zfinder_tool', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPSiHitsClusterContainer#HLT_AFPSiHitsClusterContainer', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPSiHitsClusterAuxContainer#HLT_AFPSiHitsClusterContainerAux.', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPTrackContainer#HLT_AFPTrackContainer', 'BS ESD AODFULL', 'MinBias'), ('xAOD::AFPTrackContainer#HLT_AFPTrackContainer', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPTrackAuxContainer#HLT_AFPTrackContainerAux.', 'BS ESD AODFULL', 'MinBias'), ('xAOD::AFPTrackAuxContainer#HLT_AFPTrackContainerAux.', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPToFTrackContainer#HLT_AFPToFTrackContainer', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPToFTrackAuxContainer#HLT_AFPToFTrackContainerAux.', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPProtonContainer#HLT_AFPProtonContainer', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPProtonAuxContainer#HLT_AFPProtonContainerAux.', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPVertexContainer#HLT_AFPVertexContainer', 'BS ESD AODFULL', 'MinBias'),
('xAOD::AFPVertexAuxContainer#HLT_AFPVertexContainerAux.', 'BS ESD AODFULL', 'MinBias'),
# Cosmic # Cosmic
('xAOD::TrackParticleContainer#HLT_IDTrack_Cosmic_FTF', 'BS ESD AODFULL', 'Cosmic'), ('xAOD::TrackParticleContainer#HLT_IDTrack_Cosmic_FTF', 'BS ESD AODFULL', 'Cosmic'),
......
# #
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
# #
from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags
from TriggerMenuMT.HLT.Menu.MenuComponents import MenuSequence from TriggerMenuMT.HLT.Menu.MenuComponents import MenuSequence
from AthenaCommon.CFElements import parOR, seqAND from AthenaCommon.CFElements import parOR, seqAND
from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable from AthenaConfiguration.ComponentAccumulator import conf2toConfigurable
from AthenaConfiguration.ComponentFactory import CompFactory
from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool from DecisionHandling.DecisionHandlingConf import InputMakerForRoI, ViewCreatorInitialROITool
from TrigEDMConfig.TriggerEDMRun3 import recordable
from TriggerMenuMT.HLT.Menu.MenuComponents import RecoFragmentsPool from TriggerMenuMT.HLT.Menu.MenuComponents import RecoFragmentsPool
def AFPTrkRecoBaseSequence(ConfigFlags): def AFPTrkRecoBaseSequence(ConfigFlags):
# Create inputs using input maker # Create inputs using input maker
AFPInputMaker = InputMakerForRoI("IM_AFPTrackingFS") AFPInputMaker = InputMakerForRoI("IM_AFPTrackingFS")
AFPInputMaker.RoITool = ViewCreatorInitialROITool() AFPInputMaker.RoITool = ViewCreatorInitialROITool()
AFPInputMaker.RoIs = "AFPRoIs" AFPInputMaker.RoIs = "AFPRoIs"
from AFP_ByteStream2RawCnv.AFP_ByteStream2RawCnvConf import AFP_RawDataProvider
AFP_Raw = AFP_RawDataProvider()
from AFP_Raw2Digi.AFP_Raw2DigiConf import AFP_Raw2Digi
AFP_R2D = AFP_Raw2Digi()
# SiD part from AthenaCommon.GlobalFlags import globalflags
# setup clustering tool
from AthenaConfiguration.ComponentFactory import CompFactory if globalflags.InputFormat.is_bytestream():
clusterNeighbour = CompFactory.getComp("AFPSiClusterBasicNearestNeighbour")("AFPSiClusterBasicNearestNeighbour") # bytestream convertor
rowColToLocal = CompFactory.getComp("AFPSiRowColToLocalCSTool")("AFPSiRowColToLocalCSTool") AFP_Raw=CompFactory.AFP_RawDataProvider("AFP_RawDataProvider")
clusterTool = CompFactory.getComp("AFPSiClusterTool")("AFPSiClusterTool", clusterAlgTool=clusterNeighbour, rowColToLocalCSTool = rowColToLocal)
from AFP_SiClusterTools.AFP_SiClusterToolsConf import AFPSiCluster # digitalization
AFP_SiCl = AFPSiCluster("AFPSiCluster", clusterRecoTool = clusterTool) AFP_R2D=CompFactory.AFP_Raw2Digi("AFP_Raw2Digi")
# setup track reconstruction algorithm tools #cluster reconstruction
kalmanTool0 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool0", stationID=0, tracksContainerName = recordable("HLT_AFPTrackContainer")) from AFP_SiClusterTools.AFP_SiClusterTools_joboption import AFP_SiClusterTools_HLT
kalmanTool1 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool1", stationID=1, tracksContainerName = recordable("HLT_AFPTrackContainer")) AFP_SiCl=AFP_SiClusterTools_HLT()
kalmanTool2 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool2", stationID=2, tracksContainerName = recordable("HLT_AFPTrackContainer"))
kalmanTool3 = CompFactory.getComp("AFPSiDBasicKalmanTool")("AFPSiDBasicKalmanTool3", stationID=3, tracksContainerName = recordable("HLT_AFPTrackContainer")) # tracks reconstruction
kalmanToolsList=[kalmanTool0, kalmanTool1, kalmanTool2, kalmanTool3] from AFP_LocReco.AFP_LocReco_joboption import AFP_LocReco_SiD_HLT, AFP_LocReco_TD_HLT
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain AFP_SID=AFP_LocReco_SiD_HLT()
outputKalmanList=[] AFP_TD=AFP_LocReco_TD_HLT()
for kalmanTool in kalmanToolsList:
try: # protons reconstruction
# in case the "tracksContainerName" is set from AFP_GlobReco.AFP_GlobReco_joboption import AFP_GlobReco_HLT
contName=getattr(kalmanTool, "tracksContainerName") AFP_Pr=AFP_GlobReco_HLT()
except AttributeError:
# in case the "tracksContainerName" is not set # vertex reconstruction
contName=kalmanTool.getDefaultProperty("tracksContainerName") from AFP_VertexReco.AFP_VertexReco_joboption import AFP_VertexReco_HLT
if contName not in outputKalmanList: AFP_Vtx=AFP_VertexReco_HLT()
outputKalmanList.append(contName)
trackRecoTool = CompFactory.getComp("AFP_SIDLocRecoTool")("AFP_SIDLocRecoTool", RecoToolsList=kalmanToolsList, AFPTrackContainerList=outputKalmanList ) if globalflags.InputFormat.is_bytestream():
from AFP_LocReco.AFP_LocRecoConf import AFP_SIDLocReco AFPRecoSeq = parOR("AFPRecoSeq", [AFP_Raw, AFP_R2D, AFP_SiCl, AFP_SID, AFP_TD, AFP_Pr, AFP_Vtx])
AFP_SID = AFP_SIDLocReco("AFP_SIDLocReco", recoTool = trackRecoTool) else:
AFPRecoSeq = parOR("AFPRecoSeq", [AFP_SiCl, AFP_SID, AFP_TD, AFP_Pr, AFP_Vtx])
from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
monTool_AFP_SiClusterTool = GenericMonitoringTool("MonTool_AFP_SiClusterTool")
monTool_AFP_SiClusterTool.defineHistogram( 'HitsSize', path='EXPERT', type='TH1F', title='SID hits size',xbins=50, xmin=0, xmax=50 )
monTool_AFP_SiClusterTool.defineHistogram( 'ClusterSize', path='EXPERT', type='TH1F', title='SID cluster size',xbins=50, xmin=0, xmax=50 )
AFP_SiCl.clusterRecoTool.MonTool = monTool_AFP_SiClusterTool
monTool_AFP_SIDLocRecoTool = GenericMonitoringTool("MonTool_AFP_SIDLocRecoTool")
monTool_AFP_SIDLocRecoTool.defineHistogram( 'TrkSize', path='EXPERT', type='TH1F', title='AFP tracks size',xbins=50, xmin=0, xmax=100 )
AFP_SID.recoTool.MonTool = monTool_AFP_SIDLocRecoTool
for i, kalmanTool in enumerate(kalmanToolsList):
monTool_AFP_BasicKalman = GenericMonitoringTool("MonTool_AFP_"+kalmanTool.name())
monTool_AFP_BasicKalman.defineHistogram( 'TrkStationID', path='EXPERT', type='TH1F', title='Track station ID',xbins=4, xmin=0, xmax=4 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkXLocal', path='EXPERT', type='TH1F', title='Track xLocal',xbins=100, xmin=-200, xmax=200 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkYLocal', path='EXPERT', type='TH1F', title='Track yLocal',xbins=100, xmin=-30, xmax=30 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkZLocal', path='EXPERT', type='TH1F', title='Track zLocal',xbins=100, xmin=-500000, xmax=500000 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkXSlope', path='EXPERT', type='TH1F', title='Track x slope',xbins=100, xmin=-0.5, xmax=0.5 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkYSlope', path='EXPERT', type='TH1F', title='Track y slope',xbins=100, xmin=-0.5, xmax=0.5 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkNClusters', path='EXPERT', type='TH1F', title='Track number of clusters',xbins=100, xmin=0, xmax=100 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkNHoles', path='EXPERT', type='TH1F', title='Track number of holes',xbins=100, xmin=0, xmax=100 )
monTool_AFP_BasicKalman.defineHistogram( 'TrkChi2', path='EXPERT', type='TH1F', title='Track chi2',xbins=50, xmin=0, xmax=10 )
AFP_SID.recoTool.RecoToolsList[i].MonTool = monTool_AFP_BasicKalman
# TID part
BarWeight = [1.0, 1.0, 1.0, 1.0]
TimeOffset0 = [105707, 105670, 105675, 105638,
105834, 105819, 105778, 105754,
105900, 105892, 105870, 105820,
105726, 105720, 105714, 105717]
basicTool0 = CompFactory.getComp("AFPTDBasicTool")("AFPTDBasicTool0", stationID=0, maxAllowedLength=100, TimeOffset=TimeOffset0, BarWeight=BarWeight)
TimeOffset3 = [105796, 105761, 105742, 105696,
105890, 105871, 105839, 105816,
105923, 105899, 105862, 105853,
105707, 105711, 105714, 105713]
basicTool3 = CompFactory.getComp("AFPTDBasicTool")("AFPTDBasicTool3", stationID=3, maxAllowedLength=100, TimeOffset=TimeOffset3, BarWeight=BarWeight)
basicToolsList=[basicTool0, basicTool3]
# collect all output names and make a list with unique names for write handle keys; if this goes wrong AFP_SIDLocRecoTool::initialize() will complain
outputBasicList=[]
for basicTool in basicToolsList:
try:
# in case the "tracksContainerName" is set
contName=getattr(basicTool, "tracksContainerName")
except AttributeError:
# in case the "tracksContainerName" is not set
contName=basicTool.getDefaultProperty("tracksContainerName")
if contName not in outputBasicList:
outputBasicList.append(contName)
ToFtrackRecoTool = CompFactory.getComp("AFP_TDLocRecoTool")("AFP_TDLocRecoTool", RecoToolsList=basicToolsList, AFPToFTrackContainerList=outputBasicList )
from AFP_LocReco.AFP_LocRecoConf import AFP_TDLocReco
AFP_TD = AFP_TDLocReco("AFP_TDLocReco", recoTool=ToFtrackRecoTool)
# AFP_Proton part to be added here
AFPRecoSeq = parOR("AFPRecoSeq", [AFP_Raw, AFP_R2D, AFP_SiCl, AFP_SID, AFP_TD])
return (AFPRecoSeq, AFPInputMaker) return (AFPRecoSeq, AFPInputMaker)
......
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