From 02a4bf70ec7b78d6ebbbe8c67bf1c22ebdff375c Mon Sep 17 00:00:00 2001 From: Jochen Meyer <Jochen.Meyer@cern.ch> Date: Sun, 20 Nov 2016 23:30:08 +0100 Subject: [PATCH] adding missing import (MuonCombinedRecExample-01-09-25) * adding missing DB import in MuonCombinedFitTools * Tagging as MuonCombinedRecExample-01-09-25 2016-11-20 Jochen Meyer * do not use AEOTs for trigger or jobs running online * Tagging as MuonCombinedRecExample-01-09-24 2016-11-11 Jochen Meyer * cleaning up configuration * Tagging as MuonCombinedRecExample-01-09-23 2016-11-02 Yun Sang Chow * CaloMuonLikelihood histogram retrieval method change * Tagging as MuonCombinedRecExample-01-09-22 Former-commit-id: 7ea469bba960e46eb337791839698252bc44703d --- .../python/MuonCaloTagTool.py | 29 ------------------- .../python/MuonCombinedFitTools.py | 25 +++++++--------- 2 files changed, 11 insertions(+), 43 deletions(-) diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py index 0e39c78eb9a..19901e92900 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py @@ -13,19 +13,6 @@ from AthenaCommon.Logging import log ############################################################################### # Finds the root file @rootFileName and creates a one-item list for THistSvc.Input ############################################################################### -def defineCaloLhrPdf(rootFileName, streamName=""): - import os - from AthenaCommon.Utils.unixtools import FindFile - rootFile = FindFile(filename=rootFileName, pathlist=os.environ['DATAPATH'].split(os.pathsep), access=os.R_OK) - if streamName=="": - pos1 = rootFileName.find("CaloMuonLikelihood.PDF.") - pos2 = rootFileName.find(".root") - if pos1!=-1 and pos2!=-1: - streamName = rootFileName.replace(".", "_") - streamName = streamName[0:pos2] - else: - raise ValueError("in CaloTrkMuIdTools_jobOptions.py: defineCaloLhrPdf(...): rootFileName: " + rootFileName + " is not an expected value (should be CaloMuonLikelihood.PDF.xx.root).") - return [streamName + " DATAFILE='" + str(rootFile) + "' TYP='ROOT' OPT='READ'"] ### Track Selector for CaloTrkMuIdAlg def CaloTrkMuIdAlgTrackSelectorTool( name='CaloTrkMuIdAlgTrackSelectorTool', **kwargs ): @@ -59,22 +46,6 @@ def CaloMuonTag( name='CaloMuonTag', **kwargs ): return CfgMgr.CaloMuonTag(name,**kwargs) def CaloMuonLikelihoodTool(name='CaloMuonLikelihoodTool', **kwargs ): - - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - if athenaCommonFlags.isOnline == False: - from AthenaCommon.AppMgr import ServiceMgr - if not hasattr(ServiceMgr, 'THistSvc'): - ServiceMgr += CfgMgr.THistSvc() - - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.A0.root"); ### PDFs for barrel region low pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.A1.root"); ### PDFs for barrel region medium pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.A2.root"); ### PDFs for barrel region high pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.B0.root"); ### PDFs for transition region low pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.B1.root"); ### PDFs for transition region medium pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.B2.root"); ### PDFs for transition region high pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.C0.root"); ### PDFs for endcap region low pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.C1.root"); ### PDFs for endcap region medium pT - ServiceMgr.THistSvc.Input += defineCaloLhrPdf("CaloMuonLikelihood.PDF.C2.root"); ### PDFs for endcap region high pT kwargs.setdefault("TrackEnergyInCaloTool", getPublicTool("TrackEnergyInCaloTool") ) return CfgMgr.CaloMuonLikelihoodTool(name,**kwargs) diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py index eeb1120a5de..9b7c160298b 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCombinedFitTools.py @@ -24,6 +24,7 @@ beamFlags = jobproperties.Beam from AthenaCommon.DetFlags import DetFlags from AthenaCommon.SystemOfUnits import meter +from IOVDbSvc.CondDB import conddb from AthenaCommon.GlobalFlags import globalflags from RecExConfig.RecFlags import rec @@ -261,23 +262,19 @@ def CombinedMuonTrackBuilder( name='CombinedMuonTrackBuilder', **kwargs ): # configure tools for data reprocessing if muonRecFlags.enableErrorTuning(): - # enable error scaling for Muid/MuGirl - kwargs.setdefault("MuonScaledErrorOptimizer", getPublicToolClone("MuidScaledErrorOptimisationTool", - "MuonErrorOptimisationTool", - PrepareForFit = False, - RecreateStartingParameters = False, - RefitTool = getPublicToolClone("MuidScaledRefitTool", - "MuonRefitTool", - AlignmentErrors = False, - Fitter = getPublicTool("iPatFitter")))) - # use alignment effects on track in the fitter - kwargs.setdefault("MuonAlignmentErrorOptimizer", getPublicToolClone("MuidAlignmentErrorOptimisationTool", + # use alignment effects on track for all algorithms + + useAlignErrs = True + if conddb.dbdata == 'COMP200' or conddb.dbmc == 'COMP200' or 'HLT' in globalflags.ConditionsTag() or conddb.isOnline : + useAlignErrs = False + + kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("MuidErrorOptimisationTool", "MuonErrorOptimisationTool", PrepareForFit = False, RecreateStartingParameters = False, - RefitTool = getPublicToolClone("MuidAlignmentRefitTool", + RefitTool = getPublicToolClone("MuidRefitTool", "MuonRefitTool", - AlignmentErrors = True, + AlignmentErrors = useAlignErrs, Fitter = getPublicTool("iPatFitter")))) @@ -336,7 +333,7 @@ def OutwardsCombinedMuonTrackBuilder( name = 'OutwardsCombinedMuonTrackBuilder', kwargs.setdefault("MuonHoleRecovery" , getPublicTool("OutwardsSegmentRegionRecoveryTool") ) kwargs.setdefault("AllowCleanerVeto" , False) if muonRecFlags.enableErrorTuning(): - kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("OutwardsScaledErrorOptimisationTool", "MuidScaledErrorOptimisationTool", + kwargs.setdefault("MuonErrorOptimizer", getPublicToolClone("OutwardsErrorOptimisationTool", "MuidErrorOptimisationTool", PrepareForFit=False,RecreateStartingParameters=False, RefitTool = getPublicToolClone("OutwardsRefitTool", "MuonRefitTool", -- GitLab