diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py index 233d5f1f24de5ac4a16de4604556e771fb8af557..524e6a0b0f9431a72c3bbab2f28cd9a6d9abafb4 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py @@ -1,3 +1,5 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + ############################################################### # # Standalone job options file to create SiSPSeededSCTTracks diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py new file mode 100644 index 0000000000000000000000000000000000000000..420c9aeabcbda1893708319176e12a08dc7dd0a6 --- /dev/null +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededTracksStandalone.py @@ -0,0 +1,601 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +############################################################### +# +# Standalone job options file to create SiSPSeededTracks +# +#============================================================== + +# Configuration flags +doPixel = True +doSCT = True +doBeamSpot = True +doPrint = True +# Combinations of +# doPixel = True, doSCT = True, doBeamSpot = True, doPrint = True +# doPixel = True, doSCT = False, doBeamSpot = False, doPrint = True +# doPixel = False, doSCT = True, doBeamSpot = False, doPrint = True +# were tested. + +# Output track location +TracksLocation = "SiSPSeededTracks" +if doPixel and not doSCT: + TracksLocation = "SiSPSeededPixelTracks" +if not doPixel and doSCT: + TracksLocation = "SiSPSeededSCTTracks" + +#-------------------------------------------------------------- +# Standard includes +#-------------------------------------------------------------- +import AthenaCommon.AtlasUnixStandardJob + +# Common fragments +import sys +from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +from InDetRecExample.InDetJobProperties import InDetFlags +from InDetRecExample.InDetKeys import InDetKeys + +if not doBeamSpot: + InDetFlags.useBeamConstraint.set_Value_and_Lock(False) +if not doPixel: + InDetKeys.PixelClusters.set_Value_and_Lock("") + InDetKeys.PixelSpacePoints.set_Value_and_Lock("") + # InDetKeys.OverlapSpacePoints.set_Value_and_Lock("") +if not doSCT: + InDetKeys.SCT_Clusters.set_Value_and_Lock("") + InDetKeys.SCT_SpacePoints.set_Value_and_Lock("") + # InDetKeys.OverlapSpacePoints.set_Value_and_Lock("") + +#-------------------------------------------------------------- +# Thread-specific setup +#-------------------------------------------------------------- +from AthenaCommon.ConcurrencyFlags import jobproperties +numThreads = jobproperties.ConcurrencyFlags.NumThreads() +if numThreads > 0: + from AthenaCommon.AlgScheduler import AlgScheduler + AlgScheduler.CheckDependencies( True ) + AlgScheduler.ShowControlFlow( True ) + AlgScheduler.ShowDataDependencies( True ) + +#-------------------------------------------------------------- +# use auditors +#-------------------------------------------------------------- +from GaudiSvc.GaudiSvcConf import AuditorSvc +ServiceMgr += AuditorSvc() +theAuditorSvc = ServiceMgr.AuditorSvc +theAuditorSvc.Auditors += [ "ChronoAuditor"] +theAuditorSvc.Auditors += [ "MemStatAuditor" ] +theApp.AuditAlgorithms=True + +#-------------------------------------------------------------- +# Load Geometry +#-------------------------------------------------------------- +from AthenaCommon.GlobalFlags import globalflags +globalflags.DetDescrVersion="ATLAS-R2-2016-01-00-01" +globalflags.DetGeo="atlas" +globalflags.InputFormat="bytestream" +globalflags.DataSource="data" +if doPrint: + print globalflags + +#-------------------------------------------------------------- +# Set Detector setup +#-------------------------------------------------------------- +# --- switch on BField, bpipe, pixel and SCT +from AthenaCommon.DetFlags import DetFlags +DetFlags.ID_setOff() +if doBeamSpot: + DetFlags.bpipe_setOn() +if doPixel: + DetFlags.pixel_setOn() +if doSCT: + DetFlags.SCT_setOn() +DetFlags.Calo_setOff() +DetFlags.Muon_setOff() +DetFlags.Truth_setOff() +DetFlags.LVL1_setOff() +DetFlags.BField_setOn() + +# ---- switch parts of ID off/on as follows +DetFlags.digitize.all_setOff() +DetFlags.geometry.all_setOff() +DetFlags.overlay.all_setOff() +DetFlags.pileup.all_setOff() +DetFlags.readRIOBS.all_setOff() +DetFlags.readRIOPool.all_setOff() +DetFlags.simulate.all_setOff() +DetFlags.simulateLVL1.all_setOff() +DetFlags.writeBS.all_setOff() +DetFlags.writeRIOPool.all_setOff() + +import AtlasGeoModel.SetGeometryVersion +import AtlasGeoModel.GeoModelInit +import MagFieldServices.SetupField + +if doPrint: + DetFlags.Print() + +#-------------------------------------------------------------- +# Load IOVDbSvc +#-------------------------------------------------------------- +IOVDbSvc = Service("IOVDbSvc") +from IOVDbSvc.CondDB import conddb +conddb.dbdata="CONDBR2" +IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2018-03" +IOVDbSvc.OutputLevel = WARNING + +# Set input byte stream file (from q431 test) +inputBSFiles = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/data17_13TeV.00330470.physics_Main.daq.RAW._lb0310._SFO-1._0001.data"] +include("ByteStreamCnvSvc/BSEventStorageEventSelector_jobOptions.py") +ServiceMgr.ByteStreamInputSvc.FullFileName = inputBSFiles +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = inputBSFiles + +# Set up topSequence and condSeq +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") + +# Set up EventInfo +if not hasattr(topSequence, "xAODMaker::EventInfoCnvAlg") and not hasattr(condSeq, "xAODMaker::EventInfoCnvAlg"): + from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg + topSequence += xAODMaker__EventInfoCnvAlg() + +# Set up byte stream converters +# Pixel: PixelRawDataProvider, PixelRawDataProviderTool, PixelRodDecoder +# SCT: SCTRawDataProvider (reentrant), SCTRawDataProviderTool, SCT_RodDecoder, SCTEventFlagWriter (reentrant) +include("InDetRecExample/InDetReadBS_jobOptions.py") +if doPixel: + topSequence.InDetPixelRawDataProvider.OutputLevel = INFO + topSequence.InDetPixelRawDataProvider.ProviderTool.Decoder.OutputLevel = INFO +if doSCT: + topSequence.InDetSCTRawDataProvider.OutputLevel = INFO + topSequence.InDetSCTRawDataProvider.ProviderTool.Decoder.OutputLevel = INFO + topSequence.InDetSCTEventFlagWriter.OutputLevel = INFO + if numThreads >= 2: + topSequence.InDetSCTRawDataProvider.Cardinality = numThreads + topSequence.InDetSCTEventFlagWriter.Cardinality = numThreads + +# Set up BeamSpot +if doBeamSpot: + if not hasattr(condSeq, "BeamSpotCondAlg"): + conddb.addFolderSplitOnline("INDET", "/Indet/Onl/Beampos", "/Indet/Beampos", className="AthenaAttributeList") + from BeamSpotConditions.BeamSpotConditionsConf import BeamSpotCondAlg + condSeq += BeamSpotCondAlg("BeamSpotCondAlg") + +from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags +do_runI = geoFlags.Run() not in ["RUN2", "RUN3"] +if do_runI: + sys.exit("RUN1 is not supported. Bye.") + +# Set up Pixel conditions +if doPixel: + # Taken from InDetRecExample/share/InDetRecConditionsAccess.py + if not hasattr(condSeq, "PixelConfigCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelConfigCondAlg + condSeq += PixelConfigCondAlg(name="PixelConfigCondAlg") + if not (conddb.folderRequested("/PIXEL/PixMapOverlay") or conddb.folderRequested("/PIXEL/Onl/PixMapOverlay")): + conddb.addFolderSplitOnline("PIXEL","/PIXEL/Onl/PixMapOverlay", "/PIXEL/PixMapOverlay", className="CondAttrListCollection") + if not hasattr(condSeq, "PixelChargeCalibCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelChargeCalibCondAlg + condSeq += PixelChargeCalibCondAlg(name="PixelChargeCalibCondAlg", ReadKey="/PIXEL/PixCalib") + if not conddb.folderRequested("/PIXEL/PixCalib"): + conddb.addFolderSplitOnline("PIXEL", "/PIXEL/Onl/PixCalib", "/PIXEL/PixCalib", className="CondAttrListCollection") + if not hasattr(condSeq, "PixelOfflineCalibCondAlg"): + from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelOfflineCalibCondAlg + condSeq += PixelOfflineCalibCondAlg(name="PixelOfflineCalibCondAlg", ReadKey="/PIXEL/PixReco", + InputSource = 2) + if not conddb.folderRequested("/PIXEL/PixReco"): + conddb.addFolder("PIXEL_OFL", "/PIXEL/PixReco", className="DetCondCFloat") + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleTool.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + # Takne from InDetRecExample/share/InDetRecLoadTools.py + from InDetRecExample.TrackingCommon import createAndAddCondAlg,getPixelClusterNnCondAlg,getPixelClusterNnWithTrackCondAlg + createAndAddCondAlg( getPixelClusterNnCondAlg, "PixelNnClusterNnCondAlg", GetInputsInfo = do_runI) + createAndAddCondAlg( getPixelClusterNnWithTrackCondAlg,"PixelNnClusterNnWithTrackCondAlg", GetInputsInfo = do_runI) + +# Set up SCT conditions +SCT_ConditionsSummaryTool = None +if doSCT: + # Taken from InDetRecExample/share/InDetRecConditionsAccess.py + from SCT_ConditionsTools.SCT_ConfigurationConditionsToolSetup import SCT_ConfigurationConditionsToolSetup + sct_ConfigurationConditionsToolSetup = SCT_ConfigurationConditionsToolSetup() + sct_ConfigurationConditionsToolSetup.setup() + from SCT_ConditionsTools.SCT_ByteStreamErrorsToolSetup import SCT_ByteStreamErrorsToolSetup + sct_ByteStreamErrorsToolSetup = SCT_ByteStreamErrorsToolSetup() + sct_ByteStreamErrorsToolSetup.setConfigTool(sct_ConfigurationConditionsToolSetup.getTool()) + sct_ByteStreamErrorsToolSetup.setup() + from SCT_ConditionsTools.SCT_ReadCalibDataToolSetup import SCT_ReadCalibDataToolSetup + sct_ReadCalibDataToolSetup = SCT_ReadCalibDataToolSetup() + sct_ReadCalibDataToolSetup.setup() + from SCT_ConditionsTools.SCT_TdaqEnabledToolSetup import SCT_TdaqEnabledToolSetup + sct_TdaqEnabledToolSetup = SCT_TdaqEnabledToolSetup() + sct_TdaqEnabledToolSetup.setFolder("/TDAQ/Resources/ATLAS/SCT/Robins") + sct_TdaqEnabledToolSetup.setup() + from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup + sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() + sct_DCSConditionsToolSetup.setup() + from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup + sct_ConditionsSummaryToolSetupWithoutFlagged = SCT_ConditionsSummaryToolSetup("InDetSCT_ConditionsSummaryToolWithoutFlagged") + sct_ConditionsSummaryToolSetupWithoutFlagged.setup() + sct_ConditionsSummaryToolSetupWithoutFlagged.ConditionsTools=[sct_ConfigurationConditionsToolSetup.getTool().getFullName(), + sct_ByteStreamErrorsToolSetup.getTool().getFullName(), + sct_ReadCalibDataToolSetup.getTool().getFullName(), + sct_TdaqEnabledToolSetup.getTool().getFullName(), + sct_DCSConditionsToolSetup.getTool().getFullName()] + from SCT_ConditionsTools.SCT_FlaggedConditionToolSetup import SCT_FlaggedConditionToolSetup + sct_FlaggedConditionToolSetup = SCT_FlaggedConditionToolSetup() + sct_FlaggedConditionToolSetup.setup() + sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup() + sct_ConditionsSummaryToolSetup.setup() + SCT_ConditionsSummaryTool = sct_ConditionsSummaryToolSetup.getTool() + SCT_ConditionsSummaryTool.ConditionsTools=[sct_ConfigurationConditionsToolSetup.getTool().getFullName(), + sct_FlaggedConditionToolSetup.getTool().getFullName(), + sct_ByteStreamErrorsToolSetup.getTool().getFullName(), + sct_ReadCalibDataToolSetup.getTool().getFullName(), + sct_TdaqEnabledToolSetup.getTool().getFullName(), + sct_DCSConditionsToolSetup.getTool().getFullName()] + from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup + sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() + # Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py + if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"): + from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg + condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg") + # Taken from InDetRecExample/share/InDetRecLoadTools.py + if not hasattr(condSeq, "InDetSiDetElementBoundaryLinksCondAlg"): + from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk + condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksCondAlg") + +if doPixel or doSCT: + # This is for both Pixel and SCT. + # Takne from InDetRecExample/share/InDetRecLoadTools.py + from InDetRecExample.TrackingCommon import createAndAddCondAlg, getRIO_OnTrackErrorScalingCondAlg + createAndAddCondAlg(getRIO_OnTrackErrorScalingCondAlg,"RIO_OnTrackErrorScalingCondAlg") + +# Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py +from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool +InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool", + SCTLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool if doSCT else None) +if doPixel: + InDetClusterMakerTool.PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool +else: + InDetClusterMakerTool.PixelCablingSvc = None + InDetClusterMakerTool.PixelModuleData = "" + InDetClusterMakerTool.PixelChargeCalibCondData = "" + InDetClusterMakerTool.PixelLorentzAngleTool = None + +# Set up Pixel neutral network tools +clusterSplitProbTool = None +clusterSplitterTool = None +if doPixel: + # Taken from InDetRecExample/share/InDetRecLoadTools.py + from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool + NeuralNetworkToHistoTool=Trk__NeuralNetworkToHistoTool(name = "NeuralNetworkToHistoTool") + ToolSvc += NeuralNetworkToHistoTool + from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory + NnClusterizationFactory = InDet__NnClusterizationFactory(name = "NnClusterizationFactory", + PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool, + useToT = InDetFlags.doNNToTCalibration(), + NnCollectionReadKey = "PixelClusterNN", + NnCollectionWithTrackReadKey = "PixelClusterNNWithTrack") + ToolSvc += NnClusterizationFactory + # Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py + MultiplicityContent = [1 , 1 , 1] + useBeamConstraint = InDetFlags.useBeamConstraint() + from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitProbTool as PixelClusterSplitProbTool + NnPixelClusterSplitProbTool=PixelClusterSplitProbTool(name = "NnPixelClusterSplitProbTool", + PriorMultiplicityContent = MultiplicityContent, + NnClusterizationFactory = NnClusterizationFactory, + useBeamSpotInfo = useBeamConstraint) + ToolSvc += NnPixelClusterSplitProbTool + clusterSplitProbTool = NnPixelClusterSplitProbTool + from SiClusterizationTool.SiClusterizationToolConf import InDet__NnPixelClusterSplitter as PixelClusterSplitter + NnPixelClusterSplitter=PixelClusterSplitter(name = "NnPixelClusterSplitter", + NnClusterizationFactory = NnClusterizationFactory, + ThresholdSplittingIntoTwoClusters = 0.5, + ThresholdSplittingIntoThreeClusters = 0.25, + SplitOnlyOnBLayer = False, + useBeamSpotInfo = useBeamConstraint) + ToolSvc += NnPixelClusterSplitter + clusterSplitterTool = NnPixelClusterSplitter + from SiClusterizationTool.SiClusterizationToolConf import InDet__MergedPixelsTool + InDetMergedPixelsTool = InDet__MergedPixelsTool(name = "InDetMergedPixelsTool", + globalPosAlg = InDetClusterMakerTool, + MinimalSplitSize = 0, + MaximalSplitSize = 49, + MinimalSplitProbability = 0, + DoIBLSplitting = True, + SplitClusterAmbiguityMap= "SplitClusterAmbiguityMap") + if not InDetFlags.doTIDE_Ambi() and clusterSplitProbTool is not None : InDetMergedPixelsTool.SplitProbTool = clusterSplitProbTool + if not InDetFlags.doTIDE_Ambi() and clusterSplitterTool is not None : InDetMergedPixelsTool.ClusterSplitter = clusterSplitterTool + ToolSvc += InDetMergedPixelsTool + from SiClusterizationTool.SiClusterizationToolConf import InDet__PixelGangedAmbiguitiesFinder + InDetPixelGangedAmbiguitiesFinder = InDet__PixelGangedAmbiguitiesFinder(name = "InDetPixelGangedAmbiguitiesFinder") + ToolSvc += InDetPixelGangedAmbiguitiesFinder + from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__PixelClusterization + InDetPixelClusterization = InDet__PixelClusterization(name = "InDetPixelClusterization", + clusteringTool = InDetMergedPixelsTool, + gangedAmbiguitiesFinder = InDetPixelGangedAmbiguitiesFinder, + DetectorManagerName = InDetKeys.PixelManager(), + DataObjectName = InDetKeys.PixelRDOs(), + ClustersName = InDetKeys.PixelClusters()) + topSequence += InDetPixelClusterization + +# For SCT +if doSCT: + # Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py + from SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool + InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name = "InDetSCT_ClusteringTool", + OutputLevel = INFO, + globalPosAlg = InDetClusterMakerTool, + conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool()) + if InDetFlags.selectSCTIntimeHits(): + if InDetFlags.InDet25nsec(): + InDetSCT_ClusteringTool.timeBins = "01X" + else: + InDetSCT_ClusteringTool.timeBins = "X1X" + from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization + InDetSCT_Clusterization = InDet__SCT_Clusterization(name = "InDetSCT_Clusterization", + clusteringTool = InDetSCT_ClusteringTool, + DataObjectName = InDetKeys.SCT_RDOs(), + ClustersName = InDetKeys.SCT_Clusters(), + conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool()) + if InDetFlags.cutSCTOccupancy(): + InDetSCT_Clusterization.maxFiredStrips = 384 + else: + InDetSCT_Clusterization.maxFiredStrips = 0 + if numThreads >= 2: + InDetSCT_Clusterization.Cardinality = numThreads + topSequence += InDetSCT_Clusterization + +# Set up InDet__SiTrackerSpacePointFinder (alg) +# Taken from InDetRecExample/share/InDetRecPreProcessingSilicon.py +from SiSpacePointTool.SiSpacePointToolConf import InDet__SiSpacePointMakerTool +InDetSiSpacePointMakerTool = InDet__SiSpacePointMakerTool(name = "InDetSiSpacePointMakerTool") +from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder +InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name = "InDetSiTrackerSpacePointFinder", + SiSpacePointMakerTool = InDetSiSpacePointMakerTool, + PixelsClustersName = InDetKeys.PixelClusters(), + SCT_ClustersName = InDetKeys.SCT_Clusters(), + SpacePointsPixelName = InDetKeys.PixelSpacePoints(), + SpacePointsSCTName = InDetKeys.SCT_SpacePoints(), + SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(), + ProcessPixels = DetFlags.haveRIO.pixel_on(), + ProcessSCTs = DetFlags.haveRIO.SCT_on(), + ProcessOverlaps = DetFlags.haveRIO.pixel_on() and DetFlags.haveRIO.SCT_on(), + OverrideBeamSpot = not doBeamSpot) +if numThreads >= 2: + InDetSiTrackerSpacePointFinder.Cardinality = numThreads +topSequence += InDetSiTrackerSpacePointFinder + +# Set up ConfiguredNewTrackingCuts +# Taken from InDetRecExample/share/InDetRec_jobOptions.py +from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts +NewTrackingCuts = None +if doPixel and doSCT: + NewTrackingCuts = ConfiguredNewTrackingCuts("Offline") +elif doPixel: + NewTrackingCuts = ConfiguredNewTrackingCuts("Pixel") +elif doSCT: + NewTrackingCuts = ConfiguredNewTrackingCuts("SCT") + +# Set up InDet__InDetPRD_AssociationToolGangedPixels (public) +if (NewTrackingCuts.mode() == "LowPt" or + NewTrackingCuts.mode() == "VeryLowPt" or + NewTrackingCuts.mode() == "LargeD0" or + NewTrackingCuts.mode() == "LowPtLargeD0" or + NewTrackingCuts.mode() == "BeamGas" or + NewTrackingCuts.mode() == "ForwardTracks" or + NewTrackingCuts.mode() == "ForwardSLHCTracks" or + NewTrackingCuts.mode() == "PixelPrdAssociation" or + NewTrackingCuts.mode() == "VeryForwardSLHCTracks" or + NewTrackingCuts.mode() == "SLHCConversionFinding"): + usePrdAssociationTool = True +else: + usePrdAssociationTool = False +InDetPrdAssociationTool = None +if usePrdAssociationTool: + # Taken from InDetRecExample/share/InDetRecLoadTools.py + from InDetAssociationTools.InDetAssociationToolsConf import InDet__InDetPRD_AssociationToolGangedPixels + InDetPrdAssociationTool = InDet__InDetPRD_AssociationToolGangedPixels(name = "InDetPrdAssociationTool", + PixelClusterAmbiguitiesMapName = InDetKeys.GangedPixelMap(), + addTRToutliers = False) ### + ToolSvc += InDetPrdAssociationTool + +# Set up InDet__SiSpacePointsSeedMaker_ATLxk (private) +# Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py +from SiSpacePointsSeedTool_xk.SiSpacePointsSeedTool_xkConf import InDet__SiSpacePointsSeedMaker_ATLxk as SiSpacePointsSeedMaker +InDetSiSpacePointsSeedMaker = SiSpacePointsSeedMaker(name = "InDetSpSeedsMaker"+NewTrackingCuts.extension(), + pTmin = NewTrackingCuts.minPT(), + maxdImpact = NewTrackingCuts.maxPrimaryImpact(), + maxZ = NewTrackingCuts.maxZImpact(), + minZ = -NewTrackingCuts.maxZImpact(), + usePixel = NewTrackingCuts.usePixel(), + SpacePointsPixelName = InDetKeys.PixelSpacePoints(), + useSCT = (NewTrackingCuts.useSCT() and NewTrackingCuts.useSCTSeeding()), + SpacePointsSCTName = InDetKeys.SCT_SpacePoints(), + useOverlapSpCollection = NewTrackingCuts.usePixel() and (NewTrackingCuts.useSCT() and NewTrackingCuts.useSCTSeeding()), ### + SpacePointsOverlapName = InDetKeys.OverlapSpacePoints(), + radMax = NewTrackingCuts.radMax(), + RapidityCut = NewTrackingCuts.maxEta(), + UseAssociationTool = usePrdAssociationTool, + AssociationTool = InDetPrdAssociationTool, + maxdImpactPPS = NewTrackingCuts.maxdImpactPPSSeeds(), + maxdImpactSSS = NewTrackingCuts.maxdImpactSSSSeeds()) +if not doBeamSpot: + InDetSiSpacePointsSeedMaker.BeamSpotKey = "" + +# Set up InDet__SiZvertexMaker_xk (private) +# Taken from ConfiguredNewTrackingSiPattern.py +from SiZvertexTool_xk.SiZvertexTool_xkConf import InDet__SiZvertexMaker_xk +InDetZvertexMaker = InDet__SiZvertexMaker_xk(name = "InDetZvertexMaker"+NewTrackingCuts.extension(), + Zmax = NewTrackingCuts.maxZImpact(), + Zmin = -NewTrackingCuts.maxZImpact(), + minRatio = 0.17, + SeedMakerTool = InDetSiSpacePointsSeedMaker) + +# Set up Trk__RungeKuttaPropagator (public) +# Taken from InDetRecExample/share/InDetRecLoadTools.py +from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator +InDetPatternPropagator = Propagator(name = "InDetPatternPropagator") +ToolSvc += InDetPatternPropagator + +# Set up InDet__SiDetElementsRoadMaker_xk (private) +# Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py +if not hasattr(condSeq, "InDet__SiDetElementsRoadCondAlg_xk"): + from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags + from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadCondAlg_xk + condSeq += InDet__SiDetElementsRoadCondAlg_xk(name = "InDet__SiDetElementsRoadCondAlg_xk", + UseDynamicAlignFolders = InDetGeometryFlags.useDynamicAlignFolders(), + usePixel = doPixel, + useSCT = doSCT) +from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk +InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(name = "InDetSiRoadMaker"+NewTrackingCuts.extension(), + PropagatorTool = InDetPatternPropagator, + usePixel = NewTrackingCuts.usePixel(), + PixManagerLocation = InDetKeys.PixelManager(), + useSCT = NewTrackingCuts.useSCT(), + RoadWidth = NewTrackingCuts.RoadWidth()) + +# Set up InDetPatternUpdator (public) +# Taken from InDetRecExample/share/InDetRecLoadTools.py +from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk +InDetPatternUpdator = Trk__KalmanUpdator_xk(name = "InDetPatternUpdator") +ToolSvc += InDetPatternUpdator + +# Set up InDet__PixelClusterOnTrackTool (public) +PixelClusterOnTrackTool = None +if doPixel: + # Taken from InDetRecExample/share/InDetRecLoadTools.py + from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool + PixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("InDetPixelClusterOnTrackTool", + LorentzAngleTool = ToolSvc.PixelLorentzAngleTool, + DisableDistortions = (InDetFlags.doFatras() or InDetFlags.doDBMstandalone()), + applyNNcorrection = ( InDetFlags.doPixelClusterSplitting() and + InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()), + NNIBLcorrection = ( InDetFlags.doPixelClusterSplitting() and + InDetFlags.pixelClusterSplittingType() == "NeuralNet" and not InDetFlags.doSLHC()), + SplitClusterAmbiguityMap = InDetKeys.SplitClusterAmbiguityMap(), + RunningTIDE_Ambi = InDetFlags.doTIDE_Ambi()) + PixelClusterOnTrackTool.NnClusterizationFactory = NnClusterizationFactory + ToolSvc += PixelClusterOnTrackTool + +# Set up InDet__SCT_ClusterOnTrackTool (private) +SCT_ClusterOnTrackTool = None +if doSCT: + # Taken from InDetRecExample/share/InDetRecLoadTools.py + from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__SCT_ClusterOnTrackTool + SCT_ClusterOnTrackTool = InDet__SCT_ClusterOnTrackTool("InDetSCT_ClusterOnTrackTool", + CorrectionStrategy = 0, # do correct position bias + ErrorStrategy = 2, # do use phi dependent errors + LorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool) + +# Set up InDetRotCreator (public) +# Taken from InDetRecExample/share/InDetRecLoadTools.py +from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator +InDetRotCreator = Trk__RIO_OnTrackCreator(name = "InDetRotCreator", + ToolPixelCluster = PixelClusterOnTrackTool, + ToolSCT_Cluster = SCT_ClusterOnTrackTool, + ToolTRT_DriftCircle = None, + Mode = "indet") +ToolSvc += InDetRotCreator + +# Set up SiCombinatorialTrackFinder_xk (private) +# Taken from InDetRecExample/share/InDetRecLoadTools.py +from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiCombinatorialTrackFinder_xk +InDetSiComTrackFinder = InDet__SiCombinatorialTrackFinder_xk(name = "InDetSiComTrackFinder", + PropagatorTool = InDetPatternPropagator, + UpdatorTool = InDetPatternUpdator, + RIOonTrackTool = InDetRotCreator, + SctSummaryTool = SCT_ConditionsSummaryTool, + AssosiationTool = InDetPrdAssociationTool, + usePixel = DetFlags.haveRIO.pixel_on(), + useSCT = DetFlags.haveRIO.SCT_on(), + PixManagerLocation = InDetKeys.PixelManager(), + PixelClusterContainer = InDetKeys.PixelClusters(), + SCT_ClusterContainer = InDetKeys.SCT_Clusters()) + +# Set up SiTrackMaker_xk (private) +# Taken from InDetRecExample/share/ConfiguredNewTrackingSiPattern.py +# useBremMode = NewTrackingCuts.mode() == "Offline" or NewTrackingCuts.mode() == "SLHC" +useBremMode = False ### +InDetFlags.doCaloSeededBrem.set_Value_and_Lock(False) ### +InDetFlags.doHadCaloSeededSSS.set_Value_and_Lock(False) ### +InDetKeys.CaloClusterROIContainer.set_Value_and_Lock("") ### +InDetKeys.HadCaloClusterROIContainer.set_Value_and_Lock("") ### +from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker +InDetSiTrackMaker = SiTrackMaker(name = "InDetSiTrackMaker"+NewTrackingCuts.extension(), + useSCT = NewTrackingCuts.useSCT(), + usePixel = NewTrackingCuts.usePixel(), + RoadTool = InDetSiDetElementsRoadMaker, + CombinatorialTrackFinder = InDetSiComTrackFinder, + pTmin = NewTrackingCuts.minPT(), + pTminBrem = NewTrackingCuts.minPTBrem(), + pTminSSS = InDetFlags.pT_SSScut(), + nClustersMin = NewTrackingCuts.minClusters(), + nHolesMax = NewTrackingCuts.nHolesMax(), + nHolesGapMax = NewTrackingCuts.nHolesGapMax(), + SeedsFilterLevel = NewTrackingCuts.seedFilterLevel(), + Xi2max = NewTrackingCuts.Xi2max(), + Xi2maxNoAdd = NewTrackingCuts.Xi2maxNoAdd(), + nWeightedClustersMin = NewTrackingCuts.nWeightedClustersMin(), + CosmicTrack = InDetFlags.doCosmics(), + Xi2maxMultiTracks = NewTrackingCuts.Xi2max(), # was 3. + useSSSseedsFilter = InDetFlags.doSSSfilter(), + doMultiTracksProd = True, + useBremModel = InDetFlags.doBremRecovery() and useBremMode, # only for NewTracking the brem is debugged !!! + doCaloSeededBrem = InDetFlags.doCaloSeededBrem(), + doHadCaloSeedSSS = InDetFlags.doHadCaloSeededSSS(), + phiWidth = NewTrackingCuts.phiWidthBrem(), + etaWidth = NewTrackingCuts.etaWidthBrem(), + InputClusterContainerName = InDetKeys.CaloClusterROIContainer(), # "InDetCaloClusterROIs" + InputHadClusterContainerName = InDetKeys.HadCaloClusterROIContainer(), # "InDetCaloClusterROIs" + UseAssociationTool = usePrdAssociationTool) +InDetSiTrackMaker.TrackPatternRecoInfo = "SiSPSeededFinder" +if not doBeamSpot: + InDetSiTrackMaker.BeamSpotKey = "" + +# Set up SiSPSeededTrackFinder (alg) +# InDetRecExample/share/ConfiguredNewTrackingSiPattern.py +from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder +InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(name = "InDetSiSpTrackFinder"+NewTrackingCuts.extension(), + TrackTool = InDetSiTrackMaker, + TracksLocation = TracksLocation, + SeedsTool = InDetSiSpacePointsSeedMaker, + useZvertexTool = InDetFlags.useZvertexTool() and NewTrackingCuts.mode() != "DBM", + ZvertexTool = InDetZvertexMaker, + useNewStrategy = InDetFlags.useNewSiSPSeededTF() and NewTrackingCuts.mode() != "DBM", + useMBTSTimeDiff = InDetFlags.useMBTSTimeDiff(), + useZBoundFinding = NewTrackingCuts.doZBoundary() and NewTrackingCuts.mode() != "DBM") +if not doBeamSpot: + InDetSiSPSeededTrackFinder.BeamSpotKey = "" +if not doPixel: + InDetSiSPSeededTrackFinder.SpacePointsPixelName = "" +if not doSCT: + InDetSiSPSeededTrackFinder.SpacePointsSCTName = "" + +if doPrint: + print InDetSiSPSeededTrackFinder +if numThreads >= 2: + InDetSiSPSeededTrackFinder.Cardinality = numThreads +topSequence += InDetSiSPSeededTrackFinder + +# Print algorithms +if doPrint: + print topSequence + +# Set the number of events to be processed +theApp.EvtMax = 10 + +#-------------------------------------------------------------- +# Set output lvl (VERBOSE, DEBUG, INFO, WARNING, ERROR, FATAL) +#-------------------------------------------------------------- +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.Format = "% F%50W%S%7W%R%T %0W%M" + +if numThreads >= 2: + from SCT_ConditionsAlgorithms.SCTCondAlgCardinality import sctCondAlgCardinality + sctCondAlgCardinality.set(numThreads) diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx index d74dfe49e6ca5bf62f9a4303bc8a3b7d75aa6e2b..0958f967de99a27d7470e36ff9d98b71f15c2752 100644 --- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx +++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx @@ -75,7 +75,7 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize ATLAS_NOT_THREAD_SAF // Get tool for track-prd association // - if (m_usePIX) { + if (not m_assoTool.empty()) { ATH_CHECK(m_assoTool.retrieve()); } else { m_assoTool.disable(); @@ -226,7 +226,7 @@ MsgStream& InDet::SiCombinatorialTrackFinder_xk::dumpconditions(MsgStream& out) s8.append("|"); std::string s9; - if (m_usePIX) { + if (not m_assoTool.empty()) { n = 62-m_assoTool.type().size(); for (int i=0; i<n; ++i) s9.append(" "); s9.append("|"); @@ -244,7 +244,7 @@ MsgStream& InDet::SiCombinatorialTrackFinder_xk::dumpconditions(MsgStream& out) out<<"| Tool for propagation | "<<m_proptool .type()<<s1<<std::endl; out<<"| Tool for updator | "<<m_updatortool.type()<<s4<<std::endl; out<<"| Tool for rio on track | "<<m_riocreator .type()<<s5<<std::endl; - if (m_usePIX) { + if (not m_assoTool.empty()) { out<<"| Tool for track-prd assos| "<<m_assoTool .type()<<s9<<std::endl; } out<<"| Magnetic field mode | "<<fieldmode[mode] <<s3<<std::endl; @@ -582,8 +582,16 @@ bool InDet::SiCombinatorialTrackFinder_xk::findTrack std::list<const InDet::SiDetElementBoundaryLink_xk*> DEL; detectorElementLinks(DE, DEL); - SG::ReadHandle<InDet::SiClusterContainer> pixcontainer(m_pixcontainerkey); - SG::ReadHandle<InDet::SiClusterContainer> sctcontainer(m_sctcontainerkey); + const InDet::SiClusterContainer* p_pixcontainer = nullptr; + if (m_usePIX) { + SG::ReadHandle<InDet::SiClusterContainer> pixcontainer(m_pixcontainerkey); + p_pixcontainer = pixcontainer.ptr(); + } + const InDet::SiClusterContainer* p_sctcontainer = nullptr; + if (m_useSCT) { + SG::ReadHandle<InDet::SiClusterContainer> sctcontainer(m_sctcontainerkey); + p_sctcontainer = sctcontainer.ptr(); + } // List cluster preparation // @@ -596,22 +604,22 @@ bool InDet::SiCombinatorialTrackFinder_xk::findTrack } if (Sp.size()<=2) TWO = true; } else if (Gp.size() > 2) { - if (!data.trajectory.globalPositionsToClusters(pixcontainer.ptr(), sctcontainer.ptr(), Gp, DEL, PT, Cl)) return false; + if (!data.trajectory.globalPositionsToClusters(p_pixcontainer, p_sctcontainer, Gp, DEL, PT, Cl)) return false; } else { - if (!data.trajectory.trackParametersToClusters(pixcontainer.ptr(), sctcontainer.ptr(), Tp, DEL, PT, Cl)) return false; + if (!data.trajectory.trackParametersToClusters(p_pixcontainer, p_sctcontainer, Tp, DEL, PT, Cl)) return false; } ++data.goodseeds; // Build initial trajectory // bool Qr; - bool Q = data.trajectory.initialize(m_usePIX, m_useSCT, pixcontainer.ptr(), sctcontainer.ptr(), Tp, Cl, DEL, Qr); + bool Q = data.trajectory.initialize(m_usePIX, m_useSCT, p_pixcontainer, p_sctcontainer, Tp, Cl, DEL, Qr); if (!Q && Sp.size() < 2 && Gp.size() > 3) { Cl.clear(); - if (!data.trajectory.trackParametersToClusters(pixcontainer.ptr(), sctcontainer.ptr(), Tp, DEL, PT, Cl)) return false; - if (!data.trajectory.initialize(m_usePIX, m_useSCT, pixcontainer.ptr(), sctcontainer.ptr(), Tp, Cl, DEL, Qr)) return false; + if (!data.trajectory.trackParametersToClusters(p_pixcontainer, p_sctcontainer, Tp, DEL, PT, Cl)) return false; + if (!data.trajectory.initialize(m_usePIX, m_useSCT, p_pixcontainer, p_sctcontainer, Tp, Cl, DEL, Qr)) return false; Q = Qr = true; } @@ -822,10 +830,13 @@ void InDet::SiCombinatorialTrackFinder_xk::detectorElementLinks (std::list<const InDetDD::SiDetectorElement*> & DE, std::list<const InDet::SiDetElementBoundaryLink_xk*>& DEL) const { - SG::ReadCondHandle<InDet::SiDetElementBoundaryLinks_xk> boundarySCTHandle(m_boundarySCTKey); - const InDet::SiDetElementBoundaryLinks_xk* boundarySCT{*boundarySCTHandle}; - if (boundarySCT==nullptr) { - ATH_MSG_FATAL(m_boundarySCTKey.fullKey() << " returns null pointer"); + const InDet::SiDetElementBoundaryLinks_xk* boundarySCT{nullptr}; + if (m_useSCT) { + SG::ReadCondHandle<InDet::SiDetElementBoundaryLinks_xk> boundarySCTHandle(m_boundarySCTKey); + boundarySCT = *boundarySCTHandle; + if (boundarySCT==nullptr) { + ATH_MSG_FATAL(m_boundarySCTKey.fullKey() << " returns null pointer"); + } } for (const InDetDD::SiDetectorElement* d: DE) { @@ -915,9 +926,10 @@ InDet::SiCombinatorialTrackFinder_xk::EventData& InDet::SiCombinatorialTrackFind // Set SiTools and conditions // m_eventData[slot].tools.setTools(&*m_proptool, &*m_updatortool, &*m_riocreator, - (m_usePIX ? &*m_assoTool : nullptr), + ((not m_assoTool.empty()) ? &*m_assoTool : nullptr), &*m_fieldServiceHandle); - m_eventData[slot].tools.setTools(&*m_pixelCondSummaryTool, &*m_sctCondSummaryTool); + m_eventData[slot].tools.setTools(m_usePIX ? &*m_pixelCondSummaryTool : nullptr, + m_useSCT ? &*m_sctCondSummaryTool : nullptr); m_eventData[slot].tools.setTools(&m_fieldprop); // Set tool to trajectory