diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/MuonCaloTagTool.py index 0e39c78eb9ab7a499c0678f2549b92c9ce8eb838..19901e929005ddce03b1c78852b386bbf862ca50 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 eeb1120a5deff10b5173d32109e0fe1c7b730348..9b7c160298bef7692bba76f8587a39cf4ba99854 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",