From 888c685fe853f4cd6aaf647d4e15780c1fbad533 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 17 Apr 2025 09:05:43 +0200 Subject: [PATCH 01/34] base setup cmssw 15X and pixel issue --- SimGeneral/MixingModule/python/aliases_cfi.py | 4 ++-- SimGeneral/MixingModule/python/digitizers_cfi.py | 2 +- SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SimGeneral/MixingModule/python/aliases_cfi.py b/SimGeneral/MixingModule/python/aliases_cfi.py index 9ef571596b797..39f8debdd0541 100644 --- a/SimGeneral/MixingModule/python/aliases_cfi.py +++ b/SimGeneral/MixingModule/python/aliases_cfi.py @@ -117,5 +117,5 @@ from Configuration.Eras.Modifier_fastSim_cff import fastSim (fastSim & ~run3_common).toModify(simCastorDigis, mix = None) fastSim.toModify(simSiPixelDigis, mix = None) -fastSim.toModify(simSiStripDigis, mix = None) -fastSim.toModify(simAPVsaturation, mix = None) +(fastSim & ~phase2_tracker).toModify(simSiStripDigis, mix = None) +(fastSim & ~phase2_tracker).toModify(simAPVsaturation, mix = None) diff --git a/SimGeneral/MixingModule/python/digitizers_cfi.py b/SimGeneral/MixingModule/python/digitizers_cfi.py index b330344559c43..a8010a06879cc 100644 --- a/SimGeneral/MixingModule/python/digitizers_cfi.py +++ b/SimGeneral/MixingModule/python/digitizers_cfi.py @@ -111,7 +111,7 @@ ) from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify(theDigitizers, +(phase2_tracker& ~fastSim).toModify(theDigitizers, strip = None) theDigitizersValid = cms.PSet(theDigitizers) diff --git a/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py b/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py index de2df4181ed18..a8967462c2fef 100644 --- a/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py +++ b/SimGeneral/MixingModule/python/trackingTruthProducer_cfi.py @@ -70,4 +70,4 @@ trackingParticles.simHitCollections.muon)))) from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify( trackingParticles, simHitCollections = dict( tracker = []) ) +(phase2_tracker & ~fastSim).toModify( trackingParticles, simHitCollections = dict( tracker = []) ) From 51f53215cb9da7d0bfcd1511dcb4cf6ecfb58d79 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 17 Apr 2025 09:35:08 +0200 Subject: [PATCH 02/34] adding new pixel histograms: barrel and fwd --- .../python/PixelPluginsPhase2_cfi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 81c23ff62073a..8a0a0b1deacdd 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -12,9 +12,9 @@ type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32( 40 ), ## templateId = cms.int32( 292 ), - RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos58360_292.root'), - BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos58360_292.root'), - EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos58360_292.root'), + RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), + BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), + EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), @@ -32,9 +32,9 @@ type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32( 41 ), ## templateId = cms.int32( 291 ), - RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), + BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), + EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), From 0d8af7412b77ff699c0073e3979d569c2a54d7b8 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 17 Apr 2025 11:01:43 +0200 Subject: [PATCH 03/34] added phase-2 layers in FastSim, turn off FastSim calorimetry --- .../python/TrackerMaterial_cfi.py | 296 ++++++++++++++++++ .../python/fastSimProducer_cff.py | 2 +- 2 files changed, 297 insertions(+), 1 deletion(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/python/TrackerMaterial_cfi.py b/FastSimulation/SimplifiedGeometryPropagator/python/TrackerMaterial_cfi.py index e2a1d4255a8ce..88b06a1dca847 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/python/TrackerMaterial_cfi.py +++ b/FastSimulation/SimplifiedGeometryPropagator/python/TrackerMaterial_cfi.py @@ -372,3 +372,299 @@ interactionModels = _trackerMaterialInteractionModels ),] + TrackerMaterialBlock.TrackerMaterial.EndcapLayers[4:] )) + +#new phase2 geometry +from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker +phase2_tracker.toModify(TrackerMaterialBlock, TrackerMaterial = dict( + #The tracker layers + BarrelLayers = cms.VPSet( + ########### Beam Pipe ########### + #PIPE + cms.PSet( + radius = cms.untracked.double(2.90), + limits = cms.untracked.vdouble(0.0, 28.3), + thickness = cms.untracked.vdouble(0.0024), + interactionModels = _trackerMaterialInteractionModels + ), + ########### The Pixel Barrel layers 1-3 ########### + #PIXB1 + cms.PSet( + #radius = cms.untracked.double(4.425), + limits = cms.untracked.vdouble(0.0, 28.391), + thickness = cms.untracked.vdouble(0.0217), + activeLayer = cms.untracked.string("BPix1"), + interactionModels = _trackerMaterialInteractionModels + ), + #PIXB2 + cms.PSet( + #radius = cms.untracked.double(7.312), + limits = cms.untracked.vdouble(0.0, 28.391), + thickness = cms.untracked.vdouble(0.0217), + activeLayer = cms.untracked.string("BPix2"), + interactionModels = _trackerMaterialInteractionModels + ), + #PIXB3 + cms.PSet( + #radius = cms.untracked.double(10.177), + limits = cms.untracked.vdouble(0.0, 28.391), + thickness = cms.untracked.vdouble(0.0217), + activeLayer = cms.untracked.string("BPix3"), + interactionModels = _trackerMaterialInteractionModels + ), + #PIXB4 + cms.PSet( + #radius = cms.untracked.double(16), + limits = cms.untracked.vdouble(0.0, 28.391), + thickness = cms.untracked.vdouble(0.0217), + activeLayer = cms.untracked.string("BPix4"), + interactionModels = _trackerMaterialInteractionModels + ), + + ########### Pixel Outside walls and cables (barrel) ########### + #PIXBOut5 + cms.PSet( + radius = cms.untracked.double(17.6), + limits = cms.untracked.vdouble(0.0, 27.5, 32.0, 65.0), + thickness = cms.untracked.vdouble(0.0135, 0.095, 0.050), + interactionModels = _trackerMaterialInteractionModels + ), + ########### # Tracker Outer barrel layers 1-6 ########### + #TOB1 + cms.PSet( + #radius = cms.untracked.double(60.937), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.021, 0.06, 0.03, 0.06, 0.03, 0.06), + activeLayer = cms.untracked.string("TOB1"), + interactionModels = _trackerMaterialInteractionModels + ), + #TOB2 + cms.PSet( + #radius = cms.untracked.double(69.322), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.021, 0.06, 0.03, 0.06, 0.03, 0.06), + activeLayer = cms.untracked.string("TOB2"), + interactionModels = _trackerMaterialInteractionModels + ), + #TOB3 + cms.PSet( + #radius = cms.untracked.double(78.081), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.0154, 0.044, 0.022, 0.044, 0.022, 0.044), + activeLayer = cms.untracked.string("TOB3"), + interactionModels = _trackerMaterialInteractionModels + ), + #TOB4 + cms.PSet( + #radius = cms.untracked.double(86.876), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.0154, 0.044, 0.022, 0.044, 0.022, 0.044), + activeLayer = cms.untracked.string("TOB4"), + interactionModels = _trackerMaterialInteractionModels + ), + #TOB5 + cms.PSet( + #radius = cms.untracked.double(96.569), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.0154, 0.044, 0.022, 0.044, 0.022, 0.044), + activeLayer = cms.untracked.string("TOB5"), + interactionModels = _trackerMaterialInteractionModels + ), + #TOB6 + cms.PSet( + #radius = cms.untracked.double(108.063), + limits = cms.untracked.vdouble(0.0, 18.0, 30.0, 36.0, 46.0, 55.0, 112.737), + thickness = cms.untracked.vdouble(0.0154, 0.044, 0.022, 0.044, 0.022, 0.044), + activeLayer = cms.untracked.string("TOB6"), + interactionModels = _trackerMaterialInteractionModels + ), + + ########### Tracker Outer Barrel Outside Cables and walls (barrel) ########### + #TBOut + cms.PSet( + radius = cms.untracked.double(120.0), + limits = cms.untracked.vdouble(0.0, 120.0, 299.9), + thickness = cms.untracked.vdouble(0.042, 0.1596), + interactionModels = _trackerMaterialInteractionModels + ), + ), + + EndcapLayers = cms.VPSet( + ########### Pixel Barrel Outside walls and cables (endcap) ########### + #PIXBOut4 + # cms.PSet( + # z = cms.untracked.double(28.7), + # limits = cms.untracked.vdouble(4.2, 5.1, 7.1, 8.2, 10.0, 11.0, 11.9, 16.5), + # thickness = cms.untracked.vdouble(0.100, 0.00, 0.108, 0.00, 0.112, 0.02, 0.04), + # interactionModels = _trackerMaterialInteractionModels + # ), + #PIXBOut + #cms.PSet( + # z = cms.untracked.double(28.8), + # limits = cms.untracked.vdouble(3.8, 16.5), + # thickness = cms.untracked.vdouble(0.012), + # interactionModels = _trackerMaterialInteractionModels + #), + ########### Forward Pixel layers 1-12 ########### + #FPix1 + cms.PSet( + limits = cms.untracked.vdouble(4.825, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix1"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix2 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix2"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix3 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix3"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix4 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix4"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix5 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix5"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix6 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix6"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix7 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix7"), + interactionModels = _trackerMaterialInteractionModels + ), + #TEDD/TID Layer1 + cms.PSet( + limits = cms.untracked.vdouble(21.87, 24.0, 34.0, 39.0, 109.5), + thickness = cms.untracked.vdouble(0.100, 0.040, 0.080, 0.050), + activeLayer = cms.untracked.string("TID1"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix8 + cms.PSet( + limits = cms.untracked.vdouble(4.823, 16.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix8"), + interactionModels = _trackerMaterialInteractionModels + ), + #TEDD2/TID2 + cms.PSet( + limits = cms.untracked.vdouble(21.87, 24.0, 34.0, 39.0, 109.5), + thickness = cms.untracked.vdouble(0.100, 0.040, 0.080, 0.050), + activeLayer = cms.untracked.string("TID2"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix9 + cms.PSet( + limits = cms.untracked.vdouble(6.03, 25.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix9"), + interactionModels = _trackerMaterialInteractionModels + ), + #TEDD3/TID3 + cms.PSet( + limits = cms.untracked.vdouble(33.18, 37.0, 44.0, 49.0, 109.5), + thickness = cms.untracked.vdouble(0.100, 0.040, 0.080, 0.050), + activeLayer = cms.untracked.string("TID3"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix10 + cms.PSet( + limits = cms.untracked.vdouble(6.03, 25.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix10"), + interactionModels = _trackerMaterialInteractionModels + ), + #TEDD4/TID4 + cms.PSet( + limits = cms.untracked.vdouble(33.18, 37.0, 40.0, 41.0, 46.0, 109.5), + thickness = cms.untracked.vdouble(0.125, 0.030, 0.050, 0.070, 0.050), + activeLayer = cms.untracked.string("TID4"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix11 + cms.PSet( + limits = cms.untracked.vdouble(6.03, 25.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix11"), + interactionModels = _trackerMaterialInteractionModels + ), + #FPix12 + cms.PSet( + #z = cms.untracked.double(265.99), + limits = cms.untracked.vdouble(6.03, 25.598), + thickness = cms.untracked.vdouble(0.058), + activeLayer = cms.untracked.string("FPix12"), + interactionModels = _trackerMaterialInteractionModels + ), + # TEDD5/TID5 + cms.PSet( + limits = cms.untracked.vdouble(33.18, 37.0, 40.0, 41.0, 46.0, 109.5), + thickness = cms.untracked.vdouble(0.125, 0.030, 0.050, 0.070, 0.050), + activeLayer = cms.untracked.string("TID5"), + interactionModels = _trackerMaterialInteractionModels + ), + ########### Pixel Endcap outside cables ########### + #PIXBOut6 + #cms.PSet( + # z = cms.untracked.double(65.1), + # limits = cms.untracked.vdouble(6.5, 10.0, 11.0, 16.0, 17.61), + # thickness = cms.untracked.vdouble(0.150, 0.325, 0.250, 0.175), + # interactionModels = _trackerMaterialInteractionModels + # ), + ########### Tracker Inner Barrel Outside Cables and walls (endcap) ########### + #TIBEOut + # cms.PSet( + # z = cms.untracked.double(74.0), + # limits = cms.untracked.vdouble(22.5, 53.9), + # thickness = cms.untracked.vdouble(0.130), + # interactionModels = _trackerMaterialInteractionModels + #), + ########### Tracker Inner Disks Outside Cables and walls (endcap) ########### + #TIDEOut + # cms.PSet( + # z = cms.untracked.double(108.0), + # limits = cms.untracked.vdouble(22.0, 24.0, 47.5, 54.943), + # thickness = cms.untracked.vdouble(0.111, 0.074, 0.185), + # interactionModels = _trackerMaterialInteractionModels + # ), + ########### Tracker Outer Barrel Outside Cables and walls (barrel and endcap) ########### + #TOBEOut + #cms.PSet( + # z = cms.untracked.double(115.0), + # limits = cms.untracked.vdouble(55.0, 60.0, 62.0, 78.0, 92.0, 111.0), + # thickness = cms.untracked.vdouble(0.005, 0.009, 0.014, 0.016, 0.009), + # interactionModels = _trackerMaterialInteractionModels + # ), + ########### Tracker Endcaps Outside Cables and walls (endcaps) ########### + #TEOut + cms.PSet( + z = cms.untracked.double(303.0), + limits = cms.untracked.vdouble(4.42, 4.65, 4.84, 7.37, 10.99, 14.70, 16.24, 22.00, 28.50, 31.50, 36.0, 120.0), + thickness = cms.untracked.vdouble(3.935, 0.483, 0.127, 0.089, 0.069, 0.124, 1.47, 0.924, 0.693, 0.294, 0.336), + interactionModels = _trackerMaterialInteractionModels + ), + ), + ) +) diff --git a/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py b/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py index 7439a20dc7e34..552da9d379d2a 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py +++ b/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py @@ -11,7 +11,7 @@ src = cms.InputTag("generatorSmeared"), particleFilter = ParticleFilterBlock.ParticleFilter, trackerDefinition = TrackerMaterialBlock.TrackerMaterial, - simulateCalorimetry = cms.bool(True), + simulateCalorimetry = cms.bool(False), simulateMuons = cms.bool(True), useFastSimDecayer = cms.bool(False), verboseDecayer = cms.bool(False), From 5bbe4c49fb19e174fe6a98efb3de57d8acc5adb5 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 17 Apr 2025 11:26:57 +0200 Subject: [PATCH 04/34] modified eos path of resolution histograms --- .../python/PixelPluginsPhase2_cfi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 8a0a0b1deacdd..83896839f7219 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -12,9 +12,9 @@ type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32( 40 ), ## templateId = cms.int32( 292 ), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), - BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), - EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel.root'), + RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), + BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), + EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), @@ -32,9 +32,9 @@ type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32( 41 ), ## templateId = cms.int32( 291 ), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), - BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), - EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_forward.root'), + RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), From 3d4297436a8fc4fbb779d426069399ba32397c78 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 17 Apr 2025 14:15:39 +0200 Subject: [PATCH 05/34] modification to import Run4D110 geometry --- .../Configuration/python/Geometries_cff.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/FastSimulation/Configuration/python/Geometries_cff.py b/FastSimulation/Configuration/python/Geometries_cff.py index 795e299cfbc6c..58f9d2cdbaba9 100644 --- a/FastSimulation/Configuration/python/Geometries_cff.py +++ b/FastSimulation/Configuration/python/Geometries_cff.py @@ -6,14 +6,15 @@ # To use the "full" CMS geometry, comment the prevous line, and uncomment the following one: #####from Configuration.StandardSequences.Geometry_cff import * -from Configuration.StandardSequences.GeometryDB_cff import * - +#from Configuration.StandardSequences.GeometryDB_cff import * +from Configuration.Geometry.GeometryExtendedRun4D110_cff import * +from Configuration.Geometry.GeometryExtendedRun4D110Reco_cff import * # The tracker geometry left-over (for aligned/misaligned geometry) # The goemetry used for reconstruction must not be misaligned. -trackerGeometryDB.applyAlignment = False +trackerGeometry.applyAlignment = False # Create a misaligned geometry for simulation -misalignedTrackerGeometry = Geometry.TrackerGeometryBuilder.trackerGeometryDB_cfi.trackerGeometryDB.clone() +misalignedTrackerGeometry = Geometry.TrackerGeometryBuilder.trackerGeometry_cfi.trackerGeometry.clone() # The misalignment is not applied by default misalignedTrackerGeometry.applyAlignment = False # Label of the produced TrackerGeometry: @@ -23,7 +24,7 @@ # The geometry used for reconstruction must not be misaligned. DTGeometryESModule.applyAlignment = False # Create a misaligned geometry for simulation -misalignedDTGeometry = Geometry.DTGeometryBuilder.dtGeometryDB_cfi.DTGeometryESModule.clone() +misalignedDTGeometry = Geometry.DTGeometryBuilder.dtGeometry_cfi.DTGeometryESModule.clone() # The misalignment is not applied by default misalignedDTGeometry.applyAlignment = False # Label of the produced DTGeometry: @@ -33,7 +34,7 @@ # The geometry used for reconstruction must not be misaligned. CSCGeometryESModule.applyAlignment = False # Create a misaligned geometry for simulation -misalignedCSCGeometry = Geometry.CSCGeometryBuilder.cscGeometryDB_cfi.CSCGeometryESModule.clone() +misalignedCSCGeometry = Geometry.CSCGeometryBuilder.cscGeometry_cfi.CSCGeometryESModule.clone() # The misalignment is not applied by default misalignedCSCGeometry.applyAlignment = False # Label of the produced CSCGeometry: From f8f6e5dd65dc00d318bfb203cf72969aec075970 Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 15 May 2025 14:56:03 +0200 Subject: [PATCH 06/34] changes upto segfault error, debugging pixel hist failure --- .../src/Geometry.cc | 3 +- .../python/PixelPluginsPhase2_cfi.py | 30 ++++++++++++------- .../src/PixelResolutionHistograms.cc | 8 ++--- .../src/PixelTemplateSmearerBase.cc | 6 ++-- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc index fba74d0afde17..820e33a5e13e9 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc @@ -133,9 +133,10 @@ Geometry::Geometry(const edm::ParameterSet& cfg, for (unsigned index = 0; index < forwardLayers_.size(); index++) { // set index forwardLayers_[index]->setIndex(index); + std::cout<<"FWD Layer "<getZ()< 0) { - if (forwardLayers_[index]->getZ() <= forwardLayers_[index - 1]->getZ()) { + if (forwardLayers_[index]->getZ() < forwardLayers_[index - 1]->getZ()) { throw cms::Exception("fastsim::Geometry") << "forward layers must be ordered according to increasing z" << "forward layer " << index << " has z smaller than or equal to z of forward layer " << index - 1; diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 83896839f7219..d31cf19cc98be 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -10,13 +10,20 @@ isBarrel = cms.bool(True), name = cms.string("pixelBarrelSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - templateId = cms.int32( 40 ), + #templateId = cms.int32( 40 ), #commented off for no reason, but no seg fault now ## templateId = cms.int32( 292 ), - RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), - ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), + #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), + #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), + #EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), + RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), + #BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), + #EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), + + #phase1 + #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos39921_5611_6.root'), + BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelBig2017.root'), + EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), + MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bmergeprob.root'), MergedPixelResolutionXFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bxsmear.root'), @@ -30,11 +37,14 @@ isBarrel = cms.bool(False), name = cms.string("pixelForwardSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - templateId = cms.int32( 41 ), + #templateId = cms.int32( 41 ), #commented off for no reason, but no seg fault now ## templateId = cms.int32( 291 ), - RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + #EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), diff --git a/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc index 6560de3d19384..5f1bfbc607e18 100644 --- a/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc +++ b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc @@ -117,7 +117,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, // // Store detType in the underflow bin binningHisto_->SetBinContent(0, 0, detType_); - + // All other histograms: Char_t histo[200]; Char_t title[200]; @@ -127,7 +127,6 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, // for (int ii = 0; ii < cotbetaBins_; ii++) { for (int jj = 0; jj < cotalphaBins_; jj++) { for (int kk = 0; kk < qbins_; kk++) { - // sprintf(histo, "hx%d1%02d%d%d", detType_, ii + 1, jj + 1, kk + 1); //information of bits of histogram names //--- First bit 1/0 barrel/forward, second 1/0 multi/single, cotbeta, cotalpha, qbins sprintf(title, @@ -241,7 +240,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, LOGERROR << "PixelResolutionHistograms:: Error, file " << filename << " not found."; return; // PixelTemplateSmearerBase will throw an exception upon our return. } - + //--- The dummy 2D histogram with the binning of cot\beta and cot\alpha: binningHisto_ = (TH2F*)file_->Get(Form("%s%s", rootdir.c_str(), "ResHistoBinning")); if (!binningHisto_) { @@ -249,14 +248,12 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, LOGERROR << "PixelResolutionHistograms:: Error, binning histogrram ResHistoBinning not found."; return; // PixelTemplateSmearerBase will throw an exception upon our return. } - if (detType == -1) { //--- Fish out detType from the underflow bin: detType_ = binningHisto_->GetBinContent(0, 0); } else { detType_ = detType; // constructor's argument overrides what's in ResHistoBinning histogram. } - //--- Now we fill the binning variables: cotbetaAxis_ = binningHisto_->GetXaxis(); cotbetaBinWidth_ = binningHisto_->GetXaxis()->GetBinWidth(1); // assume all same width @@ -289,6 +286,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, if (!tmphist) { status_ = 2; LOGERROR << "Failed to find histogram=" << std::string(histo); + LOGERROR << "Failed to find histogram: det type =" << detType_; return; } LOGDEBUG << "Found histo " << std::string(histo) << " with title = " << std::string(tmphist->GetTitle()) diff --git a/FastSimulation/TrackingRecHitProducer/src/PixelTemplateSmearerBase.cc b/FastSimulation/TrackingRecHitProducer/src/PixelTemplateSmearerBase.cc index 28915721c1e58..8e87bafd46755 100644 --- a/FastSimulation/TrackingRecHitProducer/src/PixelTemplateSmearerBase.cc +++ b/FastSimulation/TrackingRecHitProducer/src/PixelTemplateSmearerBase.cc @@ -69,7 +69,7 @@ PixelTemplateSmearerBase::PixelTemplateSmearerBase(const std::string& name, theRegularPixelResolutions = std::make_shared(theRegularPixelResolutionFileName, ""); if ((status = theRegularPixelResolutions->status()) != 0) { throw cms::Exception("PixelTemplateSmearerBase:") - << " constructing PixelResolutionHistograms file " << theRegularPixelResolutionFileName + << " constructing Regular PixelResolutionHistograms file " << theRegularPixelResolutionFileName << " failed with status = " << status << std::endl; } @@ -77,7 +77,7 @@ PixelTemplateSmearerBase::PixelTemplateSmearerBase(const std::string& name, theBigPixelResolutionFileName, "", detType, (!isBarrel), false, true); // can miss qBin if ((status = theBigPixelResolutions->status()) != 0) { throw cms::Exception("PixelTemplateSmearerBase:") - << " constructing PixelResolutionHistograms file " << theBigPixelResolutionFileName + << " constructing Big PixelResolutionHistograms file " << theBigPixelResolutionFileName << " failed with status = " << status << std::endl; } @@ -85,7 +85,7 @@ PixelTemplateSmearerBase::PixelTemplateSmearerBase(const std::string& name, theEdgePixelResolutionFileName, "", detType, false, true, true); // can miss both single & qBin if ((status = theEdgePixelResolutions->status()) != 0) { throw cms::Exception("PixelTemplateSmearerBase:") - << " constructing PixelResolutionHistograms file " << theEdgePixelResolutionFileName + << " constructing Edge PixelResolutionHistograms file " << theEdgePixelResolutionFileName << " failed with status = " << status << std::endl; } From a91f6f7002d89b51f71bddea3c723bc9fd5d689e Mon Sep 17 00:00:00 2001 From: Arnab Laha Date: Thu, 15 May 2025 18:00:26 +0200 Subject: [PATCH 07/34] reproduce error steps, modified resolution file --- .../python/PixelPluginsPhase2_cfi.py | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index d31cf19cc98be..30c37a5c51233 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -10,19 +10,20 @@ isBarrel = cms.bool(True), name = cms.string("pixelBarrelSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - #templateId = cms.int32( 40 ), #commented off for no reason, but no seg fault now + templateId = cms.int32( 40 ), ## templateId = cms.int32( 292 ), #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), #EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), - #BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), - #EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v1.root'), + + RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), + BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), + EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), #phase1 #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos39921_5611_6.root'), - BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelBig2017.root'), - EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), + #BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelBig2017.root'), + #EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bmergeprob.root'), @@ -37,14 +38,15 @@ isBarrel = cms.bool(False), name = cms.string("pixelForwardSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - #templateId = cms.int32( 41 ), #commented off for no reason, but no seg fault now + templateId = cms.int32( 41 ), ## templateId = cms.int32( 291 ), - #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - #EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + #old files + #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + #BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), + #EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), From c7404d19f8511014687843172abacb93bdfde6d2 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 30 Jun 2025 13:44:55 -0500 Subject: [PATCH 08/34] copy stack overflow fix to text input case --- CondFormats/SiPixelTransient/src/SiPixelTemplate.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc b/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc index 8c681c08db0f7..a5f22beebd279 100644 --- a/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc +++ b/CondFormats/SiPixelTransient/src/SiPixelTemplate.cc @@ -166,7 +166,10 @@ bool SiPixelTemplate::pushfile(int filenum, std::vector& p if (in_file.is_open() && in_file.good()) { // Create a local template storage entry - SiPixelTemplateStore theCurrentTemp; + // Create a local template storage entry + /// SiPixelTemplateStore theCurrentTemp; // large, don't allocate it on the stack + auto tmpPtr = std::make_unique(); // must be allocated on the heap instead + auto& theCurrentTemp = *tmpPtr; // Read-in a header string first and print it From 245feb0236133fcba920540381687d0242da61f3 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 30 Jun 2025 15:04:37 -0500 Subject: [PATCH 09/34] update forward histogram to follow naming convention --- .../python/PixelPluginsPhase2_cfi.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 30c37a5c51233..5351e8790562a 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -40,9 +40,12 @@ type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32( 41 ), ## templateId = cms.int32( 291 ), - RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), - EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), +# RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), +# BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), +# EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), + RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), + BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), + EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), #old files #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), #BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), From 03db1a83224294c42175a748ca24cdef5785aa88 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 30 Jun 2025 15:04:47 -0500 Subject: [PATCH 10/34] get pixel templates from db instead of (non-existent) text files --- .../TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 5351e8790562a..5c812f4867c86 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -10,7 +10,7 @@ isBarrel = cms.bool(True), name = cms.string("pixelBarrelSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - templateId = cms.int32( 40 ), + templateId = cms.int32(-1), ## templateId = cms.int32( 292 ), #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), @@ -38,7 +38,7 @@ isBarrel = cms.bool(False), name = cms.string("pixelForwardSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), - templateId = cms.int32( 41 ), + templateId = cms.int32(-1), ## templateId = cms.int32( 291 ), # RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), # BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), From 6cbfcce57bd05b598eea9f4113fb38454addbad3 Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 24 Jul 2025 09:57:24 +0200 Subject: [PATCH 11/34] Added some phase2 changes --- .../python/InitialStep_cff.py | 3 ++- .../python/LowPtTripletStep_cff.py | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index 7557ca44c240d..11a9eaa4f7b9a 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -119,7 +119,8 @@ ) ) #new for phase1 -trackingPhase1.toModify(_fastSim_initialStepSeeds, seedFinderSelector = dict( +#adding phase2 also +(trackingPhase1|trackingPhase2PU140).toModify(_fastSim_initialStepSeeds, seedFinderSelector = dict( pixelTripletGeneratorFactory = None, CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(initialStepHitQuadruplets).clone(SeedComparitorPSet = dict(ComponentName = 'none')), #new parameters required for phase1 seeding diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index 5c9db796bd503..c24f0d667c183 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -160,6 +160,26 @@ ) fastSim.toReplaceWith(lowPtTripletStepSeeds,_fastSim_lowPtTripletStepSeeds) + +#new for phase2 +trackingPhase2PU140.toModify(_fastSim_lowPtTripletStepSeeds, seedFinderSelector = dict( + pixelTripletGeneratorFactory = None, + CAHitTripletGeneratorFactory = _hitSetProducerToFactoryPSet(lowPtTripletStepHitTriplets).clone(SeedComparitorPSet = dict(ComponentName = "none")), + #new parameters required for phase2 seeding + BPix = dict( + TTRHBuilder = 'WithoutRefit', + HitProducer = 'TrackingRecHitProducer', + ), + FPix = dict( + TTRHBuilder = 'WithoutRefit', + HitProducer = 'TrackingRecHitProducer', + ), + layerPairs = lowPtTripletStepHitDoublets.layerPairs.value() + ) +) +fastSim.toReplaceWith(lowPtTripletStepSeeds,_fastSim_lowPtTripletStepSeeds) + + # QUALITY CUTS DURING TRACK BUILDING import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff as _TrajectoryFilter_cff _lowPtTripletStepStandardTrajectoryFilterBase = _TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone( From 6bad530975b2df9885bff71c983a9416859ff983 Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 24 Jul 2025 10:13:32 +0200 Subject: [PATCH 12/34] added some fastsim changes for phase2 --- .../python/DetachedQuadStep_cff.py | 2 ++ .../python/HighPtTripletStep_cff.py | 4 +++- .../python/InitialStep_cff.py | 21 +++++++++++++++++-- .../python/LowPtQuadStep_cff.py | 3 ++- .../python/LowPtTripletStep_cff.py | 3 ++- .../python/PixelPairStep_cff.py | 4 +++- 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py index c3a8293228cc8..0fb95b48d629e 100644 --- a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py @@ -346,6 +346,7 @@ ] #end of vpset ) #end of clone +fastSim.toModify(detachedQuadStepSelector,vertices = "firstStepPrimaryVerticesBeforeMixing") from RecoTracker.FinalTrackSelectors.trackAlgoPriorityOrder_cfi import trackAlgoPriorityOrder import RecoTracker.FinalTrackSelectors.trackListMerger_cfi @@ -390,5 +391,6 @@ ,detachedQuadStepSeeds ,detachedQuadStepTrackCandidates ,detachedQuadStepTracks + ,detachedQuadStepSelector ,detachedQuadStep ) ) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index 3fc8609645d8e..c31fcb57f7aea 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -377,6 +377,8 @@ ] #end of vpset ) #end of clone +fastSim.toModify(highPtTripletStepSelector,vertices = "firstStepPrimaryVerticesBeforeMixing") + from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(highPtTripletStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3, d0_par1 = ( 0.5, 4.0 ), dz_par1 = ( 0.6, 4.0 )) @@ -476,5 +478,5 @@ ,highPtTripletStepSeeds ,highPtTripletStepTrackCandidates ,highPtTripletStepTracks - ,highPtTripletStep + ,highPtTripletStepSelector ) ) diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index 11a9eaa4f7b9a..de3253d2794ad 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -138,6 +138,23 @@ fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds) +#trackingPhase2PU140.toModify(_fastSim_initialStepSeeds, seedFinderSelector = dict( +# pixelTripletGeneratorFactory = None, +# CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(initialStepHitQuadruplets).clone(SeedComparitorPSet = dict(ComponentName = "none")), + #new parameters required for phase2 seeding +# BPix = dict( +# TTRHBuilder = 'WithoutRefit', +# HitProducer = 'TrackingRecHitProducer', +# ), +# FPix = dict( +# TTRHBuilder = 'WithoutRefit', +# HitProducer = 'TrackingRecHitProducer', +# ), +# layerPairs = initialStepHitDoublets.layerPairs.value() +# ) +#) + +#fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds) # building import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff @@ -430,7 +447,7 @@ ), #end of vpset ) #end of clone - +fastSim.toModify(initialStepSelector,vertices = "firstStepPrimaryVerticesBeforeMixing") # Final sequence InitialStepTask = cms.Task(initialStepSeedLayers, @@ -484,7 +501,7 @@ ,initialStepTracks ,firstStepPrimaryVerticesBeforeMixing ,initialStepClassifier1,initialStepClassifier2,initialStepClassifier3 - ,initialStep + ,initialStepSelector ) fastSim.toReplaceWith(InitialStepTask, _InitialStepTask_fastSim) diff --git a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py index 40a1161b15f13..d540b8f34c217 100644 --- a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py @@ -303,6 +303,7 @@ ] #end of vpset ) #end of clone +fastSim.toModify(lowPtQuadStepSelector,vertices = "firstStepPrimaryVerticesBeforeMixing") # Final sequence LowPtQuadStepTask = cms.Task(lowPtQuadStepClusters, @@ -333,5 +334,5 @@ ,lowPtQuadStepSeeds ,lowPtQuadStepTrackCandidates ,lowPtQuadStepTracks - ,lowPtQuadStep + ,lowPtQuadStepSelector ) ) diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index c24f0d667c183..d8d36ef02e3cd 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -420,6 +420,7 @@ ), #end of vpset ) #end of clone +fastSim.toModify(lowPtTripletStepSelector, vertices = "firstStepPrimaryVerticesBeforeMixing") from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(lowPtTripletStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3) @@ -455,5 +456,5 @@ ,lowPtTripletStepSeeds ,lowPtTripletStepTrackCandidates ,lowPtTripletStepTracks - ,lowPtTripletStep + ,lowPtTripletStepSelector )) diff --git a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py index a2ff9f228cba0..c80c7adcd41c9 100644 --- a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py @@ -458,6 +458,8 @@ vertices = 'firstStepPrimaryVertices' ) #end of clone +fastSim.toModify(pixelPairStepSelector, vertices = "firstStepPrimaryVerticesBeforeMixing") + from Configuration.ProcessModifiers.vectorHits_cff import vectorHits vectorHits.toModify(pixelPairStepSelector.trackSelectors[2], minNumberLayers = 3, minNumber3DLayers = 3) @@ -501,6 +503,6 @@ ,pixelPairStepSeeds ,pixelPairStepTrackCandidates ,pixelPairStepTracks - ,pixelPairStep + ,pixelPairStepSelector ) ) From 2bfd4e19ad77d740136114bc4a04adf93222b253 Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Fri, 1 Aug 2025 12:19:15 +0200 Subject: [PATCH 13/34] added phase2 tracking steps and changed simhits to input tags --- .../Tracking/python/iterativeTk_cff.py | 13 +++++++++++++ .../python/caloTruthProducer_cfi.py | 2 +- .../MixingModule/python/mixObjects_cfi.py | 18 ++++++++++-------- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/FastSimulation/Tracking/python/iterativeTk_cff.py b/FastSimulation/Tracking/python/iterativeTk_cff.py index 636190b608602..015c7fdfe20f4 100644 --- a/FastSimulation/Tracking/python/iterativeTk_cff.py +++ b/FastSimulation/Tracking/python/iterativeTk_cff.py @@ -55,4 +55,17 @@ +JetCoreRegionalStep +generalTracksBeforeMixing) + +_iterations_trackingPhase2PU140 = cms.Sequence( + InitialStep + +HighPtTripletStep + +LowPtQuadStep + +LowPtTripletStep + +LowPtTripletStep + +DetachedQuadStep + +PixelPairStep + +generalTracksBeforeMixing +) + trackingPhase1.toReplaceWith(iterTracking, _iterTracking_Phase1) +trackingPhase2PU140.toReplaceWith(iterTracking,_iterations_trackingPhase2PU140) diff --git a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py index 93573b7772832..82b95ea53a500 100644 --- a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py +++ b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py @@ -57,7 +57,7 @@ ) from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toReplaceWith(caloParticles, cms.PSet()) # don't allow this to run in fastsim +#fastSim.toReplaceWith(caloParticles, cms.PSet()) # don't allow this to run in fastsim from Configuration.ProcessModifiers.ticl_barrel_cff import ticl_barrel ticl_barrel.toModify( diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index 8644ee7a254fd..2810b9243ab27 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -61,14 +61,16 @@ # fastsim customs from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toModify(mixSimHits, - input = ["MuonSimHits:MuonCSCHits", - "MuonSimHits:MuonDTHits", - "MuonSimHits:MuonRPCHits", - "fastSimProducer:TrackerHits"], - subdets = ['MuonCSCHits', - 'MuonDTHits', - 'MuonRPCHits', - 'TrackerHits'] + input = cms.VInputTag( + cms.InputTag("MuonSimHits","MuonCSCHits"), + cms.InputTag("MuonSimHits","MuonDTHits"), + cms.InputTag("MuonSimHits","MuonRPCHits"), + cms.InputTag("fastSimProducer", "TrackerHits") + ), + subdets = cms.vstring('MuonCSCHits', + 'MuonDTHits', + 'MuonRPCHits', + 'TrackerHits') ) mixCaloHits = cms.PSet( From 236406c9bfd5a76c78bbac9c7ff333483cd2db5d Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 7 Aug 2025 14:41:55 +0200 Subject: [PATCH 14/34] add hgcal digis --- .../Configuration/python/DigiAliases_cff.py | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/FastSimulation/Configuration/python/DigiAliases_cff.py b/FastSimulation/Configuration/python/DigiAliases_cff.py index b520af65a4f23..e9c8dd41a6361 100644 --- a/FastSimulation/Configuration/python/DigiAliases_cff.py +++ b/FastSimulation/Configuration/python/DigiAliases_cff.py @@ -77,7 +77,7 @@ def loadDigiAliases(process, premix=False): ) } ) - + process.hcalDigis = cms.EDAlias( **{"simHcalDigis" if nopremix else "DMHcalDigis" : cms.VPSet( @@ -98,6 +98,28 @@ def loadDigiAliases(process, premix=False): } ) + + process.hgcalDigis = cms.EDAlias( + mix = cms.VPSet( + cms.PSet( + fromProductInstance = cms.string('HGCDigisEE'), + toProductInstance = cms.string('EE'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ), + cms.PSet( + fromProductInstance = cms.string('HGCDigisHEfront'), + toProductInstance = cms.string('HEfront'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ), + cms.PSet( + fromProductInstance = cms.string('HGCDigisHEback'), + toProductInstance = cms.string('HEback'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ) + ) + ) + + process.muonDTDigis = cms.EDAlias( simMuonDTDigis = cms.VPSet( cms.PSet( From 2f9e9a8bf4aaa7e161a25536ca6058336dce153b Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Mon, 25 Aug 2025 11:14:53 +0200 Subject: [PATCH 15/34] Adding Gaussian smearing for additional inner detector layers in phase2 (revisit resolutions) --- .../python/TrackingRecHitProducer_cfi.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py index 05e5c9363facb..810b0b7af3b04 100644 --- a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py @@ -37,7 +37,9 @@ "TID": { 1: cms.double(0.00262), 2: cms.double(0.00354), - 3: cms.double(0.00391) + 3: cms.double(0.00391), + 4: cms.double(0.00391), + 5: cms.double(0.00391) }, "TOB": { 1: cms.double(0.00461), From 0e8560a37c8b0f010a37a66440275269d3d6869c Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 2 Oct 2025 14:34:56 +0200 Subject: [PATCH 16/34] introduce utility for creating FastSim Phase2 eras (remove run3_GEM etc.), other fixes --- .../python/Era_Phase2C17I13M9_FastSim_cff.py | 6 +++++ .../Eras/python/Util_fastSimPhase2_cff.py | 9 +++++++ .../StandardSequences/python/Eras.py | 1 + .../python/caloTruthProducer_cfi.py | 3 +-- .../MixingModule/python/digitizers_cfi.py | 5 ++++ .../MixingModule/python/mixObjects_cfi.py | 24 +++++++++++++++++-- 6 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 Configuration/Eras/python/Era_Phase2C17I13M9_FastSim_cff.py create mode 100644 Configuration/Eras/python/Util_fastSimPhase2_cff.py diff --git a/Configuration/Eras/python/Era_Phase2C17I13M9_FastSim_cff.py b/Configuration/Eras/python/Era_Phase2C17I13M9_FastSim_cff.py new file mode 100644 index 0000000000000..514b1c1f384ca --- /dev/null +++ b/Configuration/Eras/python/Era_Phase2C17I13M9_FastSim_cff.py @@ -0,0 +1,6 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Phase2C17I13M9_cff import Phase2C17I13M9 +from Configuration.Eras.Util_fastSimPhase2_cff import fastSimPhase2 + +Phase2C17I13M9_FastSim = fastSimPhase2(Phase2C17I13M9) diff --git a/Configuration/Eras/python/Util_fastSimPhase2_cff.py b/Configuration/Eras/python/Util_fastSimPhase2_cff.py new file mode 100644 index 0000000000000..1a984a2ec3e5e --- /dev/null +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -0,0 +1,9 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing +from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer +from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger + +def fastSimPhase2(obj): + return obj.copyAndExclude([run3_GEM, phase2_timing, phase2_timing_layer, phase2_trigger]) diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index fecb31d054dbc..209fce8facbba 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -96,6 +96,7 @@ def __init__(self): 'Phase2C11I13T26M9_noMkFit', 'Phase2C17I13M9', 'Phase2C17I13M9_noMkFit', + 'Phase2C17I13M9_FastSim', 'Phase2C20I13M9', 'Phase2C20I13M9_noMkFit', 'Phase2C22I13M9', diff --git a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py index 82b95ea53a500..9a7a3a6612013 100644 --- a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py +++ b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py @@ -57,7 +57,7 @@ ) from Configuration.Eras.Modifier_fastSim_cff import fastSim -#fastSim.toReplaceWith(caloParticles, cms.PSet()) # don't allow this to run in fastsim +fastSim.toReplaceWith(caloParticles, cms.PSet()) # don't allow this to run in fastsim from Configuration.ProcessModifiers.ticl_barrel_cff import ticl_barrel ticl_barrel.toModify( @@ -75,4 +75,3 @@ ) ) - diff --git a/SimGeneral/MixingModule/python/digitizers_cfi.py b/SimGeneral/MixingModule/python/digitizers_cfi.py index a8010a06879cc..16a874a2a692d 100644 --- a/SimGeneral/MixingModule/python/digitizers_cfi.py +++ b/SimGeneral/MixingModule/python/digitizers_cfi.py @@ -110,6 +110,8 @@ MC_fastTimingLayer = dict(premixStage1 = True), ) +#(fastSim & phase2_hgcal).toModify(theDigitizersValid, calotruth = None) + from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker (phase2_tracker& ~fastSim).toModify(theDigitizers, strip = None) @@ -117,6 +119,9 @@ theDigitizersValid = cms.PSet(theDigitizers) theDigitizers.mergedtruth.select.signalOnlyTP = True +(fastSim & phase2_hgcal).toModify(theDigitizersValid, calotruth = None) +#No calo clustering for fastsim phase2 + from Configuration.ProcessModifiers.run3_ecalclustering_cff import run3_ecalclustering run3_ecalclustering.toModify( theDigitizersValid, calotruth = cms.PSet( caloParticles ) ) diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index 2810b9243ab27..29881a3a4c691 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -125,7 +125,6 @@ # fastsim customs fastSim.toModify(mixSimTracks, input = ["fastSimProducer"]) fastSim.toModify(mixSimVertices, input = ["fastSimProducer"]) - mixHepMCProducts = cms.PSet( makeCrossingFrame = cms.untracked.bool(True), input = cms.VInputTag(cms.InputTag("generatorSmeared"),cms.InputTag("generator")), @@ -259,6 +258,8 @@ crossingFrames = theMixObjects.mixSH.crossingFrames + [ 'MuonME0Hits' ] ) ) + + (premix_stage1 & phase2_muon).toModify(theMixObjects, mixSH = dict( pcrossingFrames = theMixObjects.mixSH.pcrossingFrames + [ 'MuonME0Hits' ] @@ -268,7 +269,7 @@ from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 phase2_GE0.toModify( theMixObjects, mixSH = dict( - input = list(filter(lambda x: type(x) == type(cms.InputTag("","")) and x != cms.InputTag("g4SimHits","MuonME0Hits"), theMixObjects.mixSH.input)), + input = list(filter(lambda x: type(x) == type(cms.InputTag("","")) and x != cms.InputTag("g4SimHits","MuonME0Hits") and x != cms.InputTag("g4SimHits","MuonGEMHits"), theMixObjects.mixSH.input)), subdets = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.subdets)), crossingFrames = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.crossingFrames)) ) @@ -279,7 +280,26 @@ ) ) +(fastSim & phase2_GE0).toModify(theMixObjects, + mixSH = dict( + input = cms.VInputTag(cms.InputTag("MuonSimHits","MuonCSCHits"), cms.InputTag("MuonSimHits","MuonDTHits"), cms.InputTag("MuonSimHits","MuonRPCHits"), cms.InputTag("fastSimProducer","TrackerHits"), cms.InputTag("MuonSimHits","MuonGEMHits")), + subdets = cms.vstring( + 'MuonCSCHits', + 'MuonDTHits', + 'MuonRPCHits', + 'TrackerHits', + 'MuonGEMHits'), + crossingframes = cms.untracked.vstring( + 'MuonCSCHits', + 'MuonDTHits', + 'MuonRPCHits', + 'MuonGEMHits') + ) + +) + from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal + phase2_hgcal.toModify( theMixObjects, mixCH = dict( input = theMixObjects.mixCH.input + [ cms.InputTag("g4SimHits",hgceeDigitizer.hitCollection.value()), From d3a01e4c66a7cd025625f2ed5049800f20d9b96d Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 16 Oct 2025 18:40:32 +0200 Subject: [PATCH 17/34] Added correct seed and track producers for phase 2 - fastsim --- .../Eras/python/Util_fastSimPhase2_cff.py | 6 ++++- .../python/Reconstruction_cff.py | 10 +++++-- .../MixingModule/python/mixObjects_cfi.py | 18 ------------- ...ckingParticleNumberOfLayersProducer_cff.py | 7 +++-- .../RPCDigitizer/python/muonRPCDigis_cfi.py | 4 ++- .../RecoTrack/python/TrackValidation_cff.py | 27 +++++++++++++++++++ 6 files changed, 48 insertions(+), 24 deletions(-) diff --git a/Configuration/Eras/python/Util_fastSimPhase2_cff.py b/Configuration/Eras/python/Util_fastSimPhase2_cff.py index 1a984a2ec3e5e..f2765244bcf86 100644 --- a/Configuration/Eras/python/Util_fastSimPhase2_cff.py +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -1,9 +1,13 @@ import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon +from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM +from Configuration.Eras.Modifier_hcalHardcodeConditions_cff import hcalHardcodeConditions from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger +from Configuration.Eras.ModifierChain_trackingMkFitProd_cff import trackingMkFitProdPhase2 def fastSimPhase2(obj): - return obj.copyAndExclude([run3_GEM, phase2_timing, phase2_timing_layer, phase2_trigger]) + return obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, hcalHardcodeConditions, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index b38abb9aea9bd..283ea4ce7af1b 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -139,9 +139,15 @@ _run3_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask]) run3_common.toReplaceWith(globalrecoTask, _run3_globalrecoTask) -_fastSim_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask]) +# these modules are needed for other modules in this task +# keep them together to ensure e.g. trackingOnly reco can work +_fastSim_vertexrecoTask = vertexrecoTask.copy() +_fastSim_vertexrecoTask.add(firstStepPrimaryVerticesUnsorted,initialStepTrackRefsForJets,firstStepPrimaryVertices) +fastSim.toReplaceWith(vertexrecoTask,_fastSim_vertexrecoTask) + # insert the few tracking modules to be run after mixing back in the globalreco sequence -_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator,caloTowerForTrk,firstStepPrimaryVerticesUnsorted,ak4CaloJetsForTrk,initialStepTrackRefsForJets,firstStepPrimaryVertices) +_fastSim_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask]) +_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator) fastSim.toReplaceWith(globalrecoTask,_fastSim_globalrecoTask) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index 29881a3a4c691..35538b157e5b0 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -280,24 +280,6 @@ ) ) -(fastSim & phase2_GE0).toModify(theMixObjects, - mixSH = dict( - input = cms.VInputTag(cms.InputTag("MuonSimHits","MuonCSCHits"), cms.InputTag("MuonSimHits","MuonDTHits"), cms.InputTag("MuonSimHits","MuonRPCHits"), cms.InputTag("fastSimProducer","TrackerHits"), cms.InputTag("MuonSimHits","MuonGEMHits")), - subdets = cms.vstring( - 'MuonCSCHits', - 'MuonDTHits', - 'MuonRPCHits', - 'TrackerHits', - 'MuonGEMHits'), - crossingframes = cms.untracked.vstring( - 'MuonCSCHits', - 'MuonDTHits', - 'MuonRPCHits', - 'MuonGEMHits') - ) - -) - from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal phase2_hgcal.toModify( theMixObjects, diff --git a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py index 98353db571132..da6c0c68a0a08 100644 --- a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py +++ b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py @@ -1,8 +1,11 @@ from SimGeneral.TrackingAnalysis.trackingParticleNumberOfLayersProducer_cfi import * from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toModify(trackingParticleNumberOfLayersProducer, simHits=['fastSimProducer:TrackerHits']) +#fastSim.toModify(trackingParticleNumberOfLayersProducer, simHits=['fastSimProducer:TrackerHits']) from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) +(phase2_tracker).toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) +#(phase2_tracker & ~fastSim).toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 premix_stage2.toModify(trackingParticleNumberOfLayersProducer, trackingParticles = "mixData:MergedTrackTruth") + +fastSim.toModify(trackingParticleNumberOfLayersProducer, simHits=['fastSimProducer:TrackerHits']) diff --git a/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py b/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py index de692e497f6d2..6da1eef6d3d7f 100644 --- a/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py +++ b/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py @@ -34,7 +34,7 @@ #the digitizer for PhaseII muon upgrade is RPCSimModelTiming and for the moment is based on RPCSimAverageNoiseEffCls from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toModify(simMuonRPCDigis, InputCollection = 'MuonSimHitsMuonRPCHits') +#fastSim.toModify(simMuonRPCDigis, InputCollection = 'MuonSimHitsMuonRPCHits') _simMuonRPCDigisPhaseII = cms.EDProducer("RPCandIRPCDigiProducer", Noise = cms.bool(True), @@ -95,3 +95,5 @@ from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 premix_stage2.toModify(simMuonRPCDigis, mixLabel = "mixData") + +fastSim.toModify(simMuonRPCDigis, InputCollection = 'MuonSimHitsMuonRPCHits') diff --git a/Validation/RecoTrack/python/TrackValidation_cff.py b/Validation/RecoTrack/python/TrackValidation_cff.py index ba62888774c82..bd0e8032e20de 100644 --- a/Validation/RecoTrack/python/TrackValidation_cff.py +++ b/Validation/RecoTrack/python/TrackValidation_cff.py @@ -22,6 +22,10 @@ from Configuration.Eras.Modifier_fastSim_cff import fastSim from Configuration.ProcessModifiers.hltClusterSplitting_cff import hltClusterSplitting + +####Importing phase2 modifier +from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 + ### First define the stuff for the standard validation sequence ## Track selectors for _eraName, _postfix, _era in _cfg.allEras(): @@ -42,6 +46,7 @@ else: locals()["_electronSeedProducers"+_postfix] = ["tripletElectronSeeds"] + _removeForFastSimSeedProducers =["initialStepSeedsPreSplitting", "jetCoreRegionalStepSeeds", "jetCoreRegionalStepSeedsBarrel","jetCoreRegionalStepSeedsEndcap", @@ -59,6 +64,12 @@ _trackProducers_fastSim = [ x for x in _trackProducers if x not in _removeForFastTrackProducers] _trackProducers_hltSplit = [ x for x in _trackProducers if x not in ["initialStepTracksPreSplitting"]] + +#Adding separate seed and track producers for Phase 2 - fastsim +_seedProducers_trackingPhase2PU140_fastSim = [ x for x in _seedProducers_trackingPhase2PU140 if x not in _removeForFastSimSeedProducers] +_trackProducers_trackingPhase2PU140_fastSim = [ x for x in _trackProducers_trackingPhase2PU140 if x not in _removeForFastTrackProducers] + + def _algoToSelector(algo): sel = "" if algo != "generalTracks": @@ -147,6 +158,8 @@ def _addSeedToTrackProducers(seedProducers,modDict): _relevantEras = _cfg.allEras() _relevantErasAndFastSim = _relevantEras + [("fastSim", "_fastSim", fastSim)] + + def _translateArgs(args, postfix, modDict): ret = [] for arg in args: @@ -549,7 +562,10 @@ def _getMVASelectors(postfix): ) for _eraName, _postfix, _era in _relevantErasAndFastSim: _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()["_trackProducers"+_postfix]) + fastSim.toModify(trackValidatorBuilding, doMVAPlots=False) +(trackingPhase2PU140 & fastSim).toModify(trackValidatorBuilding, label = cms.VInputTag(_trackProducers_trackingPhase2PU140_fastSim)) + for _eraName, _postfix, _era in _relevantEras: _setForEra(trackValidatorBuilding, _eraName, _era, mvaLabels = locals()["_mvaSelectors"+_postfix]) _setForEra(trackValidatorBuildingPreSplitting, _eraName, _era, label = locals()["_trackProducersPreSplitting"+_postfix]) @@ -935,6 +951,12 @@ def _uniqueFirstLayers(layerList): _taskForEachEra(_addSeedToTrackProducers, args=["_seedProducersPreSplitting"], names="_seedSelectorsPreSplitting", task="_tracksValidationSeedSelectorsPreSplittingTrackingOnly", modDict=globals()) tracksValidationSeedSelectorsTrackingOnly.add(tracksValidationSeedSelectorsPreSplittingTrackingOnly) +trackingPhase2PU140_fastSim_trackprod, trackingPhase2PU140_fastSim_trackprod_task = _addSeedToTrackProducers(_seedProducers_trackingPhase2PU140_fastSim, modDict=globals()) + + +(trackingPhase2PU140 & fastSim).toReplaceWith(tracksValidationSeedSelectorsTrackingOnly, trackingPhase2PU140_fastSim_trackprod_task) + + # MTV instances trackValidatorTrackingOnly = trackValidatorStandalone.clone( label = [ x for x in trackValidatorStandalone.label if x != "cutsRecoTracksAK4PFJets"], @@ -950,6 +972,9 @@ def _uniqueFirstLayers(layerList): ) seedingDeepCore.toModify(trackValidatorSeedingTrackingOnly, doResolutionPlotsForLabels = ["seedTracksjetCoreRegionalStepSeedsBarrel","seedTracksjetCoreRegionalStepSeedsEndcap"] ) +#trackValidatorSeedingTrackingOnly +#(trackingPhase2PU140 & fastSim).toModify(trackValidatorSeedingTrackingOnly, label = somename) + trackValidatorSeedingPreSplittingTrackingOnly = trackValidatorSeedingTrackingOnly.clone( associators = ["quickTrackAssociatorByHitsPreSplitting"], label = _seedSelectorsPreSplitting, @@ -976,6 +1001,8 @@ def _uniqueFirstLayers(layerList): for _eraName, _postfix, _era in _relevantEras: _setForEra(trackValidatorSeedingPreSplittingTrackingOnly, _eraName, _era, label = locals()["_seedSelectorsPreSplitting"+_postfix]) +#Only if both phase2 and fastsim are called then replace seedselectors with correct producers +(trackingPhase2PU140 & fastSim).toModify(trackValidatorSeedingTrackingOnly, label = trackingPhase2PU140_fastSim_trackprod) trackValidatorConversionTrackingOnly = trackValidatorConversion.clone(label = [x for x in trackValidatorConversion.label if x not in ["ckfInOutTracksFromConversions", "ckfOutInTracksFromConversions"]]) From 59a303a12bbd6dcb469d376521c2bd5afec6134c Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 13 Nov 2025 14:59:17 +0100 Subject: [PATCH 18/34] Adding back muon, gem and hcalhardcode modifiers to phase2 chain --- Configuration/Eras/python/Util_fastSimPhase2_cff.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Configuration/Eras/python/Util_fastSimPhase2_cff.py b/Configuration/Eras/python/Util_fastSimPhase2_cff.py index f2765244bcf86..04e9266784d68 100644 --- a/Configuration/Eras/python/Util_fastSimPhase2_cff.py +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -1,13 +1,10 @@ import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon -from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM -from Configuration.Eras.Modifier_hcalHardcodeConditions_cff import hcalHardcodeConditions from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger from Configuration.Eras.ModifierChain_trackingMkFitProd_cff import trackingMkFitProdPhase2 def fastSimPhase2(obj): - return obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, hcalHardcodeConditions, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) + return obj.copyAndExclude([run3_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) From 974cf32e7a972bb8da8ac29ae61593ac078566ed Mon Sep 17 00:00:00 2001 From: Kirutheeka Namasivayam Date: Thu, 5 Feb 2026 13:32:15 +0100 Subject: [PATCH 19/34] make MuonDetLayerMeasurements safe against missing collections, added separate modifier for phase 2 strip resolutions (values to be revisited) --- .../Eras/python/Util_fastSimPhase2_cff.py | 4 +- .../python/Reconstruction_cff.py | 5 +- .../python/TrackingRecHitProducer_cfi.py | 46 +++++++++++++++++-- .../src/MuonDetLayerMeasurements.cc | 33 ++++--------- .../python/hcalUnsuppressedDigis_cfi.py | 3 +- .../MixingModule/python/ecalDigitizer_cfi.py | 7 +-- .../MixingModule/python/mixObjects_cfi.py | 2 +- 7 files changed, 65 insertions(+), 35 deletions(-) diff --git a/Configuration/Eras/python/Util_fastSimPhase2_cff.py b/Configuration/Eras/python/Util_fastSimPhase2_cff.py index 04e9266784d68..d06fd853ceccc 100644 --- a/Configuration/Eras/python/Util_fastSimPhase2_cff.py +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -1,10 +1,12 @@ import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM +from Configuration.Eras.Modifier_phase2_muon_cff import phase2_muon +from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger from Configuration.Eras.ModifierChain_trackingMkFitProd_cff import trackingMkFitProdPhase2 def fastSimPhase2(obj): - return obj.copyAndExclude([run3_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) + return obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index 283ea4ce7af1b..8d7a9955c3f01 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -147,7 +147,10 @@ # insert the few tracking modules to be run after mixing back in the globalreco sequence _fastSim_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask]) -_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator) +_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator,caloTowerForTrk,firstStepPrimaryVerticesUnsorted,ak4CaloJetsForTrk,initialStepTrackRefsForJets,firstStepPrimaryVertices) + +#_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator) + fastSim.toReplaceWith(globalrecoTask,_fastSim_globalrecoTask) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal diff --git a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py index 810b0b7af3b04..2f3dc1a5946d0 100644 --- a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py @@ -24,7 +24,7 @@ # Phase 2 Era: replace plugins by Phase 2 plugins, etc... from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) +#phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) # Configure strip tracker Gaussian-smearing plugins: trackerStripGaussianResolutions={ @@ -37,10 +37,7 @@ "TID": { 1: cms.double(0.00262), 2: cms.double(0.00354), - 3: cms.double(0.00391), - 4: cms.double(0.00391), - 5: cms.double(0.00391) - }, + 3: cms.double(0.00391)}, "TOB": { 1: cms.double(0.00461), 2: cms.double(0.00458), @@ -71,3 +68,42 @@ select=cms.string("(subdetId=="+subdetId+") && (layer=="+str(trackerLayer)+")"), ) fastTrackerRecHits.plugins.append(pluginConfig) + + + + +#phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) +print("Type of pixelPluginsPhase2: ", type(pixelPluginsPhase2)) +PluginsPhase2=pixelPluginsPhase2.copy() +# Configure strip tracker Gaussian-smearing plugins: +trackerStripGaussianResolutionsPhase2={ + "TID": { + 1: cms.double(0.00262), + 2: cms.double(0.00354), + 3: cms.double(0.00391), + 4: cms.double(0.00391), + 5: cms.double(0.00391) + }, + "TOB": { + 1: cms.double(0.00461), + 2: cms.double(0.00458), + 3: cms.double(0.00488), + 4: cms.double(0.00491), + 5: cms.double(0.00293), + 6: cms.double(0.00299) + } +} + + +for subdetId,trackerLayers in trackerStripGaussianResolutionsPhase2.items(): + for trackerLayer, resolutionX in trackerLayers.items(): + pluginConfig = cms.PSet( + name = cms.string(subdetId+str(trackerLayer)), + type=cms.string("TrackingRecHitStripGSPlugin"), + resolutionX=resolutionX, + select=cms.string("(subdetId=="+subdetId+") && (layer=="+str(trackerLayer)+")"), + ) + PluginsPhase2.append(pluginConfig) + + +phase2_tracker.toModify(fastTrackerRecHits, plugins = PluginsPhase2) diff --git a/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc b/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc index d6e37161e5c18..eb8db13094029 100644 --- a/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc +++ b/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc @@ -48,29 +48,16 @@ MuonDetLayerMeasurements::MuonDetLayerMeasurements(edm::InputTag dtlabel, theGEMEventCacheID(0), theME0EventCacheID(0), theEvent(nullptr) { - dtToken_ = iC.consumes(dtlabel); - cscToken_ = iC.consumes(csclabel); - rpcToken_ = iC.consumes(rpclabel); - gemToken_ = iC.consumes(gemlabel); - me0Token_ = iC.consumes(me0label); - - static std::atomic procInstance{0}; - std::ostringstream sDT; - sDT << "MuonDetLayerMeasurements::checkDTRecHits::" << procInstance; - // theDTCheckName = sDT.str(); - std::ostringstream sRPC; - sRPC << "MuonDetLayerMeasurements::checkRPCRecHits::" << procInstance; - //theRPCCheckName = sRPC.str(); - std::ostringstream sCSC; - sCSC << "MuonDetLayerMeasurements::checkCSCRecHits::" << procInstance; - //theCSCCheckName = sCSC.str(); - std::ostringstream sGEM; - sGEM << "MuonDetLayerMeasurements::checkGEMRecHits::" << procInstance; - //theGEMCheckName = sGEM.str(); - std::ostringstream sME0; - sME0 << "MuonDetLayerMeasurements::checkME0RecHits::" << procInstance; - //theME0CheckName = sME0.str(); - procInstance++; + if (enableDTMeasurement) + dtToken_ = iC.consumes(dtlabel); + if (enableCSCMeasurement) + cscToken_ = iC.consumes(csclabel); + if (enableRPCMeasurement) + rpcToken_ = iC.consumes(rpclabel); + if (enableGEMMeasurement) + gemToken_ = iC.consumes(gemlabel); + if (enableME0Measurement) + me0Token_ = iC.consumes(me0label); } MuonDetLayerMeasurements::~MuonDetLayerMeasurements() {} diff --git a/SimCalorimetry/HcalSimProducers/python/hcalUnsuppressedDigis_cfi.py b/SimCalorimetry/HcalSimProducers/python/hcalUnsuppressedDigis_cfi.py index c793e60a180b7..63f79f75b5c19 100644 --- a/SimCalorimetry/HcalSimProducers/python/hcalUnsuppressedDigis_cfi.py +++ b/SimCalorimetry/HcalSimProducers/python/hcalUnsuppressedDigis_cfi.py @@ -46,7 +46,6 @@ ) from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toModify( hcalSimBlock, hitsProducer = "fastSimProducer" ) from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1 premix_stage1.toModify(hcalSimBlock, @@ -71,3 +70,5 @@ # enable ZDC digitization from Configuration.ProcessModifiers.zdcDigi_cff import zdcDigi zdcDigi.toModify(hcalSimBlock, doZDCDigi = True ) + +fastSim.toModify( hcalSimBlock, hitsProducer = "fastSimProducer" ) diff --git a/SimGeneral/MixingModule/python/ecalDigitizer_cfi.py b/SimGeneral/MixingModule/python/ecalDigitizer_cfi.py index 37a109e1159aa..46814f64ca198 100644 --- a/SimGeneral/MixingModule/python/ecalDigitizer_cfi.py +++ b/SimGeneral/MixingModule/python/ecalDigitizer_cfi.py @@ -25,8 +25,7 @@ ) from Configuration.Eras.Modifier_fastSim_cff import fastSim -fastSim.toModify(ecalDigitizer, hitsProducer = "fastSimProducer") - + ecalDigitizer.doEB = cms.bool(True) ecalDigitizer.doEE = cms.bool(True) ecalDigitizer.doES = cms.bool(True) @@ -48,4 +47,6 @@ ## Disable all noise for the tau embedding methods simulation step ## from Configuration.ProcessModifiers.tau_embedding_sim_cff import tau_embedding_sim -tau_embedding_sim.toModify(ecalDigitizer, doENoise = False, doESNoise = False) \ No newline at end of file +tau_embedding_sim.toModify(ecalDigitizer, doENoise = False, doESNoise = False) + +fastSim.toModify(ecalDigitizer, hitsProducer = "fastSimProducer") diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index 35538b157e5b0..06b88bc12a6f5 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -269,7 +269,7 @@ from Configuration.Eras.Modifier_phase2_GE0_cff import phase2_GE0 phase2_GE0.toModify( theMixObjects, mixSH = dict( - input = list(filter(lambda x: type(x) == type(cms.InputTag("","")) and x != cms.InputTag("g4SimHits","MuonME0Hits") and x != cms.InputTag("g4SimHits","MuonGEMHits"), theMixObjects.mixSH.input)), + input = list(filter(lambda x: type(x) == type(cms.InputTag("","")) and x != cms.InputTag("g4SimHits","MuonME0Hits"), theMixObjects.mixSH.input)), subdets = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.subdets)), crossingFrames = list(filter(lambda x: x != 'MuonME0Hits', theMixObjects.mixSH.crossingFrames)) ) From 2cf451e36c8b6f1a5327d3c07289c1272f6e10a7 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Thu, 12 Mar 2026 16:24:00 -0500 Subject: [PATCH 20/34] cleanup --- .../python/Reconstruction_cff.py | 4 +--- .../Configuration/python/DigiAliases_cff.py | 2 +- .../src/Geometry.cc | 1 - .../python/PixelPluginsPhase2_cfi.py | 23 +------------------ .../python/TrackingRecHitProducer_cfi.py | 8 ------- .../src/PixelResolutionHistograms.cc | 8 ++++--- .../python/InitialStep_cff.py | 18 --------------- .../python/caloTruthProducer_cfi.py | 1 + .../MixingModule/python/digitizers_cfi.py | 2 -- .../MixingModule/python/mixObjects_cfi.py | 4 +--- ...ckingParticleNumberOfLayersProducer_cff.py | 5 ++-- .../RPCDigitizer/python/muonRPCDigis_cfi.py | 1 - .../RecoTrack/python/TrackValidation_cff.py | 11 +-------- 13 files changed, 13 insertions(+), 75 deletions(-) diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index 8d7a9955c3f01..0dfbe1086fe98 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -149,8 +149,6 @@ _fastSim_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask]) _fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator,caloTowerForTrk,firstStepPrimaryVerticesUnsorted,ak4CaloJetsForTrk,initialStepTrackRefsForJets,firstStepPrimaryVertices) -#_fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator) - fastSim.toReplaceWith(globalrecoTask,_fastSim_globalrecoTask) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal @@ -342,4 +340,4 @@ _tau_embedding_sim_globalreco_trackingTask = globalreco_trackingTask.copyAndExclude([offlineBeamSpotTask]) tau_embedding_sim.toReplaceWith(globalreco_trackingTask, _tau_embedding_sim_globalreco_trackingTask) _tau_embedding_sim_reconstruction_pixelTrackingOnlyTask = reconstruction_pixelTrackingOnlyTask.copyAndExclude([offlineBeamSpotTask]) -tau_embedding_sim.toReplaceWith(reconstruction_pixelTrackingOnlyTask, _tau_embedding_sim_reconstruction_pixelTrackingOnlyTask) \ No newline at end of file +tau_embedding_sim.toReplaceWith(reconstruction_pixelTrackingOnlyTask, _tau_embedding_sim_reconstruction_pixelTrackingOnlyTask) diff --git a/FastSimulation/Configuration/python/DigiAliases_cff.py b/FastSimulation/Configuration/python/DigiAliases_cff.py index e9c8dd41a6361..5fb2d07c0c86e 100644 --- a/FastSimulation/Configuration/python/DigiAliases_cff.py +++ b/FastSimulation/Configuration/python/DigiAliases_cff.py @@ -77,7 +77,7 @@ def loadDigiAliases(process, premix=False): ) } ) - + process.hcalDigis = cms.EDAlias( **{"simHcalDigis" if nopremix else "DMHcalDigis" : cms.VPSet( diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc index 820e33a5e13e9..d2d5926c825fc 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc @@ -133,7 +133,6 @@ Geometry::Geometry(const edm::ParameterSet& cfg, for (unsigned index = 0; index < forwardLayers_.size(); index++) { // set index forwardLayers_[index]->setIndex(index); - std::cout<<"FWD Layer "<getZ()< 0) { if (forwardLayers_[index]->getZ() < forwardLayers_[index - 1]->getZ()) { diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 5c812f4867c86..7ff89317ad7c5 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -11,20 +11,9 @@ name = cms.string("pixelBarrelSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32(-1), - ## templateId = cms.int32( 292 ), - #RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - #BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - #EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_barrel.root'), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), - EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), - - #phase1 - #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos39921_5611_6.root'), - #BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelBig2017.root'), - #EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), - + EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bmergeprob.root'), MergedPixelResolutionXFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bxsmear.root'), @@ -39,19 +28,9 @@ name = cms.string("pixelForwardSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32(-1), - ## templateId = cms.int32( 291 ), -# RegularPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), -# BigPixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), -# EdgePixelResolutionFile = cms.string('/eos/cms/store/group/offcomp-sim/FastSimPhase2/3-18-25_forward.root'), RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), - #old files - #RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - #BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - #EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/pixel_histos49765_291.root'), - ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), - ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/fmergeprob.root'), MergedPixelResolutionXFile = cms.string('FastSimulation/TrackingRecHitProducer/data/fxsmear.root'), diff --git a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py index 2f3dc1a5946d0..03f2deb6b8955 100644 --- a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py @@ -24,7 +24,6 @@ # Phase 2 Era: replace plugins by Phase 2 plugins, etc... from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -#phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) # Configure strip tracker Gaussian-smearing plugins: trackerStripGaussianResolutions={ @@ -69,11 +68,6 @@ ) fastTrackerRecHits.plugins.append(pluginConfig) - - - -#phase2_tracker.toModify(fastTrackerRecHits, plugins = pixelPluginsPhase2) -print("Type of pixelPluginsPhase2: ", type(pixelPluginsPhase2)) PluginsPhase2=pixelPluginsPhase2.copy() # Configure strip tracker Gaussian-smearing plugins: trackerStripGaussianResolutionsPhase2={ @@ -94,7 +88,6 @@ } } - for subdetId,trackerLayers in trackerStripGaussianResolutionsPhase2.items(): for trackerLayer, resolutionX in trackerLayers.items(): pluginConfig = cms.PSet( @@ -105,5 +98,4 @@ ) PluginsPhase2.append(pluginConfig) - phase2_tracker.toModify(fastTrackerRecHits, plugins = PluginsPhase2) diff --git a/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc index 5f1bfbc607e18..e1f24977fbb9d 100644 --- a/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc +++ b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc @@ -117,7 +117,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, // // Store detType in the underflow bin binningHisto_->SetBinContent(0, 0, detType_); - + // All other histograms: Char_t histo[200]; Char_t title[200]; @@ -240,7 +240,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, LOGERROR << "PixelResolutionHistograms:: Error, file " << filename << " not found."; return; // PixelTemplateSmearerBase will throw an exception upon our return. } - + //--- The dummy 2D histogram with the binning of cot\beta and cot\alpha: binningHisto_ = (TH2F*)file_->Get(Form("%s%s", rootdir.c_str(), "ResHistoBinning")); if (!binningHisto_) { @@ -248,12 +248,14 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, LOGERROR << "PixelResolutionHistograms:: Error, binning histogrram ResHistoBinning not found."; return; // PixelTemplateSmearerBase will throw an exception upon our return. } + if (detType == -1) { //--- Fish out detType from the underflow bin: detType_ = binningHisto_->GetBinContent(0, 0); } else { detType_ = detType; // constructor's argument overrides what's in ResHistoBinning histogram. } + //--- Now we fill the binning variables: cotbetaAxis_ = binningHisto_->GetXaxis(); cotbetaBinWidth_ = binningHisto_->GetXaxis()->GetBinWidth(1); // assume all same width @@ -286,7 +288,7 @@ PixelResolutionHistograms::PixelResolutionHistograms(std::string filename, if (!tmphist) { status_ = 2; LOGERROR << "Failed to find histogram=" << std::string(histo); - LOGERROR << "Failed to find histogram: det type =" << detType_; + LOGERROR << "Failed to find histogram: det type =" << detType_; return; } LOGDEBUG << "Found histo " << std::string(histo) << " with title = " << std::string(tmphist->GetTitle()) diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index de3253d2794ad..505118365ee05 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -138,24 +138,6 @@ fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds) -#trackingPhase2PU140.toModify(_fastSim_initialStepSeeds, seedFinderSelector = dict( -# pixelTripletGeneratorFactory = None, -# CAHitQuadrupletGeneratorFactory = _hitSetProducerToFactoryPSet(initialStepHitQuadruplets).clone(SeedComparitorPSet = dict(ComponentName = "none")), - #new parameters required for phase2 seeding -# BPix = dict( -# TTRHBuilder = 'WithoutRefit', -# HitProducer = 'TrackingRecHitProducer', -# ), -# FPix = dict( -# TTRHBuilder = 'WithoutRefit', -# HitProducer = 'TrackingRecHitProducer', -# ), -# layerPairs = initialStepHitDoublets.layerPairs.value() -# ) -#) - -#fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds) - # building import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff _initialStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone( diff --git a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py index 9a7a3a6612013..93573b7772832 100644 --- a/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py +++ b/SimGeneral/MixingModule/python/caloTruthProducer_cfi.py @@ -75,3 +75,4 @@ ) ) + diff --git a/SimGeneral/MixingModule/python/digitizers_cfi.py b/SimGeneral/MixingModule/python/digitizers_cfi.py index 16a874a2a692d..8bd896305480a 100644 --- a/SimGeneral/MixingModule/python/digitizers_cfi.py +++ b/SimGeneral/MixingModule/python/digitizers_cfi.py @@ -110,8 +110,6 @@ MC_fastTimingLayer = dict(premixStage1 = True), ) -#(fastSim & phase2_hgcal).toModify(theDigitizersValid, calotruth = None) - from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker (phase2_tracker& ~fastSim).toModify(theDigitizers, strip = None) diff --git a/SimGeneral/MixingModule/python/mixObjects_cfi.py b/SimGeneral/MixingModule/python/mixObjects_cfi.py index 06b88bc12a6f5..f8b585c7fb9d3 100644 --- a/SimGeneral/MixingModule/python/mixObjects_cfi.py +++ b/SimGeneral/MixingModule/python/mixObjects_cfi.py @@ -125,6 +125,7 @@ # fastsim customs fastSim.toModify(mixSimTracks, input = ["fastSimProducer"]) fastSim.toModify(mixSimVertices, input = ["fastSimProducer"]) + mixHepMCProducts = cms.PSet( makeCrossingFrame = cms.untracked.bool(True), input = cms.VInputTag(cms.InputTag("generatorSmeared"),cms.InputTag("generator")), @@ -258,8 +259,6 @@ crossingFrames = theMixObjects.mixSH.crossingFrames + [ 'MuonME0Hits' ] ) ) - - (premix_stage1 & phase2_muon).toModify(theMixObjects, mixSH = dict( pcrossingFrames = theMixObjects.mixSH.pcrossingFrames + [ 'MuonME0Hits' ] @@ -281,7 +280,6 @@ ) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal - phase2_hgcal.toModify( theMixObjects, mixCH = dict( input = theMixObjects.mixCH.input + [ cms.InputTag("g4SimHits",hgceeDigitizer.hitCollection.value()), diff --git a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py index da6c0c68a0a08..6e5462b4e86e0 100644 --- a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py +++ b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py @@ -1,10 +1,9 @@ from SimGeneral.TrackingAnalysis.trackingParticleNumberOfLayersProducer_cfi import * from Configuration.Eras.Modifier_fastSim_cff import fastSim -#fastSim.toModify(trackingParticleNumberOfLayersProducer, simHits=['fastSimProducer:TrackerHits']) + from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -(phase2_tracker).toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) +phase2_tracker.toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) -#(phase2_tracker & ~fastSim).toModify(trackingParticleNumberOfLayersProducer, simHits = ["g4SimHits:TrackerHitsPixelBarrelLowTof", "g4SimHits:TrackerHitsPixelEndcapLowTof"]) from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 premix_stage2.toModify(trackingParticleNumberOfLayersProducer, trackingParticles = "mixData:MergedTrackTruth") diff --git a/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py b/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py index 6da1eef6d3d7f..6b7f809c1f48e 100644 --- a/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py +++ b/SimMuon/RPCDigitizer/python/muonRPCDigis_cfi.py @@ -34,7 +34,6 @@ #the digitizer for PhaseII muon upgrade is RPCSimModelTiming and for the moment is based on RPCSimAverageNoiseEffCls from Configuration.Eras.Modifier_fastSim_cff import fastSim -#fastSim.toModify(simMuonRPCDigis, InputCollection = 'MuonSimHitsMuonRPCHits') _simMuonRPCDigisPhaseII = cms.EDProducer("RPCandIRPCDigiProducer", Noise = cms.bool(True), diff --git a/Validation/RecoTrack/python/TrackValidation_cff.py b/Validation/RecoTrack/python/TrackValidation_cff.py index bd0e8032e20de..e177ac6065221 100644 --- a/Validation/RecoTrack/python/TrackValidation_cff.py +++ b/Validation/RecoTrack/python/TrackValidation_cff.py @@ -22,7 +22,6 @@ from Configuration.Eras.Modifier_fastSim_cff import fastSim from Configuration.ProcessModifiers.hltClusterSplitting_cff import hltClusterSplitting - ####Importing phase2 modifier from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140 @@ -46,7 +45,6 @@ else: locals()["_electronSeedProducers"+_postfix] = ["tripletElectronSeeds"] - _removeForFastSimSeedProducers =["initialStepSeedsPreSplitting", "jetCoreRegionalStepSeeds", "jetCoreRegionalStepSeedsBarrel","jetCoreRegionalStepSeedsEndcap", @@ -158,8 +156,6 @@ def _addSeedToTrackProducers(seedProducers,modDict): _relevantEras = _cfg.allEras() _relevantErasAndFastSim = _relevantEras + [("fastSim", "_fastSim", fastSim)] - - def _translateArgs(args, postfix, modDict): ret = [] for arg in args: @@ -562,7 +558,7 @@ def _getMVASelectors(postfix): ) for _eraName, _postfix, _era in _relevantErasAndFastSim: _setForEra(trackValidatorBuilding, _eraName, _era, label = locals()["_trackProducers"+_postfix]) - + fastSim.toModify(trackValidatorBuilding, doMVAPlots=False) (trackingPhase2PU140 & fastSim).toModify(trackValidatorBuilding, label = cms.VInputTag(_trackProducers_trackingPhase2PU140_fastSim)) @@ -953,10 +949,8 @@ def _uniqueFirstLayers(layerList): trackingPhase2PU140_fastSim_trackprod, trackingPhase2PU140_fastSim_trackprod_task = _addSeedToTrackProducers(_seedProducers_trackingPhase2PU140_fastSim, modDict=globals()) - (trackingPhase2PU140 & fastSim).toReplaceWith(tracksValidationSeedSelectorsTrackingOnly, trackingPhase2PU140_fastSim_trackprod_task) - # MTV instances trackValidatorTrackingOnly = trackValidatorStandalone.clone( label = [ x for x in trackValidatorStandalone.label if x != "cutsRecoTracksAK4PFJets"], @@ -972,9 +966,6 @@ def _uniqueFirstLayers(layerList): ) seedingDeepCore.toModify(trackValidatorSeedingTrackingOnly, doResolutionPlotsForLabels = ["seedTracksjetCoreRegionalStepSeedsBarrel","seedTracksjetCoreRegionalStepSeedsEndcap"] ) -#trackValidatorSeedingTrackingOnly -#(trackingPhase2PU140 & fastSim).toModify(trackValidatorSeedingTrackingOnly, label = somename) - trackValidatorSeedingPreSplittingTrackingOnly = trackValidatorSeedingTrackingOnly.clone( associators = ["quickTrackAssociatorByHitsPreSplitting"], label = _seedSelectorsPreSplitting, From fb945d9f3d26de0968b116559b5c8f6bd94e429b Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Thu, 12 Mar 2026 17:24:02 -0500 Subject: [PATCH 21/34] more flexible fastsim geometry customizations --- .../Applications/python/ConfigBuilder.py | 91 +++++++++-------- .../Configuration/python/Geometries_MC_cff.py | 12 ++- .../python/Geometries_SLHC_cff.py | 51 ---------- .../python/Geometries_START_cff.py | 13 +-- .../Configuration/python/Geometries_cff.py | 97 +++++++++---------- 5 files changed, 108 insertions(+), 156 deletions(-) delete mode 100644 FastSimulation/Configuration/python/Geometries_SLHC_cff.py diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index 83dc0655c033e..208f8b489c63e 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -829,14 +829,18 @@ def addStandardSequences(self): # load the geometry file try: if len(self.stepMap): - self.loadAndRemember(self.GeometryCFF) - if (self.GeometryCFF == 'Configuration/StandardSequences/GeometryRecoDB_cff' and not self.geometryDBLabel): - print("Warning: The default GeometryRecoDB_cff is being used; however, the DB geometry is not applied. You may need to verify your cmsDriver.") - if ('SIM' in self.stepMap or 'reSIM' in self.stepMap) and not self._options.fast: - self.loadAndRemember(self.SimGeometryCFF) - if self.geometryDBLabel: - self.executeAndRemember('if hasattr(process, "XMLFromDBSource"): process.XMLFromDBSource.label="%s"'%(self.geometryDBLabel)) - self.executeAndRemember('if hasattr(process, "DDDetectorESProducerFromDB"): process.DDDetectorESProducerFromDB.label="%s"'%(self.geometryDBLabel)) + if isinstance(self.GeometryCFF, list): + for cff in self.GeometryCFF: + self.loadAndRemember(cff) + else: + self.loadAndRemember(self.GeometryCFF) + if (self.GeometryCFF == 'Configuration/StandardSequences/GeometryRecoDB_cff' and not self.geometryDBLabel): + print("Warning: The default GeometryRecoDB_cff is being used; however, the DB geometry is not applied. You may need to verify your cmsDriver.") + if ('SIM' in self.stepMap or 'reSIM' in self.stepMap) and not self._options.fast: + self.loadAndRemember(self.SimGeometryCFF) + if self.geometryDBLabel: + self.executeAndRemember('if hasattr(process, "XMLFromDBSource"): process.XMLFromDBSource.label="%s"'%(self.geometryDBLabel)) + self.executeAndRemember('if hasattr(process, "DDDetectorESProducerFromDB"): process.DDDetectorESProducerFromDB.label="%s"'%(self.geometryDBLabel)) except ImportError: print("Geometry option",self._options.geometry,"unknown.") @@ -1183,44 +1187,39 @@ def define_Configs(self): self.GeometryCFF='Configuration/StandardSequences/GeometryRecoDB_cff' self.geometryDBLabel=None simGeometry='' - if self._options.fast: - if 'start' in self._options.conditions.lower(): - self.GeometryCFF='FastSimulation/Configuration/Geometries_START_cff' + + def inGeometryKeys(opt): + from Configuration.StandardSequences.GeometryConf import GeometryConf + if opt in GeometryConf: + return GeometryConf[opt] else: - self.GeometryCFF='FastSimulation/Configuration/Geometries_MC_cff' - else: - def inGeometryKeys(opt): - from Configuration.StandardSequences.GeometryConf import GeometryConf - if opt in GeometryConf: - return GeometryConf[opt] - else: - if (opt=='SimDB' or opt.startswith('DB:')): - return opt - else: - raise Exception("Geometry "+opt+" does not exist!") - - geoms=self._options.geometry.split(',') - if len(geoms)==1: geoms=inGeometryKeys(geoms[0]).split(',') - if len(geoms)==2: - #may specify the reco geometry - if '/' in geoms[1] or '_cff' in geoms[1]: - self.GeometryCFF=geoms[1] + if (opt=='SimDB' or opt.startswith('DB:')): + return opt else: - self.GeometryCFF='Configuration/Geometry/Geometry'+geoms[1]+'_cff' + raise Exception("Geometry "+opt+" does not exist!") + + geoms=self._options.geometry.split(',') + if len(geoms)==1: geoms=inGeometryKeys(geoms[0]).split(',') + if len(geoms)==2: + #may specify the reco geometry + if '/' in geoms[1] or '_cff' in geoms[1]: + self.GeometryCFF=geoms[1] + else: + self.GeometryCFF='Configuration/Geometry/Geometry'+geoms[1]+'_cff' - if (geoms[0].startswith('DB:')): - self.SimGeometryCFF='Configuration/StandardSequences/GeometrySimDB_cff' - self.geometryDBLabel=geoms[0][3:] - print("with DB:") + if (geoms[0].startswith('DB:')): + self.SimGeometryCFF='Configuration/StandardSequences/GeometrySimDB_cff' + self.geometryDBLabel=geoms[0][3:] + print("with DB:") + else: + if '/' in geoms[0] or '_cff' in geoms[0]: + self.SimGeometryCFF=geoms[0] else: - if '/' in geoms[0] or '_cff' in geoms[0]: - self.SimGeometryCFF=geoms[0] + simGeometry=geoms[0] + if self._options.gflash==True: + self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'GFlash_cff' else: - simGeometry=geoms[0] - if self._options.gflash==True: - self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'GFlash_cff' - else: - self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'_cff' + self.SimGeometryCFF='Configuration/Geometry/Geometry'+geoms[0]+'_cff' # synchronize the geometry configuration and the FullSimulation sequence to be used if simGeometry not in defaultOptions.geometryExtendedOptions: @@ -1232,6 +1231,16 @@ def inGeometryKeys(opt): # fastsim requires some changes to the default cff files and sequences if self._options.fast: + # always use reco geometry + if 'Reco' not in self.GeometryCFF and 'DB' not in self.GeometryCFF: + self.GeometryCFF = self.GeometryCFF.replace("_cff","Reco_cff") + self.GeometryCFF = [self.GeometryCFF] + + self.GeometryCFF.append('FastSimulation/Configuration/Geometries_cff') + self.GeometryCFF.append('FastSimulation/Configuration/Geometries_MC_cff') + if 'start' in self._options.conditions.lower(): + self.GeometryCFF.append('FastSimulation/Configuration/Geometries_START_cff') + self.SIMDefaultCFF = 'FastSimulation.Configuration.SimIdeal_cff' self.RECODefaultCFF= 'FastSimulation.Configuration.Reconstruction_AftMix_cff' self.RECOBEFMIXDefaultCFF = 'FastSimulation.Configuration.Reconstruction_BefMix_cff' diff --git a/FastSimulation/Configuration/python/Geometries_MC_cff.py b/FastSimulation/Configuration/python/Geometries_MC_cff.py index 3e62b81c68f9f..7cbb23dc0ed29 100644 --- a/FastSimulation/Configuration/python/Geometries_MC_cff.py +++ b/FastSimulation/Configuration/python/Geometries_MC_cff.py @@ -1,8 +1,10 @@ import FWCore.ParameterSet.Config as cms -from FastSimulation.Configuration.Geometries_cff import * +def _fastSimGeometryCustomsMC(process): + # Apply Tracker and Muon misalignment + process.misalignedTrackerGeometry.applyAlignment = True + process.misalignedDTGeometry.applyAlignment = True + process.misalignedCSCGeometry.applyAlignment = True -# Apply Tracker and Muon misalignment -misalignedTrackerGeometry.applyAlignment = True -misalignedDTGeometry.applyAlignment = True -misalignedCSCGeometry.applyAlignment = True +from Configuration.Eras.Modifier_fastSim_cff import fastSim +modifyGeomMC_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsMC) diff --git a/FastSimulation/Configuration/python/Geometries_SLHC_cff.py b/FastSimulation/Configuration/python/Geometries_SLHC_cff.py deleted file mode 100644 index 93d44e3a1e406..0000000000000 --- a/FastSimulation/Configuration/python/Geometries_SLHC_cff.py +++ /dev/null @@ -1,51 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# The CMS Geometry files -# Pilot 2 geometry doesn't contain the preshower -#from Configuration.StandardSequences.GeometryPilot2_cff import * - -# To use the "full" CMS geometry, comment the prevous line, and uncomment the following one: -#####from Configuration.StandardSequences.Geometry_cff import * -from Configuration.Geometry.GeometrySLHC_cff import * - -# The tracker geometry left-over (for aligned/misaligned geometry) -# The goemetry used for reconstruction must not be misaligned. -trackerSLHCGeometry.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedTrackerGeometry = Geometry.TrackerGeometryBuilder.trackerSLHCGeometry_cfi.trackerSLHCGeometry.clone() -# The misalignment is not applied by default -misalignedTrackerGeometry.applyAlignment = False -# Label of the produced TrackerGeometry: -misalignedTrackerGeometry.appendToDataLabel = 'MisAligned' - -# The DT geometry left-over (for aligned/misaligned geometry) -# The geometry used for reconstruction must not be misaligned. -DTGeometryESModule.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedDTGeometry = Geometry.DTGeometryBuilder.dtGeometry_cfi.DTGeometryESModule.clone() -# The misalignment is not applied by default -misalignedDTGeometry.applyAlignment = False -# Label of the produced DTGeometry: -misalignedDTGeometry.appendToDataLabel = 'MisAligned' - -# The CSC geometry left-over (for aligned/misaligned geometry) -# The geometry used for reconstruction must not be misaligned. -CSCGeometryESModule.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedCSCGeometry = Geometry.CSCGeometryBuilder.cscGeometry_cfi.CSCGeometryESModule.clone() -# The misalignment is not applied by default -misalignedCSCGeometry.applyAlignment = False -# Label of the produced CSCGeometry: -misalignedCSCGeometry.appendToDataLabel = 'MisAligned' - - - -# Reconstruction and Interaction tracker geometries -from FastSimulation.Configuration.TrackerRecoGeometryESProducer_cfi import * -from FastSimulation.TrackerSetup.TrackerInteractionGeometryESProducer_cfi import * - -# The Calo geometry service model left-over -from Geometry.CaloEventSetup.CaloTopology_cfi import * - -# The muon geometry left-over -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * diff --git a/FastSimulation/Configuration/python/Geometries_START_cff.py b/FastSimulation/Configuration/python/Geometries_START_cff.py index 7c6b4cf049dc0..ff931efc16913 100644 --- a/FastSimulation/Configuration/python/Geometries_START_cff.py +++ b/FastSimulation/Configuration/python/Geometries_START_cff.py @@ -1,12 +1,9 @@ import FWCore.ParameterSet.Config as cms -from FastSimulation.Configuration.Geometries_cff import * - -import FastSimulation.SimplifiedGeometryPropagator.fastSimProducer_cff - # Apply Tracker and Muon misalignment -process.fastSimProducer.detectorDefinition.trackerAlignmentLabel = cms.untracked.string("") -misalignedTrackerGeometry.applyAlignment = True -misalignedDTGeometry.applyAlignment = True -misalignedCSCGeometry.applyAlignment = True +def _fastSimGeometryCustomsStart(process): + process.fastSimProducer.detectorDefinition.trackerAlignmentLabel = cms.untracked.string("") + +from Configuration.Eras.Modifier_fastSim_cff import fastSim +modifyGeomStart_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsStart) diff --git a/FastSimulation/Configuration/python/Geometries_cff.py b/FastSimulation/Configuration/python/Geometries_cff.py index 58f9d2cdbaba9..bd0ba7f0bc9be 100644 --- a/FastSimulation/Configuration/python/Geometries_cff.py +++ b/FastSimulation/Configuration/python/Geometries_cff.py @@ -1,52 +1,47 @@ import FWCore.ParameterSet.Config as cms - -# The CMS Geometry files -# Pilot 2 geometry doesn't contain the preshower -#from Configuration.StandardSequences.GeometryPilot2_cff import * - -# To use the "full" CMS geometry, comment the prevous line, and uncomment the following one: -#####from Configuration.StandardSequences.Geometry_cff import * -#from Configuration.StandardSequences.GeometryDB_cff import * -from Configuration.Geometry.GeometryExtendedRun4D110_cff import * -from Configuration.Geometry.GeometryExtendedRun4D110Reco_cff import * - -# The tracker geometry left-over (for aligned/misaligned geometry) -# The goemetry used for reconstruction must not be misaligned. -trackerGeometry.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedTrackerGeometry = Geometry.TrackerGeometryBuilder.trackerGeometry_cfi.trackerGeometry.clone() -# The misalignment is not applied by default -misalignedTrackerGeometry.applyAlignment = False -# Label of the produced TrackerGeometry: -misalignedTrackerGeometry.appendToDataLabel = 'MisAligned' - -# The DT geometry left-over (for aligned/misaligned geometry) -# The geometry used for reconstruction must not be misaligned. -DTGeometryESModule.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedDTGeometry = Geometry.DTGeometryBuilder.dtGeometry_cfi.DTGeometryESModule.clone() -# The misalignment is not applied by default -misalignedDTGeometry.applyAlignment = False -# Label of the produced DTGeometry: -misalignedDTGeometry.appendToDataLabel = 'MisAligned' - -# The CSC geometry left-over (for aligned/misaligned geometry) -# The geometry used for reconstruction must not be misaligned. -CSCGeometryESModule.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedCSCGeometry = Geometry.CSCGeometryBuilder.cscGeometry_cfi.CSCGeometryESModule.clone() -# The misalignment is not applied by default -misalignedCSCGeometry.applyAlignment = False -# Label of the produced CSCGeometry: -misalignedCSCGeometry.appendToDataLabel = 'MisAligned' - - - -# Reconstruction and Interaction tracker geometries -from FastSimulation.Configuration.TrackerRecoGeometryESProducer_cfi import * - -# The Calo geometry service model left-over -from Geometry.CaloEventSetup.CaloTopology_cfi import * - -# The muon geometry left-over -from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import * +from Geometry.TrackerGeometryBuilder.trackerGeometry_cfi import trackerGeometry as _trackerGeometry +from Geometry.DTGeometryBuilder.dtGeometry_cfi import DTGeometryESModule as _DTGeometryESModule +from Geometry.CSCGeometryBuilder.cscGeometry_cfi import CSCGeometryESModule as _CSCGeometryESModule + +def _fastSimGeometryCustoms(process): + # The tracker geometry left-over (for aligned/misaligned geometry) + # The goemetry used for reconstruction must not be misaligned. + process.trackerGeometry.applyAlignment = False + # Create a misaligned geometry for simulation + process.misalignedTrackerGeometry = _trackerGeometry.clone() + # The misalignment is not applied by default + process.misalignedTrackerGeometry.applyAlignment = False + # Label of the produced TrackerGeometry: + process.misalignedTrackerGeometry.appendToDataLabel = 'MisAligned' + + # The DT geometry left-over (for aligned/misaligned geometry) + # The geometry used for reconstruction must not be misaligned. + process.DTGeometryESModule.applyAlignment = False + # Create a misaligned geometry for simulation + process.misalignedDTGeometry = _DTGeometryESModule.clone() + # The misalignment is not applied by default + process.misalignedDTGeometry.applyAlignment = False + # Label of the produced DTGeometry: + process.misalignedDTGeometry.appendToDataLabel = 'MisAligned' + + # The CSC geometry left-over (for aligned/misaligned geometry) + # The geometry used for reconstruction must not be misaligned. + process.CSCGeometryESModule.applyAlignment = False + # Create a misaligned geometry for simulation + process.misalignedCSCGeometry = _CSCGeometryESModule.clone() + # The misalignment is not applied by default + process.misalignedCSCGeometry.applyAlignment = False + # Label of the produced CSCGeometry: + process.misalignedCSCGeometry.appendToDataLabel = 'MisAligned' + + # Reconstruction and Interaction tracker geometries + process.load("FastSimulation.Configuration.TrackerRecoGeometryESProducer_cfi") + + # The Calo geometry service model left-over + process.load("Geometry.CaloEventSetup.CaloTopology_cfi") + + # The muon geometry left-over + process.load("RecoMuon.DetLayers.muonDetLayerGeometry_cfi") + +from Configuration.Eras.Modifier_fastSim_cff import fastSim +modifyGeom_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustoms) From 3c83c931f7178af583dc03abf753b82302c40b27 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 13 Mar 2026 13:36:19 -0500 Subject: [PATCH 22/34] streamline fastsim geometry customizations --- Configuration/Applications/python/ConfigBuilder.py | 4 ++-- .../Configuration/python/Geometries_MC_cff.py | 10 ---------- .../Configuration/python/Geometries_START_cff.py | 9 --------- FastSimulation/Configuration/python/Geometries_cff.py | 11 +++++++++++ 4 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 FastSimulation/Configuration/python/Geometries_MC_cff.py delete mode 100644 FastSimulation/Configuration/python/Geometries_START_cff.py diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index 208f8b489c63e..ebcda15c2a84f 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1237,9 +1237,9 @@ def inGeometryKeys(opt): self.GeometryCFF = [self.GeometryCFF] self.GeometryCFF.append('FastSimulation/Configuration/Geometries_cff') - self.GeometryCFF.append('FastSimulation/Configuration/Geometries_MC_cff') if 'start' in self._options.conditions.lower(): - self.GeometryCFF.append('FastSimulation/Configuration/Geometries_START_cff') + from FastSimulation.Configuration.Geometries_cff import _fastSimGeometryCustomStart + self.executeAndRemember(_fastSimGeometryCustomStart) self.SIMDefaultCFF = 'FastSimulation.Configuration.SimIdeal_cff' self.RECODefaultCFF= 'FastSimulation.Configuration.Reconstruction_AftMix_cff' diff --git a/FastSimulation/Configuration/python/Geometries_MC_cff.py b/FastSimulation/Configuration/python/Geometries_MC_cff.py deleted file mode 100644 index 7cbb23dc0ed29..0000000000000 --- a/FastSimulation/Configuration/python/Geometries_MC_cff.py +++ /dev/null @@ -1,10 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -def _fastSimGeometryCustomsMC(process): - # Apply Tracker and Muon misalignment - process.misalignedTrackerGeometry.applyAlignment = True - process.misalignedDTGeometry.applyAlignment = True - process.misalignedCSCGeometry.applyAlignment = True - -from Configuration.Eras.Modifier_fastSim_cff import fastSim -modifyGeomMC_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsMC) diff --git a/FastSimulation/Configuration/python/Geometries_START_cff.py b/FastSimulation/Configuration/python/Geometries_START_cff.py deleted file mode 100644 index ff931efc16913..0000000000000 --- a/FastSimulation/Configuration/python/Geometries_START_cff.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# Apply Tracker and Muon misalignment -def _fastSimGeometryCustomsStart(process): - process.fastSimProducer.detectorDefinition.trackerAlignmentLabel = cms.untracked.string("") - -from Configuration.Eras.Modifier_fastSim_cff import fastSim -modifyGeomStart_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsStart) - diff --git a/FastSimulation/Configuration/python/Geometries_cff.py b/FastSimulation/Configuration/python/Geometries_cff.py index bd0ba7f0bc9be..6af029bce4f8e 100644 --- a/FastSimulation/Configuration/python/Geometries_cff.py +++ b/FastSimulation/Configuration/python/Geometries_cff.py @@ -43,5 +43,16 @@ def _fastSimGeometryCustoms(process): # The muon geometry left-over process.load("RecoMuon.DetLayers.muonDetLayerGeometry_cfi") + # These used to be applied in separate Geometries_MC_cff and Geometries_START_cff files + # Since those are the only FastSim variants ever used/exposed through cmsDriver, + # just include these settings here as default + # Apply Tracker and Muon misalignment + process.misalignedTrackerGeometry.applyAlignment = True + process.misalignedDTGeometry.applyAlignment = True + process.misalignedCSCGeometry.applyAlignment = True + from Configuration.Eras.Modifier_fastSim_cff import fastSim modifyGeom_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustoms) + +# now executed directly in cmsDriver.py instead of separate Geometries_START_cff file +_fastSimGeometryCustomStart = 'process.fastSimProducer.detectorDefinition.trackerAlignmentLabel = cms.untracked.string("")' From c560eb6e2fb3f8ea3c2d2be043e6271d39daa016 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 13 Mar 2026 13:53:46 -0500 Subject: [PATCH 23/34] use real paths --- .../python/PixelPluginsPhase2_cfi.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 7ff89317ad7c5..a77ff7f0923bc 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -11,9 +11,9 @@ name = cms.string("pixelBarrelSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32(-1), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), - BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), - EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_barrel_v2.root'), + RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_barrel_v2.root'), + BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_barrel_v2.root'), + EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_barrel_v2.root'), MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bmergeprob.root'), MergedPixelResolutionXFile = cms.string('FastSimulation/TrackingRecHitProducer/data/bxsmear.root'), @@ -28,9 +28,9 @@ name = cms.string("pixelForwardSmearer"), type = cms.string("PixelTemplateSmearerPlugin"), templateId = cms.int32(-1), - RegularPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), - BigPixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), - EdgePixelResolutionFile = cms.string('pixelhistos/3-18-25_forward_v2.root'), + RegularPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_forward_v2.root'), + BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_forward_v2.root'), + EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/3-18-25_forward_v2.root'), MergeHitsOn = cms.bool(False), MergingProbabilityFile = cms.string('FastSimulation/TrackingRecHitProducer/data/fmergeprob.root'), MergedPixelResolutionXFile = cms.string('FastSimulation/TrackingRecHitProducer/data/fxsmear.root'), From b7630e91ff74a7b57882269dc252d0db1f223eaa Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 13 Mar 2026 17:32:05 -0500 Subject: [PATCH 24/34] add fastsim phase2 (tracker-only) matrix workflow --- .../PyReleaseValidation/python/relval_Run4.py | 3 +++ .../PyReleaseValidation/python/relval_steps.py | 18 ++++++++++++++++++ .../python/upgradeWorkflowComponents.py | 18 +++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/Configuration/PyReleaseValidation/python/relval_Run4.py b/Configuration/PyReleaseValidation/python/relval_Run4.py index 994a9a2c9dc15..198659a5b6487 100644 --- a/Configuration/PyReleaseValidation/python/relval_Run4.py +++ b/Configuration/PyReleaseValidation/python/relval_Run4.py @@ -29,6 +29,9 @@ numWFIB.extend([35634.0]) #Run4D124 numWFIB.extend([36034.0]) #Run4D125 +#Run4 FS (TTbar) +numWFIB.extend([36434.0]) + #Additional sample for short matrix and IB #Default Phase-2 Det NoPU numWFIB.extend([prefixDet+34.911]) #DD4hep XML diff --git a/Configuration/PyReleaseValidation/python/relval_steps.py b/Configuration/PyReleaseValidation/python/relval_steps.py index bbda0d263fce8..6c897bfa87201 100644 --- a/Configuration/PyReleaseValidation/python/relval_steps.py +++ b/Configuration/PyReleaseValidation/python/relval_steps.py @@ -5184,6 +5184,24 @@ def gen2024HiMix(fragment,howMuch): '--geometry' : geom, } + upgradeStepDict['FastSimRun4'][k]={'-s':'SIM,RECOBEFMIX,DIGI:pdigi_valid,DIGI2RAW,RECO:reconstruction_trackingOnly,VALIDATION:@trackingOnlyValidation', + '--fast':'', + '--beamspot':beamspot, + '--conditions':gt, + '--geometry':geom, + '--eventcontent':'RECOSIM,DQM', + '--datatier':'GEN-SIM-RECO,DQMIO', + } + + upgradeStepDict['HARVESTFastRun4'][k]={'-s':'HARVESTING:@trackingOnlyValidation', + '--conditions':gt, + '--mc':'', + '--fast':'', + '--geometry':geom, + '--scenario':'pp', + '--filetype':'DQM', + '--filein':'file:step2_inDQM.root'} + # setup baseline and variations for specialType,specialWF in upgradeWFs.items(): specialWF.setup(upgradeStepDict, k, upgradeProperties[year][k]) diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 857cdef447b26..79af7c4e1ed50 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -94,6 +94,8 @@ 'Run4D124PU', 'Run4D125', 'Run4D125PU', + 'Run4D110FS', + 'Run4D110FSPU', ] # pre-generation of WF numbers @@ -237,6 +239,8 @@ def condition(self, fragment, stepList, key, hasHarvest): 'HLT75e33', 'FastSimRun3', 'HARVESTFastRun3', + 'FastSimRun4', + 'HARVESTFastRun4', ], PU = [ 'DigiTrigger', @@ -261,6 +265,8 @@ def condition(self, fragment, stepList, key, hasHarvest): 'HLT75e33', 'FastSimRun3', 'HARVESTFastRun3', + 'FastSimRun4', + 'HARVESTFastRun4', ], suffix = '', offset = 0.0, @@ -3750,6 +3756,13 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C22I13M9', 'ScenToRun' : ['GenSimHLBeamSpot','DigiTrigger','RecoGlobal', 'HARVESTGlobal', 'ALCAPhase2'], }, + 'Run4D110FS' : { + 'Geom' : 'ExtendedRun4D110', + 'HLTmenu': '@relvalRun4', + 'GT' : 'auto:phase2_realistic_T35', + 'Era' : 'Phase2C17I13M9_FastSim', + 'ScenToRun' : ['GenHLBeamSpot','FastSimRun4','HARVESTFastRun4'], + }, } # standard PU sequences @@ -3757,7 +3770,10 @@ def condition(self, fragment, stepList, key, hasHarvest): if "GenOnly" in key: continue upgradeProperties['Run4'][key+'PU'] = deepcopy(upgradeProperties['Run4'][key]) - upgradeProperties['Run4'][key+'PU']['ScenToRun'] = ['GenSimHLBeamSpot','DigiTriggerPU','RecoGlobalPU', 'HARVESTGlobalPU'] + if 'FS' not in key: + upgradeProperties['Run4'][key+'PU']['ScenToRun'] = ['GenSimHLBeamSpot','DigiTriggerPU','RecoGlobalPU', 'HARVESTGlobalPU'] + else: + upgradeProperties['Run4'][key+'PU']['ScenToRun'] = ['GenHLBeamSpot','FastSimRun4PU','HARVESTFastRun4PU'] # for relvals defaultDataSets = {} From 70645bd640880d3e9b9dcad42d553116ef6d54f1 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 13 Mar 2026 18:08:48 -0500 Subject: [PATCH 25/34] modifier for phase2-specific fastSim changes --- Configuration/Eras/python/Modifier_phase2_fastSim_cff.py | 4 ++++ Configuration/Eras/python/Util_fastSimPhase2_cff.py | 6 +++++- .../python/fastSimProducer_cff.py | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Configuration/Eras/python/Modifier_phase2_fastSim_cff.py diff --git a/Configuration/Eras/python/Modifier_phase2_fastSim_cff.py b/Configuration/Eras/python/Modifier_phase2_fastSim_cff.py new file mode 100644 index 0000000000000..72abe18103c66 --- /dev/null +++ b/Configuration/Eras/python/Modifier_phase2_fastSim_cff.py @@ -0,0 +1,4 @@ +import FWCore.ParameterSet.Config as cms + +phase2_fastSim = cms.Modifier() + diff --git a/Configuration/Eras/python/Util_fastSimPhase2_cff.py b/Configuration/Eras/python/Util_fastSimPhase2_cff.py index d06fd853ceccc..1cc332cbc12a1 100644 --- a/Configuration/Eras/python/Util_fastSimPhase2_cff.py +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -7,6 +7,10 @@ from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer from Configuration.Eras.Modifier_phase2_trigger_cff import phase2_trigger from Configuration.Eras.ModifierChain_trackingMkFitProd_cff import trackingMkFitProdPhase2 +from Configuration.Eras.Modifier_phase2_fastSim_cff import phase2_fastSim def fastSimPhase2(obj): - return obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]) + return cms.ModifierChain( + obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]), + phase2_fastSim, + ) diff --git a/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py b/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py index 552da9d379d2a..5b2cd74f6f447 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py +++ b/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py @@ -11,7 +11,7 @@ src = cms.InputTag("generatorSmeared"), particleFilter = ParticleFilterBlock.ParticleFilter, trackerDefinition = TrackerMaterialBlock.TrackerMaterial, - simulateCalorimetry = cms.bool(False), + simulateCalorimetry = cms.bool(True), simulateMuons = cms.bool(True), useFastSimDecayer = cms.bool(False), verboseDecayer = cms.bool(False), @@ -81,3 +81,6 @@ MaterialEffectsForMuonsInHCAL = MaterialEffectsForMuonsInHCALBlock.MaterialEffectsForMuonsInHCAL, GFlash = FamosCalorimetryBlock.GFlash, ) + +from Configuration.Eras.Modifier_phase2_fastSim_cff import phase2_fastSim +phase2_fastSim.toModify(fastSimProducer, simulateCalorimetry = False) From 78be03a8c3db8a5185713cc7ebebcb1b6098f486 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 13 Mar 2026 19:13:52 -0500 Subject: [PATCH 26/34] support both DB and XML geometry for FastSim --- Configuration/Applications/python/ConfigBuilder.py | 5 ++++- FastSimulation/Configuration/python/Geometries_cff.py | 10 ++-------- FastSimulation/Configuration/python/GeometryDB_cff.py | 11 +++++++++++ .../Configuration/python/GeometryXML_cff.py | 11 +++++++++++ 4 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 FastSimulation/Configuration/python/GeometryDB_cff.py create mode 100644 FastSimulation/Configuration/python/GeometryXML_cff.py diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index ebcda15c2a84f..dd142fada57ee 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1236,7 +1236,10 @@ def inGeometryKeys(opt): self.GeometryCFF = self.GeometryCFF.replace("_cff","Reco_cff") self.GeometryCFF = [self.GeometryCFF] - self.GeometryCFF.append('FastSimulation/Configuration/Geometries_cff') + if 'DB' in self.GeometryCFF[0]: + self.GeometryCFF.append('FastSimulation/Configuration/GeometryDB_cff') + else: + self.GeometryCFF.append('FastSimulation/Configuration/GeometryXML_cff') if 'start' in self._options.conditions.lower(): from FastSimulation.Configuration.Geometries_cff import _fastSimGeometryCustomStart self.executeAndRemember(_fastSimGeometryCustomStart) diff --git a/FastSimulation/Configuration/python/Geometries_cff.py b/FastSimulation/Configuration/python/Geometries_cff.py index 6af029bce4f8e..c6ba8270b60c6 100644 --- a/FastSimulation/Configuration/python/Geometries_cff.py +++ b/FastSimulation/Configuration/python/Geometries_cff.py @@ -1,12 +1,9 @@ import FWCore.ParameterSet.Config as cms -from Geometry.TrackerGeometryBuilder.trackerGeometry_cfi import trackerGeometry as _trackerGeometry -from Geometry.DTGeometryBuilder.dtGeometry_cfi import DTGeometryESModule as _DTGeometryESModule -from Geometry.CSCGeometryBuilder.cscGeometry_cfi import CSCGeometryESModule as _CSCGeometryESModule -def _fastSimGeometryCustoms(process): +def _fastSimGeometryCustoms(process, _trackerGeometry, _DTGeometryESModule, _CSCGeometryESModule, suff=''): # The tracker geometry left-over (for aligned/misaligned geometry) # The goemetry used for reconstruction must not be misaligned. - process.trackerGeometry.applyAlignment = False + getattr(process,'trackerGeometry'+suff).applyAlignment = False # Create a misaligned geometry for simulation process.misalignedTrackerGeometry = _trackerGeometry.clone() # The misalignment is not applied by default @@ -51,8 +48,5 @@ def _fastSimGeometryCustoms(process): process.misalignedDTGeometry.applyAlignment = True process.misalignedCSCGeometry.applyAlignment = True -from Configuration.Eras.Modifier_fastSim_cff import fastSim -modifyGeom_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustoms) - # now executed directly in cmsDriver.py instead of separate Geometries_START_cff file _fastSimGeometryCustomStart = 'process.fastSimProducer.detectorDefinition.trackerAlignmentLabel = cms.untracked.string("")' diff --git a/FastSimulation/Configuration/python/GeometryDB_cff.py b/FastSimulation/Configuration/python/GeometryDB_cff.py new file mode 100644 index 0000000000000..5bb0ee26a2d3d --- /dev/null +++ b/FastSimulation/Configuration/python/GeometryDB_cff.py @@ -0,0 +1,11 @@ +import FWCore.ParameterSet.Config as cms +from FastSimulation.Configuration.Geometries_cff import _fastSimGeometryCustoms +from Geometry.TrackerGeometryBuilder.trackerGeometryDB_cfi import trackerGeometryDB as _trackerGeometry +from Geometry.DTGeometryBuilder.dtGeometryDB_cfi import DTGeometryESModule as _DTGeometryESModule +from Geometry.CSCGeometryBuilder.cscGeometryDB_cfi import CSCGeometryESModule as _CSCGeometryESModule + +def _fastSimGeometryCustomsDB(process): + _fastSimGeometryCustoms(process, _trackerGeometry, _DTGeometryESModule, _CSCGeometryESModule, 'DB') + +from Configuration.Eras.Modifier_fastSim_cff import fastSim +modifyGeomDB_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsDB) diff --git a/FastSimulation/Configuration/python/GeometryXML_cff.py b/FastSimulation/Configuration/python/GeometryXML_cff.py new file mode 100644 index 0000000000000..9c788b4393cda --- /dev/null +++ b/FastSimulation/Configuration/python/GeometryXML_cff.py @@ -0,0 +1,11 @@ +import FWCore.ParameterSet.Config as cms +from FastSimulation.Configuration.Geometries_cff import _fastSimGeometryCustoms +from Geometry.TrackerGeometryBuilder.trackerGeometry_cfi import trackerGeometry as _trackerGeometry +from Geometry.DTGeometryBuilder.dtGeometry_cfi import DTGeometryESModule as _DTGeometryESModule +from Geometry.CSCGeometryBuilder.cscGeometry_cfi import CSCGeometryESModule as _CSCGeometryESModule + +def _fastSimGeometryCustomsXML(process): + _fastSimGeometryCustoms(process, _trackerGeometry, _DTGeometryESModule, _CSCGeometryESModule) + +from Configuration.Eras.Modifier_fastSim_cff import fastSim +modifyGeomXML_fastSim = fastSim.makeProcessModifier(_fastSimGeometryCustomsXML) From 8705a7cea49463d16daf3792d3c230b42dcbe5a8 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 09:49:56 -0500 Subject: [PATCH 27/34] remove the ugly hack --- .../Configuration/python/DigiAliases_cff.py | 15 ++------------- .../python/MergeTrackCollections_cff.py | 7 ++++++- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/FastSimulation/Configuration/python/DigiAliases_cff.py b/FastSimulation/Configuration/python/DigiAliases_cff.py index 5fb2d07c0c86e..64f0770ef731b 100644 --- a/FastSimulation/Configuration/python/DigiAliases_cff.py +++ b/FastSimulation/Configuration/python/DigiAliases_cff.py @@ -1,16 +1,7 @@ import FWCore.ParameterSet.Config as cms -# This is an ugly hack (but better what was before) to record if the -# loadDigiAliases() was called with premixing or not. Unfortunately -# which alias to use depends on that. If we had a premixing Modifier, -# this hack would not be needed. -_loadDigiAliasesWasCalledPremix = None - -def loadGeneralTracksAlias(process): - if _loadDigiAliasesWasCalledPremix is None: - raise Exception("This function may be called only after loadDigiAliases() has been called") - - nopremix = not _loadDigiAliasesWasCalledPremix +def loadGeneralTracksAlias(process, premix=False): + nopremix = not premix process.generalTracks = cms.EDAlias( **{"mix" if nopremix else "mixData" : cms.VPSet( @@ -35,8 +26,6 @@ def loadGeneralTracksAlias(process): def loadDigiAliases(process, premix=False): nopremix = not premix - global _loadDigiAliasesWasCalledPremix - _loadDigiAliasesWasCalledPremix = premix process.ecalPreshowerDigis = cms.EDAlias( **{"simEcalPreshowerDigis" if nopremix else "DMEcalPreshowerDigis" : diff --git a/RecoTracker/FinalTrackSelectors/python/MergeTrackCollections_cff.py b/RecoTracker/FinalTrackSelectors/python/MergeTrackCollections_cff.py index d5256c19a1756..7261ebb168f50 100644 --- a/RecoTracker/FinalTrackSelectors/python/MergeTrackCollections_cff.py +++ b/RecoTracker/FinalTrackSelectors/python/MergeTrackCollections_cff.py @@ -66,10 +66,15 @@ duplicateTrackClassifier) ) +from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 def _fastSimGeneralTracks(process): from FastSimulation.Configuration.DigiAliases_cff import loadGeneralTracksAlias loadGeneralTracksAlias(process) -modifyMergeTrackCollections_fastSimGeneralTracks = fastSim.makeProcessModifier( _fastSimGeneralTracks ) +modifyMergeTrackCollections_fastSimGeneralTracks = (fastSim & ~premix_stage2).makeProcessModifier( _fastSimGeneralTracks ) +def _fastSimGeneralTracksPremix(process): + from FastSimulation.Configuration.DigiAliases_cff import loadGeneralTracksAlias + loadGeneralTracksAlias(process, premix=True) +modifyMergeTrackCollections_fastSimGeneralTracksPremix = (fastSim & premix_stage2).makeProcessModifier( _fastSimGeneralTracksPremix ) import RecoTracker.FinalTrackSelectors.trackListMerger_cfi conversionStepTracks = RecoTracker.FinalTrackSelectors.trackListMerger_cfi.trackListMerger.clone( From 53d12ac16b9e0b708302f5275222c91ba42711f6 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 10:12:56 -0500 Subject: [PATCH 28/34] separate out HGCal aliases --- .../StandardSequences/python/Digi_cff.py | 7 ++- .../Configuration/python/DigiAliases_cff.py | 45 +++++++++---------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/Configuration/StandardSequences/python/Digi_cff.py b/Configuration/StandardSequences/python/Digi_cff.py index b8809714ebbd1..ad5a7092bdff9 100644 --- a/Configuration/StandardSequences/python/Digi_cff.py +++ b/Configuration/StandardSequences/python/Digi_cff.py @@ -67,8 +67,6 @@ def _premixStage2GenPUProtons(process): from Configuration.Eras.Modifier_fastSim_cff import fastSim def _fastSimDigis(process): - import FastSimulation.Configuration.DigiAliases_cff as DigiAliases - # pretend these digis have been through digi2raw and raw2digi, by using the approprate aliases # use an alias to make the mixed track collection available under the usual label from FastSimulation.Configuration.DigiAliases_cff import loadDigiAliases @@ -76,6 +74,11 @@ def _fastSimDigis(process): # no need for the aliases for premixing stage1 modifyDigi_fastSimDigis = (fastSim & ~premix_stage1).makeProcessModifier(_fastSimDigis) +from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal +def _fastSimDigisHGCal(process): + from FastSimulation.Configuration.DigiAliases_cff import loadDigiAliasesHGCal +modifyDigi_fastSimDigisHGCal = (fastSim & phase2_hgcal).makeProcessModifier(_fastSimDigisHGCal) + #phase 2 common mods def _modifyEnableHcalHardcode( theProcess ): from CalibCalorimetry.HcalPlugins.Hcal_Conditions_forGlobalTag_cff import hcal_db_producer as _hcal_db_producer, es_hardcode as _es_hardcode, es_prefer_hcalHardcode as _es_prefer_hcalHardcode diff --git a/FastSimulation/Configuration/python/DigiAliases_cff.py b/FastSimulation/Configuration/python/DigiAliases_cff.py index 64f0770ef731b..32c58040df066 100644 --- a/FastSimulation/Configuration/python/DigiAliases_cff.py +++ b/FastSimulation/Configuration/python/DigiAliases_cff.py @@ -87,28 +87,6 @@ def loadDigiAliases(process, premix=False): } ) - - process.hgcalDigis = cms.EDAlias( - mix = cms.VPSet( - cms.PSet( - fromProductInstance = cms.string('HGCDigisEE'), - toProductInstance = cms.string('EE'), - type = cms.string('DetIdHGCSampleHGCDataFramesSorted') - ), - cms.PSet( - fromProductInstance = cms.string('HGCDigisHEfront'), - toProductInstance = cms.string('HEfront'), - type = cms.string('DetIdHGCSampleHGCDataFramesSorted') - ), - cms.PSet( - fromProductInstance = cms.string('HGCDigisHEback'), - toProductInstance = cms.string('HEback'), - type = cms.string('DetIdHGCSampleHGCDataFramesSorted') - ) - ) - ) - - process.muonDTDigis = cms.EDAlias( simMuonDTDigis = cms.VPSet( cms.PSet( @@ -146,7 +124,28 @@ def loadDigiAliases(process, premix=False): # ), ) ) - + +def loadDigiAliasesHGCal(process): + process.hgcalDigis = cms.EDAlias( + mix = cms.VPSet( + cms.PSet( + fromProductInstance = cms.string('HGCDigisEE'), + toProductInstance = cms.string('EE'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ), + cms.PSet( + fromProductInstance = cms.string('HGCDigisHEfront'), + toProductInstance = cms.string('HEfront'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ), + cms.PSet( + fromProductInstance = cms.string('HGCDigisHEback'), + toProductInstance = cms.string('HEback'), + type = cms.string('DetIdHGCSampleHGCDataFramesSorted') + ) + ) + ) + def loadTriggerDigiAliases(process): process.caloStage1LegacyFormatDigis = cms.EDAlias( **{ "simCaloStage1LegacyFormatDigis" : From 1537755a6a295135f703964e71a38ae11cb34fa1 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 11:46:13 -0500 Subject: [PATCH 29/34] use correct geometry DB cff for fastsim --- Configuration/Applications/python/ConfigBuilder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index dd142fada57ee..e1a49746d2188 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -1231,9 +1231,11 @@ def inGeometryKeys(opt): # fastsim requires some changes to the default cff files and sequences if self._options.fast: - # always use reco geometry + # always use reco geometry for xml (includes sim components) if 'Reco' not in self.GeometryCFF and 'DB' not in self.GeometryCFF: self.GeometryCFF = self.GeometryCFF.replace("_cff","Reco_cff") + if 'DB' in self.GeometryCFF: + self.GeometryCFF = 'Configuration/StandardSequences/GeometryDB_cff' self.GeometryCFF = [self.GeometryCFF] if 'DB' in self.GeometryCFF[0]: From bf6da849b4d4101c13efab092500cf9e3ba1abe5 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 13:13:08 -0500 Subject: [PATCH 30/34] isolate phase 2 tracking changes --- .../python/DetachedQuadStep_cff.py | 20 ++++++++++--------- .../python/HighPtTripletStep_cff.py | 19 ++++++++++-------- .../python/InitialStep_cff.py | 5 ++++- .../python/LowPtQuadStep_cff.py | 19 ++++++++++-------- .../python/LowPtTripletStep_cff.py | 19 ++++++++++-------- .../python/PixelPairStep_cff.py | 18 +++++++++-------- 6 files changed, 58 insertions(+), 42 deletions(-) diff --git a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py index 0fb95b48d629e..77bc721db035a 100644 --- a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py @@ -385,12 +385,14 @@ #fastsim from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover detachedQuadStepMasks = maskProducerFromClusterRemover(detachedQuadStepClusters) -fastSim.toReplaceWith(DetachedQuadStepTask, - cms.Task(detachedQuadStepMasks - ,detachedQuadStepTrackingRegions - ,detachedQuadStepSeeds - ,detachedQuadStepTrackCandidates - ,detachedQuadStepTracks - ,detachedQuadStepSelector - ,detachedQuadStep - ) ) +_DetachedQuadStepTask_fastSim = cms.Task(detachedQuadStepMasks + ,detachedQuadStepTrackingRegions + ,detachedQuadStepSeeds + ,detachedQuadStepTrackCandidates + ,detachedQuadStepTracks + ,detachedQuadStep +) +_DetachedQuadStepTask_fastSim_phase2 = _DetachedQuadStepTask_fastSim.copy() +_DetachedQuadStepTask_fastSim_phase2.replace(detachedQuadStep, cms.Task(detachedQuadStepSelector,detachedQuadStep)) +fastSim.toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(DetachedQuadStepTask, _DetachedQuadStepTask_fastSim_phase2) diff --git a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py index c31fcb57f7aea..49a3427f4ae3c 100644 --- a/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/HighPtTripletStep_cff.py @@ -472,11 +472,14 @@ # fast tracking mask producer from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover highPtTripletStepMasks = maskProducerFromClusterRemover(highPtTripletStepClusters) -fastSim.toReplaceWith(HighPtTripletStepTask, - cms.Task(highPtTripletStepMasks - ,highPtTripletStepTrackingRegions - ,highPtTripletStepSeeds - ,highPtTripletStepTrackCandidates - ,highPtTripletStepTracks - ,highPtTripletStepSelector - ) ) +_HighPtTripletStepTask_fastSim = cms.Task(highPtTripletStepMasks + ,highPtTripletStepTrackingRegions + ,highPtTripletStepSeeds + ,highPtTripletStepTrackCandidates + ,highPtTripletStepTracks + ,highPtTripletStep +) +_HighPtTripletStepTask_fastSim_phase2 = _HighPtTripletStepTask_fastSim.copy() +_HighPtTripletStepTask_fastSim_phase2.replace(highPtTripletStep, highPtTripletStepSelector) +fastSim.toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(HighPtTripletStepTask, _HighPtTripletStepTask_fastSim_phase2) diff --git a/RecoTracker/IterativeTracking/python/InitialStep_cff.py b/RecoTracker/IterativeTracking/python/InitialStep_cff.py index 505118365ee05..9093f4589feda 100644 --- a/RecoTracker/IterativeTracking/python/InitialStep_cff.py +++ b/RecoTracker/IterativeTracking/python/InitialStep_cff.py @@ -483,9 +483,12 @@ ,initialStepTracks ,firstStepPrimaryVerticesBeforeMixing ,initialStepClassifier1,initialStepClassifier2,initialStepClassifier3 - ,initialStepSelector + ,initialStep ) +_InitialStepTask_fastSim_Phase2 = _InitialStepTask_fastSim.copy() +_InitialStepTask_fastSim_Phase2.replace(initialStep, initialStepSelector) fastSim.toReplaceWith(InitialStepTask, _InitialStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(InitialStepTask, _InitialStepTask_fastSim_Phase2) ## ## Modify for the tau embedding methods reco sim step diff --git a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py index d540b8f34c217..4af1b02232f7c 100644 --- a/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtQuadStep_cff.py @@ -328,11 +328,14 @@ # fast tracking mask producer from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover lowPtQuadStepMasks = maskProducerFromClusterRemover(lowPtQuadStepClusters) -fastSim.toReplaceWith(LowPtQuadStepTask, - cms.Task(lowPtQuadStepMasks - ,lowPtQuadStepTrackingRegions - ,lowPtQuadStepSeeds - ,lowPtQuadStepTrackCandidates - ,lowPtQuadStepTracks - ,lowPtQuadStepSelector - ) ) +_LowPtQuadStepTask_fastSim = cms.Task(lowPtQuadStepMasks + ,lowPtQuadStepTrackingRegions + ,lowPtQuadStepSeeds + ,lowPtQuadStepTrackCandidates + ,lowPtQuadStepTracks + ,lowPtQuadStep +) +_LowPtQuadStepTask_fastSim_phase2 = _LowPtQuadStepTask_fastSim.copy() +_LowPtQuadStepTask_fastSim_phase2.replace(lowPtQuadStep, lowPtQuadStepSelector) +fastSim.toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(LowPtQuadStepTask, _LowPtQuadStepTask_fastSim_phase2) diff --git a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py index d8d36ef02e3cd..e84556006a5b7 100644 --- a/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py +++ b/RecoTracker/IterativeTracking/python/LowPtTripletStep_cff.py @@ -450,11 +450,14 @@ #fastsim from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover lowPtTripletStepMasks = maskProducerFromClusterRemover(lowPtTripletStepClusters) -fastSim.toReplaceWith(LowPtTripletStepTask, - cms.Task(lowPtTripletStepMasks - ,lowPtTripletStepTrackingRegions - ,lowPtTripletStepSeeds - ,lowPtTripletStepTrackCandidates - ,lowPtTripletStepTracks - ,lowPtTripletStepSelector - )) +_LowPtTripletStepTask_fastSim = cms.Task(lowPtTripletStepMasks + ,lowPtTripletStepTrackingRegions + ,lowPtTripletStepSeeds + ,lowPtTripletStepTrackCandidates + ,lowPtTripletStepTracks + ,lowPtTripletStep +) +_LowPtTripletStepTask_fastSim_phase2 = _LowPtTripletStepTask_fastSim.copy() +_LowPtTripletStepTask_fastSim_phase2.replace(lowPtTripletStep, lowPtTripletStepSelector) +fastSim.toReplaceWith(LowPtTripletStepTask, _LowPtTripletStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(LowPtTripletStepTask, _LowPtTripletStepTask_fastSim_phase2) diff --git a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py index c80c7adcd41c9..c5c8d413476b4 100644 --- a/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py +++ b/RecoTracker/IterativeTracking/python/PixelPairStep_cff.py @@ -497,12 +497,14 @@ #fastSim import FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi pixelPairStepMasks = FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi.maskProducerFromClusterRemover(pixelPairStepClusters) -fastSim.toReplaceWith(PixelPairStepTask, - cms.Task(pixelPairStepMasks - ,pixelPairStepTrackingRegions - ,pixelPairStepSeeds - ,pixelPairStepTrackCandidates - ,pixelPairStepTracks - ,pixelPairStepSelector - ) +_PixelPairStepTask_fastSim = cms.Task(pixelPairStepMasks + ,pixelPairStepTrackingRegions + ,pixelPairStepSeeds + ,pixelPairStepTrackCandidates + ,pixelPairStepTracks + ,pixelPairStep ) +_PixelPairStepTask_fastSim_phase2 = _PixelPairStepTask_fastSim.copy() +_PixelPairStepTask_fastSim_phase2.replace(pixelPairStep, pixelPairStepSelector) +fastSim.toReplaceWith(PixelPairStepTask, _PixelPairStepTask_fastSim) +(fastSim & trackingPhase2PU140).toReplaceWith(PixelPairStepTask, _PixelPairStepTask_fastSim_phase2) From 0cc4573dd6fb82648e6215477efcde4649906816 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 13:21:49 -0500 Subject: [PATCH 31/34] simplify era usage --- SimGeneral/MixingModule/python/aliases_cfi.py | 11 ++++------- SimGeneral/MixingModule/python/digitizers_cfi.py | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/SimGeneral/MixingModule/python/aliases_cfi.py b/SimGeneral/MixingModule/python/aliases_cfi.py index 39f8debdd0541..210d0762e9e07 100644 --- a/SimGeneral/MixingModule/python/aliases_cfi.py +++ b/SimGeneral/MixingModule/python/aliases_cfi.py @@ -81,8 +81,9 @@ ) ) +from Configuration.Eras.Modifier_fastSim_cff import fastSim from Configuration.Eras.Modifier_run3_common_cff import run3_common -run3_common.toModify(simCastorDigis, mix = None) +(run3_common | fastSim).toModify(simCastorDigis, mix = None) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal (~phase2_hgcal).toModify(simHGCalUnsuppressedDigis, mix = None) @@ -110,12 +111,8 @@ (phase1Pixel & runDependentForPixelVal).toModify(simSiPixelDigis, mix = _pixelCommon + [cms.PSet(type = cms.string('PixelSimHitExtraInfoedmDetSetVector'))] + [cms.PSet(type = cms.string('PixelSimHitExtraInfoLiteedmDetSetVector'))] + [cms.PSet(type = cms.string('PixelFEDChanneledmNewDetSetVector'))]) from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -phase2_tracker.toModify(simSiStripDigis, mix = None) -phase2_tracker.toModify(simAPVsaturation, mix = None) +(phase2_tracker | fastSim).toModify(simSiStripDigis, mix = None) +(phase2_tracker | fastSim).toModify(simAPVsaturation, mix = None) # no castor,pixel,strip digis in fastsim -from Configuration.Eras.Modifier_fastSim_cff import fastSim -(fastSim & ~run3_common).toModify(simCastorDigis, mix = None) fastSim.toModify(simSiPixelDigis, mix = None) -(fastSim & ~phase2_tracker).toModify(simSiStripDigis, mix = None) -(fastSim & ~phase2_tracker).toModify(simAPVsaturation, mix = None) diff --git a/SimGeneral/MixingModule/python/digitizers_cfi.py b/SimGeneral/MixingModule/python/digitizers_cfi.py index 8bd896305480a..1eab8689f8c4c 100644 --- a/SimGeneral/MixingModule/python/digitizers_cfi.py +++ b/SimGeneral/MixingModule/python/digitizers_cfi.py @@ -39,11 +39,8 @@ from Configuration.Eras.Modifier_fastSim_cff import fastSim fastSim.toModify(theDigitizers, - # fastsim does not model castor - castor = None, # fastsim does not digitize pixel and strip hits pixel = None, - strip = None, tracks = recoTrackAccumulator ) from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2 @@ -70,7 +67,8 @@ ) from Configuration.Eras.Modifier_run3_common_cff import run3_common -(run3_common & ~fastSim).toModify( theDigitizers, castor = None ) +# fastsim does not model castor +(run3_common | fastSim).toModify( theDigitizers, castor = None ) from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing @@ -111,7 +109,7 @@ ) from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker -(phase2_tracker& ~fastSim).toModify(theDigitizers, +(phase2_tracker | fastSim).toModify(theDigitizers, strip = None) theDigitizersValid = cms.PSet(theDigitizers) From df64564a096a6bc0b00924ae7ee5480a05ef5098 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 14:23:06 -0500 Subject: [PATCH 32/34] add fastsim D121 workflow --- Configuration/PyReleaseValidation/python/relval_Run4.py | 3 ++- .../python/upgradeWorkflowComponents.py | 9 +++++++++ Configuration/StandardSequences/python/Eras.py | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Configuration/PyReleaseValidation/python/relval_Run4.py b/Configuration/PyReleaseValidation/python/relval_Run4.py index 198659a5b6487..d322db4bea2e2 100644 --- a/Configuration/PyReleaseValidation/python/relval_Run4.py +++ b/Configuration/PyReleaseValidation/python/relval_Run4.py @@ -30,7 +30,8 @@ numWFIB.extend([36034.0]) #Run4D125 #Run4 FS (TTbar) -numWFIB.extend([36434.0]) +numWFIB.extend([36434.0]) #Run4D110 +numWFIB.extend([36834.0]) #Run4D121 #Additional sample for short matrix and IB #Default Phase-2 Det NoPU diff --git a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py index 79af7c4e1ed50..2b38849064410 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -96,6 +96,8 @@ 'Run4D125PU', 'Run4D110FS', 'Run4D110FSPU', + 'Run4D121FS', + 'Run4D121FSPU', ] # pre-generation of WF numbers @@ -3763,6 +3765,13 @@ def condition(self, fragment, stepList, key, hasHarvest): 'Era' : 'Phase2C17I13M9_FastSim', 'ScenToRun' : ['GenHLBeamSpot','FastSimRun4','HARVESTFastRun4'], }, + 'Run4D121FS' : { + 'Geom' : 'ExtendedRun4D121', + 'HLTmenu': '@relvalRun4', + 'GT' : 'auto:phase2_realistic_T35', + 'Era' : 'Phase2C22I13M9_FastSim', + 'ScenToRun' : ['GenHLBeamSpot','FastSimRun4','HARVESTFastRun4'], + }, } # standard PU sequences diff --git a/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index 209fce8facbba..697e972ae0a1a 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -101,6 +101,7 @@ def __init__(self): 'Phase2C20I13M9_noMkFit', 'Phase2C22I13M9', 'Phase2C22I13M9_noMkFit', + 'Phase2C22I13M9_FastSim', 'Phase2C26I13M9', 'Phase2C26I13M9_noMkFit' ] From 01ba11f5cfff90dce6e86de5e0242d6824d385ff Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Mon, 16 Mar 2026 14:25:00 -0500 Subject: [PATCH 33/34] code format --- RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc b/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc index eb8db13094029..e2ee2b132fc78 100644 --- a/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc +++ b/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc @@ -185,7 +185,9 @@ void MuonDetLayerMeasurements::checkDTRecHits() { if (cacheID == theDTEventCacheID) return; - { theEvent->getByToken(dtToken_, theDTRecHits); } + { + theEvent->getByToken(dtToken_, theDTRecHits); + } if (!theDTRecHits.isValid()) { throw cms::Exception("MuonDetLayerMeasurements") << "Cannot get DT RecHits"; } From 4b833057c7a875633eefb72bd6d18c3db72bd906 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Wed, 18 Mar 2026 20:02:55 -0500 Subject: [PATCH 34/34] forgot to commit new file --- Configuration/Eras/python/Era_Phase2C22I13M9_FastSim_cff.py | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Configuration/Eras/python/Era_Phase2C22I13M9_FastSim_cff.py diff --git a/Configuration/Eras/python/Era_Phase2C22I13M9_FastSim_cff.py b/Configuration/Eras/python/Era_Phase2C22I13M9_FastSim_cff.py new file mode 100644 index 0000000000000..66e8aed466bd4 --- /dev/null +++ b/Configuration/Eras/python/Era_Phase2C22I13M9_FastSim_cff.py @@ -0,0 +1,6 @@ +import FWCore.ParameterSet.Config as cms + +from Configuration.Eras.Era_Phase2C22I13M9_cff import Phase2C22I13M9 +from Configuration.Eras.Util_fastSimPhase2_cff import fastSimPhase2 + +Phase2C22I13M9_FastSim = fastSimPhase2(Phase2C22I13M9)