diff --git a/CLDConfig/CLDReconstruction.py b/CLDConfig/CLDReconstruction.py index f932131..225b18d 100644 --- a/CLDConfig/CLDReconstruction.py +++ b/CLDConfig/CLDReconstruction.py @@ -35,6 +35,7 @@ parser_group.add_argument("--enableLCFIJet", action="store_true", help="Enable LCFIPlus jet clustering parts", default=False) parser_group.add_argument("--cms", action="store", help="Choose a Centre-of-Mass energy", default=240, choices=(91, 160, 240, 365), type=int) parser_group.add_argument("--compactFile", help="Compact detector file to use", type=str, default=os.environ["K4GEO"] + "/FCCee/CLD/compact/CLD_o2_v07/CLD_o2_v07.xml") +parser_group.add_argument("--detailedDigitization", action="store_true", default=False, help="Use detailed digitization for the tracker (k4Rectracker/VTXdigiDetailed), instead of parametric digitization") tracking_group = parser_group.add_mutually_exclusive_group() tracking_group.add_argument("--conformalTracking", action="store_true", default=True, help="Use conformal tracking pattern recognition") tracking_group.add_argument("--truthTracking", action="store_true", default=False, help="Cheat tracking pattern recognition") @@ -115,7 +116,10 @@ algList.append(MyAIDAProcessor) sequenceLoader.load("Overlay/Overlay") # tracker hit digitisation -sequenceLoader.load("Tracking/TrackingDigi") +if reco_args.detailedDigitization: + sequenceLoader.load("Tracking/TrackingDigiDetailed") +else: + sequenceLoader.load("Tracking/TrackingDigi") # tracking if reco_args.truthTracking: diff --git a/CLDConfig/Tracking/ConformalTracking.py b/CLDConfig/Tracking/ConformalTracking.py index b712f7a..15fa8d6 100644 --- a/CLDConfig/Tracking/ConformalTracking.py +++ b/CLDConfig/Tracking/ConformalTracking.py @@ -16,8 +16,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from Gaudi.Configuration import WARNING +from Gaudi.Configuration import INFO, WARNING, DEBUG from Configurables import MarlinProcessorWrapper +from Configurables import ToolSvc, Lcio2EDM4hepTool, EDM4hep2LcioTool # geoservice comes from the `global_vars` of the SequenceLoader @@ -80,6 +81,12 @@ "TrackerHitCollectionNames": ["VXDTrackerHits", "VXDEndcapTrackerHits", "ITrackerHits", "OTrackerHits", "ITrackerEndcapHits", "OTrackerEndcapHits"], "trackPurity": ["0.7"] } +# EDM4hep to LCIO converter (only needed for the Detailed Digitization which produces EDM4hep output) +if reco_args.detailedDigitization: + edmConvTool = EDM4hep2LcioTool("EDM4hep2Lcio") + edmConvTool.convertAll = True + edmConvTool.OutputLevel = WARNING + MyConformalTracking.EDM4hep2LcioTool = edmConvTool ClonesAndSplitTracksFinder = MarlinProcessorWrapper("ClonesAndSplitTracksFinder") ClonesAndSplitTracksFinder.OutputLevel = WARNING diff --git a/CLDConfig/Tracking/TrackingDigiDetailed.py b/CLDConfig/Tracking/TrackingDigiDetailed.py new file mode 100644 index 0000000..7c3e097 --- /dev/null +++ b/CLDConfig/Tracking/TrackingDigiDetailed.py @@ -0,0 +1,119 @@ +# +# Copyright (c) 2014-2024 Key4hep-Project. +# +# This file is part of Key4hep. +# See https://key4hep.github.io/key4hep-doc/ for further info. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from Gaudi.Configuration import WARNING, DEBUG, INFO +from Configurables import VTXdigitizerDetailed + +VTXBarrelDigitizer = VTXdigitizerDetailed("VTXBarrelDigitizer", + inputSimHits = "VertexBarrelCollection", + outputDigiHits = "VXDTrackerHits", + outputSimDigiAssociation = "VXDTrackerHitRelations", + detectorName = "VertexBarrel", + PixSizePhi = [0.020, 0.020, 0.020, 0.020, 0.020, 0.020], # in mm + PixSizeTheta = [0.020, 0.020, 0.020, 0.020, 0.020, 0.020], # in mm + tResolution = [0.,0.,0.,0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_VTXBarrelDigitizer.root" + ) + +VTXEndcapDigitizer = VTXdigitizerDetailed("VTXEndcapDigitizer", + inputSimHits = "VertexEndcapCollection", + outputDigiHits = "VXDEndcapTrackerHits", + outputSimDigiAssociation = "VXDEndcapTrackerHitRelations", + detectorName = "VertexEndcap", + PixSizePhi = [0.020, 0.020, 0.020, 0.020, 0.020, 0.020], # in mm + PixSizeTheta = [0.020, 0.020, 0.020, 0.020, 0.020, 0.020], # in mm + tResolution = [0.,0.,0.,0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_VTXEndcapDigitizer.root" + ) + +InnerTrackerBarrelDigitizer = VTXdigitizerDetailed("InnerTrackerBarrelDigitizer", + inputSimHits = "InnerTrackerBarrelCollection", + outputDigiHits = "ITrackerHits", + outputSimDigiAssociation = "InnerTrackerBarrelHitsRelations", + detectorName = "InnerTrackerBarrel", + PixSizePhi = [0.050, 0.050, 0.050], # in mm + PixSizeTheta = [0.300, 0.300, 0.300], # in mm + tResolution = [0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_InnerTrackerBarrelDigitizer.root" + ) + +InnerTrackerEndcapDigitizer = VTXdigitizerDetailed("InnerTrackerEndcapDigitizer", + inputSimHits = "InnerTrackerEndcapCollection", + outputDigiHits = "ITrackerEndcapHits", + outputSimDigiAssociation = "InnerTrackerEndcapHitsRelations", + detectorName = "InnerTrackerEndcap", + PixSizePhi = [0.020, 0.050, 0.050, 0.050, 0.050, 0.050,0.050], # in mm + PixSizeTheta = [0.020, 0.300, 0.300, 0.300, 0.300, 0.300, 0.300], # in mm + tResolution = [0.,0.,0.,0.,0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_InnerTrackerEndcapDigitizer.root" + ) + +OuterTrackerBarrelDigitizer = VTXdigitizerDetailed("OuterTrackerBarrelDigitizer", + inputSimHits = "OuterTrackerBarrelCollection", + outputDigiHits = "OTrackerHits", + outputSimDigiAssociation = "OuterTrackerBarrelHitsRelations", + detectorName = "OuterTrackerBarrel", + PixSizePhi = [0.050, 0.050, 0.050], # in mm + PixSizeTheta = [0.300, 0.300, 0.300], # in mm + tResolution = [0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_OuterTrackerBarrelDigitizer.root" + ) + +OuterTrackerEndcapDigitizer = VTXdigitizerDetailed("OuterTrackerEndcapDigitizer", + inputSimHits = "OuterTrackerEndcapCollection", + outputDigiHits = "OTrackerEndcapHits", + outputSimDigiAssociation = "OuterTrackerEndcapHitsRelations", + detectorName = "OuterTrackerEndcap", + PixSizePhi = [0.050, 0.050, 0.050, 0.050], # in mm + PixSizeTheta = [0.300, 0.300, 0.300, 0.300], # in mm + tResolution = [0.,0.,0.,0.], + Threshold = 100.0, + ThresholdSmearing = 20.0, + OutputLevel = WARNING, + DebugHistos = False, + DebugFileName = "Debug_OuterTrackerEndcapDigitizer.root" + ) + +TrackingDigiDetailedSequence = [ + VTXBarrelDigitizer, + VTXEndcapDigitizer, + InnerTrackerBarrelDigitizer, + InnerTrackerEndcapDigitizer, + OuterTrackerBarrelDigitizer, + OuterTrackerEndcapDigitizer +]