diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt index 8b7c9697af27bc8182f6630c3df82d7bfe7d933f..6a354f207ed5ab2b785f9d93bef2f74a34a613d9 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/CMakeLists.txt @@ -31,4 +31,4 @@ atlas_add_component( SiSPSeededTrackFinder # Install files from the package: atlas_install_headers( SiSPSeededTrackFinder ) - +atlas_install_joboptions( share/*.py ) diff --git a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py new file mode 100644 index 0000000000000000000000000000000000000000..7c7baf637a228c6b2a85da4b3678f08c9a8c938f --- /dev/null +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/share/SiSPSeededSCTTracksStandalone.py @@ -0,0 +1,361 @@ +############################################################### +# +# Standalone job options file to create SiSPSeededSCTTracks +# +#============================================================== + +doPrint = False + +#-------------------------------------------------------------- +# Standard includes +#-------------------------------------------------------------- +import AthenaCommon.AtlasUnixStandardJob + +#-------------------------------------------------------------- +# 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 AthenaCommon.AppMgr import ServiceMgr +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 InnerDetector +from AthenaCommon.DetFlags import DetFlags +DetFlags.detdescr.SCT_setOn() +DetFlags.ID_setOff() +DetFlags.Calo_setOff() +DetFlags.Muon_setOff() +DetFlags.Truth_setOff() +DetFlags.LVL1_setOff() +DetFlags.SCT_setOn() + +# ---- switch parts of ID off/on as follows +#switch off tasks +DetFlags.pileup.all_setOff() +DetFlags.simulate.all_setOff() +DetFlags.makeRIO.all_setOff() +DetFlags.makeRIO.SCT_setOn() +DetFlags.writeBS.all_setOff() +DetFlags.readRDOBS.all_setOff() +DetFlags.readRDOBS.SCT_setOn() +DetFlags.readRIOBS.all_setOff() +DetFlags.readRIOPool.all_setOff() +DetFlags.writeRIOPool.all_setOff() + +if doPrint: + DetFlags.Print() + +import AtlasGeoModel.SetGeometryVersion +import AtlasGeoModel.GeoModelInit +import MagFieldServices.SetupField + +#-------------------------------------------------------------- +# Load IOVDbSvc +#-------------------------------------------------------------- +IOVDbSvc = Service("IOVDbSvc") +from IOVDbSvc.CondDB import conddb +conddb.dbdata="CONDBR2" +IOVDbSvc.GlobalTag="CONDBR2-BLKPA-2018-03" +IOVDbSvc.OutputLevel = WARNING + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +# EventInfo setup +if not hasattr(topSequence, "xAODMaker::EventInfoCnvAlg"): + from xAODEventInfoCnv.xAODEventInfoCreator import xAODMaker__EventInfoCnvAlg + topSequence +=xAODMaker__EventInfoCnvAlg() + +# 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 byte stream converters (SCTRawDataProvider, SCTRawDataProviderTool, SCT_RodDecoder, SCTEventFlagWriter) +include("InDetRecExample/InDetReadBS_jobOptions.py") +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 SCT clsutering +from SiLorentzAngleTool.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup +sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() +from SiClusterizationTool.SiClusterizationToolConf import InDet__ClusterMakerTool +InDetClusterMakerTool = InDet__ClusterMakerTool(name = "InDetClusterMakerTool", + PixelCablingSvc = None, + PixelModuleData = "", + PixelChargeCalibCondData = "", + PixelLorentzAngleTool = None, + SCTLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool) + +# SCT conditions setups +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 SiClusterizationTool.SiClusterizationToolConf import InDet__SCT_ClusteringTool +InDetSCT_ClusteringTool = InDet__SCT_ClusteringTool(name = "InDetSCT_ClusteringTool", + OutputLevel = INFO, + globalPosAlg = InDetClusterMakerTool, + timeBins = "01X", + conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool()) +from InDetPrepRawDataFormation.InDetPrepRawDataFormationConf import InDet__SCT_Clusterization +InDetSCT_Clusterization = InDet__SCT_Clusterization(name = "InDetSCT_Clusterization", + OutputLevel = INFO, + clusteringTool = InDetSCT_ClusteringTool, + conditionsTool = sct_ConditionsSummaryToolSetupWithoutFlagged.getTool(), + DataObjectName = "SCT_RDOs", + ClustersName = "SCT_Clusters", + maxFiredStrips = 384) +if numThreads >= 2: + InDetSCT_Clusterization.Cardinality = numThreads + +topSequence += InDetSCT_Clusterization + +# Set up SCT_ConditionsSummaryTestAlg with SCT_FlaggedConditionTool +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()] + +# Set up space point formation +from AthenaCommon.AlgSequence import AthSequencer +condSeq = AthSequencer("AthCondSeq") +if not hasattr(condSeq, "InDetSiElementPropertiesTableCondAlg"): + from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiElementPropertiesTableCondAlg + condSeq += InDet__SiElementPropertiesTableCondAlg(name = "InDetSiElementPropertiesTableCondAlg") +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 = "", + SCT_ClustersName = "SCT_Clusters", + SpacePointsPixelName = "", + SpacePointsSCTName = "SCT_SpacePoints", + SpacePointsOverlapName = "OverlapSpacePoints", + ProcessPixels = False, + ProcessSCTs = True, + ProcessOverlaps = False, + OverrideBeamSpot = True) +if numThreads >= 2: + InDetSiTrackerSpacePointFinder.Cardinality = numThreads +topSequence += InDetSiTrackerSpacePointFinder + +# Setup SiSPSeededTrackFinder +if not hasattr(condSeq, "InDetSiDetElementBoundaryLinksCondAlg"): + from SiCombinatorialTrackFinderTool_xk.SiCombinatorialTrackFinderTool_xkConf import InDet__SiDetElementBoundaryLinksCondAlg_xk + condSeq += InDet__SiDetElementBoundaryLinksCondAlg_xk(name = "InDetSiDetElementBoundaryLinksCondAlg") + +from InDetRecExample.ConfiguredNewTrackingCuts import ConfiguredNewTrackingCuts +NewTrackingCuts = ConfiguredNewTrackingCuts("SCT") + +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 = False, + SpacePointsPixelName = "", + useSCT = (NewTrackingCuts.useSCT() and NewTrackingCuts.useSCTSeeding()), + SpacePointsSCTName = "SCT_SpacePoints", + useOverlapSpCollection = True, + SpacePointsOverlapName = "OverlapSpacePoints", + radMax = NewTrackingCuts.radMax(), + RapidityCut = NewTrackingCuts.maxEta(), + UseAssociationTool = False, + AssociationTool = None, + BeamSpotKey = "") + +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) + +from TrkExRungeKuttaPropagator.TrkExRungeKuttaPropagatorConf import Trk__RungeKuttaPropagator as Propagator +InDetPatternPropagator = Propagator(name = 'InDetPatternPropagator') +from AthenaCommon.AppMgr import ToolSvc +ToolSvc += InDetPatternPropagator + +if not hasattr(condSeq, "InDet__SiDetElementsRoadCondAlg_xk"): + from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadCondAlg_xk + useDynamicAlignFolders = False + condSeq += InDet__SiDetElementsRoadCondAlg_xk(name = "InDet__SiDetElementsRoadCondAlg_xk", + UseDynamicAlignFolders = useDynamicAlignFolders, + usePixel = False) + +from SiDetElementsRoadTool_xk.SiDetElementsRoadTool_xkConf import InDet__SiDetElementsRoadMaker_xk +InDetSiDetElementsRoadMaker = InDet__SiDetElementsRoadMaker_xk(name = 'InDetSiRoadMaker'+NewTrackingCuts.extension(), + PropagatorTool = InDetPatternPropagator, + usePixel = False, + useSCT = NewTrackingCuts.useSCT(), + SCTManagerLocation = "SCT", + RoadWidth = NewTrackingCuts.RoadWidth()) + +from TrkMeasurementUpdator_xk.TrkMeasurementUpdator_xkConf import Trk__KalmanUpdator_xk +InDetPatternUpdator = Trk__KalmanUpdator_xk(name = 'InDetPatternUpdator') +ToolSvc += InDetPatternUpdator + +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) +from TrkRIO_OnTrackCreator.TrkRIO_OnTrackCreatorConf import Trk__RIO_OnTrackCreator +InDetRotCreator = Trk__RIO_OnTrackCreator(name = 'InDetRotCreator', + ToolPixelCluster = None, + ToolSCT_Cluster = SCT_ClusterOnTrackTool, + ToolTRT_DriftCircle = None, + Mode = 'indet') +ToolSvc += InDetRotCreator + +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 = None, + usePixel = False, + PixelClusterContainer = "", + useSCT = True, + SCTManagerLocation = "SCT", + SCT_ClusterContainer = "SCT_Clusters") +ToolSvc += InDetSiComTrackFinder + +from SiTrackMakerTool_xk.SiTrackMakerTool_xkConf import InDet__SiTrackMaker_xk as SiTrackMaker +InDetSiTrackMaker = SiTrackMaker(name = 'InDetSiTrackMaker'+NewTrackingCuts.extension(), + useSCT = NewTrackingCuts.useSCT(), + usePixel = False, + RoadTool = InDetSiDetElementsRoadMaker, + CombinatorialTrackFinder = InDetSiComTrackFinder, + pTmin = NewTrackingCuts.minPT(), + pTminBrem = NewTrackingCuts.minPTBrem(), + pTminSSS = -1., + 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 = True, + doMultiTracksProd = True, + useBremModel = False, + doCaloSeededBrem = False, + doHadCaloSeedSSS = False, + phiWidth = NewTrackingCuts.phiWidthBrem(), + etaWidth = NewTrackingCuts.etaWidthBrem(), + InputClusterContainerName = "", + InputHadClusterContainerName = "", + UseAssociationTool = False, + TrackPatternRecoInfo = "SiSPSeededFinder", + BeamSpotKey = "") + +from SiSPSeededTrackFinder.SiSPSeededTrackFinderConf import InDet__SiSPSeededTrackFinder +InDetSiSPSeededTrackFinder = InDet__SiSPSeededTrackFinder(name = 'InDetSiSpTrackFinder'+NewTrackingCuts.extension(), + TrackTool = InDetSiTrackMaker, + TracksLocation = "SiSPSeededSCTTracks", + SeedsTool = InDetSiSpacePointsSeedMaker, + SpacePointsPixelName = "", + useZvertexTool = True, + ZvertexTool = InDetZvertexMaker, + useNewStrategy = False, + useMBTSTimeDiff = False, + useZBoundFinding = NewTrackingCuts.doZBoundary(), + BeamSpotKey = "") +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 = -1 + +#-------------------------------------------------------------- +# 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/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx index d60da680bc0338ab522d8e43c6eb6cafe5ac3539..6c5f5f26fb24c32f4803d0120eb1de721843e1a2 100644 --- a/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx +++ b/InnerDetector/InDetRecAlgs/SiSPSeededTrackFinder/src/SiSPSeededTrackFinder.cxx @@ -25,8 +25,12 @@ InDet::SiSPSeededTrackFinder::SiSPSeededTrackFinder StatusCode InDet::SiSPSeededTrackFinder::initialize() { ATH_CHECK(m_evtKey.initialize()); - ATH_CHECK(m_SpacePointsSCTKey.initialize()); - ATH_CHECK(m_SpacePointsPixelKey.initialize()); + if (not m_SpacePointsPixelKey.empty()) { + ATH_CHECK(m_SpacePointsPixelKey.initialize()); + } + if (not m_SpacePointsSCTKey.empty()) { + ATH_CHECK(m_SpacePointsSCTKey.initialize()); + } ATH_CHECK(m_outputTracksKey.initialize()); // Get tool for space points seed maker @@ -403,28 +407,32 @@ bool InDet::SiSPSeededTrackFinder::isGoodEvent() const { // Test total number pixels space points // unsigned int nsp = 0; - SG::ReadHandle<SpacePointContainer> spacePointsPixel{m_SpacePointsPixelKey}; - if (not spacePointsPixel.isValid()) { - for (const SpacePointCollection* spc: *spacePointsPixel) { - nsp += spc->size(); - } - if (static_cast<int>(nsp) > m_maxPIXsp) { - ATH_MSG_WARNING("Found more than "<<m_maxPIXsp<<" pixels space points in background event. Skip track finding"); - return false; + if (not m_SpacePointsPixelKey.empty()) { + SG::ReadHandle<SpacePointContainer> spacePointsPixel{m_SpacePointsPixelKey}; + if (not spacePointsPixel.isValid()) { + for (const SpacePointCollection* spc: *spacePointsPixel) { + nsp += spc->size(); + } + if (static_cast<int>(nsp) > m_maxPIXsp) { + ATH_MSG_WARNING("Found more than "<<m_maxPIXsp<<" pixels space points in background event. Skip track finding"); + return false; + } } } // Test total number sct space points // nsp = 0; - SG::ReadHandle<SpacePointContainer> spacePointsSCT{m_SpacePointsSCTKey}; - if (not spacePointsSCT.isValid()) { - for (const SpacePointCollection* spc: *spacePointsSCT) { - nsp += spc->size(); - } - if (static_cast<int>(nsp) > m_maxSCTsp) { - ATH_MSG_WARNING("Found more than "<<m_maxSCTsp<<" sct space points in background event. Skip track finding"); - return false; + if (not m_SpacePointsSCTKey.empty()) { + SG::ReadHandle<SpacePointContainer> spacePointsSCT{m_SpacePointsSCTKey}; + if (not spacePointsSCT.isValid()) { + for (const SpacePointCollection* spc: *spacePointsSCT) { + nsp += spc->size(); + } + if (static_cast<int>(nsp) > m_maxSCTsp) { + ATH_MSG_WARNING("Found more than "<<m_maxSCTsp<<" sct space points in background event. Skip track finding"); + return false; + } } } diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx index ca9e5d5177de97c009e5c2c1cff7582f8abaa35c..b9c22908f291121829bda8c79c789e8a90ec3449 100644 --- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx +++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx @@ -76,7 +76,11 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize ATLAS_NOT_THREAD_SAF // Get tool for track-prd association // - ATH_CHECK(m_assoTool.retrieve()); + if (m_usePIX) { + ATH_CHECK(m_assoTool.retrieve()); + } else { + m_assoTool.disable(); + } if (m_usePIX) { if ( m_pixelCondSummaryTool.retrieve().isFailure() ) { @@ -120,14 +124,15 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize ATLAS_NOT_THREAD_SAF // register the Callback // - StatusCode sc = detStore()->regFcn(&InDet::SiCombinatorialTrackFinder_xk::mapDetectorElementsProduction, - this, tagInfoH, m_callbackString); - - if (sc==StatusCode::SUCCESS) { - ATH_MSG_INFO("Registered callback for geometry " << name()); - } else { - ATH_MSG_ERROR("Could not book callback for geometry " << name ()); - return StatusCode::FAILURE; + if (m_usePIX) { + StatusCode sc = detStore()->regFcn(&InDet::SiCombinatorialTrackFinder_xk::mapDetectorElementsProduction, + this, tagInfoH, m_callbackString); + if (sc==StatusCode::SUCCESS) { + ATH_MSG_INFO("Registered callback for geometry " << name()); + } else { + ATH_MSG_ERROR("Could not book callback for geometry " << name ()); + return StatusCode::FAILURE; + } } if ( !m_fieldServiceHandle.retrieve() ) { @@ -144,12 +149,16 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize ATLAS_NOT_THREAD_SAF // m_outputlevel = msg().level()-MSG::DEBUG; - ATH_CHECK( m_pixcontainerkey.initialize() ); - ATH_CHECK( m_sctcontainerkey.initialize() ); - ATH_CHECK( m_boundarySCTKey.initialize() ); - ATH_CHECK( m_SCTDetEleCollKey.initialize() ); + if (m_usePIX) { + ATH_CHECK( m_pixcontainerkey.initialize() ); + } + if (m_useSCT) { + ATH_CHECK( m_sctcontainerkey.initialize() ); + ATH_CHECK( m_boundarySCTKey.initialize() ); + ATH_CHECK( m_SCTDetEleCollKey.initialize() ); + } - return sc; + return StatusCode::SUCCESS; } /////////////////////////////////////////////////////////////////// @@ -217,10 +226,12 @@ MsgStream& InDet::SiCombinatorialTrackFinder_xk::dumpconditions(MsgStream& out) for (int i=0; i<n; ++i) s8.append(" "); s8.append("|"); - n = 62-m_assoTool.type().size(); std::string s9; - for (int i=0; i<n; ++i) s9.append(" "); - s9.append("|"); + if (m_usePIX) { + n = 62-m_assoTool.type().size(); + for (int i=0; i<n; ++i) s9.append(" "); + s9.append("|"); + } out<<"|----------------------------------------------------------------------" <<"-------------------|" @@ -234,7 +245,9 @@ 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; - out<<"| Tool for track-prd assos| "<<m_assoTool .type()<<s9<<std::endl; + if (m_usePIX) { + out<<"| Tool for track-prd assos| "<<m_assoTool .type()<<s9<<std::endl; + } out<<"| Magnetic field mode | "<<fieldmode[mode] <<s3<<std::endl; out<<"|----------------------------------------------------------------------" <<"-------------------|" @@ -701,17 +714,13 @@ void InDet::SiCombinatorialTrackFinder_xk::magneticFieldInit() StatusCode InDet::SiCombinatorialTrackFinder_xk::mapDetectorElementsProduction (IOVSVC_CALLBACK_ARGS_P(/*I*/, keys)) { - StatusCode sc; - // Get Pixel Detector Manager // const InDetDD::PixelDetectorManager* pixmgr = nullptr; - if (m_usePIX) { - sc = detStore()->retrieve(pixmgr, m_pixm); - if (sc.isFailure() || !pixmgr) { - ATH_MSG_FATAL("Could not get PixelDetectorManager !"); + StatusCode sc = detStore()->retrieve(pixmgr, m_pixm); + if (sc.isFailure() || !pixmgr) { + ATH_MSG_FATAL("Could not get PixelDetectorManager !"); return StatusCode::FAILURE; - } } // check if the string is ESD for guaranteeing that misalignment has been introduced already @@ -730,7 +739,7 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::mapDetectorElementsProduction const PixelID* IDp = nullptr; - if (m_usePIX && detStore()->retrieve(IDp, "PixelID").isFailure()) { + if (detStore()->retrieve(IDp, "PixelID").isFailure()) { ATH_MSG_FATAL("Could not get Pixel ID helper"); return StatusCode::FAILURE; } @@ -906,7 +915,9 @@ InDet::SiCombinatorialTrackFinder_xk::EventData& InDet::SiCombinatorialTrackFind // Set SiTools and conditions // - m_eventData[slot].tools.setTools(&*m_proptool, &*m_updatortool, &*m_riocreator, &*m_assoTool, &*m_fieldServiceHandle); + m_eventData[slot].tools.setTools(&*m_proptool, &*m_updatortool, &*m_riocreator, + (m_usePIX ? &*m_assoTool : nullptr), + &*m_fieldServiceHandle); m_eventData[slot].tools.setTools(&*m_pixelCondSummaryTool, &*m_sctCondSummaryTool); m_eventData[slot].tools.setTools(m_fieldprop); diff --git a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx index c97d507a972bd9379472975dae0d3f8aaa3ec2a4..317031ce24d0736996b1505cbb249b9c7125add7 100644 --- a/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx +++ b/InnerDetector/InDetRecTools/SiSpacePointsSeedTool_xk/src/SiSpacePointsSeedMaker_ATLxk.cxx @@ -78,7 +78,9 @@ StatusCode InDet::SiSpacePointsSeedMaker_ATLxk::initialize() // Get beam geometry // - ATH_CHECK(m_beamSpotKey.initialize()); + if (not m_beamSpotKey.empty()) { + ATH_CHECK(m_beamSpotKey.initialize()); + } // Get magnetic field service // @@ -141,7 +143,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newEvent(int iteration) m_dzdrmax = m_dzdrmax0; m_umax = 100. ; if (!m_iteration) { - buildBeamFrameWork(); + if (not m_beamSpotKey.empty()) { + buildBeamFrameWork(); + } double f[3], gP[3] ={10.,10.,0.}; if (m_fieldServiceHandle->solenoidOn()) { @@ -308,7 +312,9 @@ void InDet::SiSpacePointsSeedMaker_ATLxk::newRegion m_dzdrmax = m_dzdrmax0; m_umax = 100. ; - buildBeamFrameWork(); + if (not m_beamSpotKey.empty()) { + buildBeamFrameWork(); + } double f[3], gP[3] ={10.,10.,0.}; diff --git a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx index 051c8cef9b43cf603561708de29cbb69c4da554a..acf393b5cf773cfc33542a0563edd122a571d0d2 100644 --- a/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx +++ b/InnerDetector/InDetRecTools/SiTrackMakerTool_xk/src/SiTrackMaker_xk.cxx @@ -39,7 +39,9 @@ StatusCode InDet::SiTrackMaker_xk::initialize() { // Get beam geometry // - ATH_CHECK( m_beamSpotKey.initialize() ); + if (not m_beamSpotKey.empty()) { + ATH_CHECK( m_beamSpotKey.initialize() ); + } // Get magnetic field service // @@ -257,13 +259,15 @@ std::ostream& InDet::operator << void InDet::SiTrackMaker_xk::newEvent(bool PIX, bool SCT) const { EventData& data{getEventData()}; - SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; - if (beamSpotHandle.isValid()) { - data.xybeam[0] = beamSpotHandle->beamPos()[0]; - data.xybeam[1] = beamSpotHandle->beamPos()[1]; - } else { - data.xybeam[0] = 0.; - data.xybeam[1] = 0.; + + data.xybeam[0] = 0.; + data.xybeam[1] = 0.; + if (not m_beamSpotKey.empty()) { + SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey }; + if (beamSpotHandle.isValid()) { + data.xybeam[0] = beamSpotHandle->beamPos()[0]; + data.xybeam[1] = beamSpotHandle->beamPos()[1]; + } } data.pix = PIX and m_usePix;