Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:37

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # configuration to model pileup for initial physics phase
0004 from SimGeneral.MixingModule.aliases_cfi import *
0005 from SimGeneral.MixingModule.pixelDigitizer_cfi import *
0006 from SimGeneral.MixingModule.stripDigitizer_cfi import *
0007 from SimGeneral.MixingModule.ecalDigitizer_cfi import *
0008 from SimGeneral.MixingModule.hcalDigitizer_cfi import *
0009 from SimGeneral.MixingModule.castorDigitizer_cfi import *
0010 from SimGeneral.MixingModule.pileupVtxDigitizer_cfi import *
0011 from SimGeneral.MixingModule.trackingTruthProducerSelection_cfi import *
0012 from SimGeneral.MixingModule.caloTruthProducer_cfi import *
0013 from SimGeneral.MixingModule.mtdTruthProducer_cfi import *
0014 from FastSimulation.Tracking.recoTrackAccumulator_cfi import *
0015 
0016 theDigitizers = cms.PSet(
0017   pixel = cms.PSet(
0018     pixelDigitizer
0019   ),
0020   strip = cms.PSet(
0021     stripDigitizer
0022   ),
0023   ecal = cms.PSet(
0024     ecalDigitizer
0025   ),
0026   hcal = cms.PSet(
0027     hcalDigitizer
0028   ),
0029   castor = cms.PSet(
0030     castorDigitizer
0031   ),
0032   puVtx = cms.PSet(
0033     pileupVtxDigitizer
0034   ),
0035   mergedtruth = cms.PSet(
0036     trackingParticles
0037   )
0038 )
0039 
0040 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0041 fastSim.toModify(theDigitizers,
0042     # fastsim does not model castor
0043     castor = None,
0044     # fastsim does not digitize pixel and strip hits
0045     pixel = None,
0046     strip = None,
0047     tracks = recoTrackAccumulator
0048 )
0049 from Configuration.ProcessModifiers.premix_stage2_cff import premix_stage2
0050 (fastSim & premix_stage2).toModify(theDigitizers,
0051     tracks = None
0052 )
0053 
0054 
0055 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hgceeDigitizer, hgchebackDigitizer, hgchefrontDigitizer, HGCAL_noise_fC, HGCAL_noise_heback, HFNose_noise_fC, HGCAL_chargeCollectionEfficiencies, HGCAL_ileakParam_toUse, HGCAL_cceParams_toUse, HGCAL_noises
0056 
0057 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0058 phase2_hgcal.toModify( theDigitizers,
0059                        hgceeDigitizer = cms.PSet(hgceeDigitizer),
0060                        hgchebackDigitizer = cms.PSet(hgchebackDigitizer),
0061                        hgchefrontDigitizer = cms.PSet(hgchefrontDigitizer),
0062                        calotruth = cms.PSet(caloParticles), #HGCAL still needs calotruth for production mode
0063 )
0064 
0065 from SimCalorimetry.HGCalSimProducers.hgcalDigitizer_cfi import hfnoseDigitizer
0066 
0067 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
0068 phase2_hfnose.toModify( theDigitizers,
0069                         hfnoseDigitizer = cms.PSet(hfnoseDigitizer),
0070 )
0071 
0072 from Configuration.Eras.Modifier_run3_common_cff import run3_common
0073 (run3_common & ~fastSim).toModify( theDigitizers, castor = None )
0074 
0075 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
0076 from Configuration.Eras.Modifier_phase2_timing_cff import phase2_timing
0077 phase2_timing.toModify( theDigitizers,
0078                         ecalTime = ecalTimeDigitizer.clone() )
0079 
0080 from SimGeneral.MixingModule.ecalTimeDigitizer_cfi import ecalTimeDigitizer
0081 from Configuration.Eras.Modifier_run3_ecal_devel_cff import run3_ecal_devel
0082 run3_ecal_devel.toModify( theDigitizers,
0083                         ecalTime = ecalTimeDigitizer.clone() )
0084 
0085 from SimFastTiming.Configuration.SimFastTiming_cff import mtdDigitizer
0086 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0087 phase2_timing_layer.toModify( theDigitizers,
0088                               fastTimingLayer = mtdDigitizer.clone(),
0089                               MC_fastTimingLayer = mtdTruth.clone()
0090 )
0091 
0092 premix_stage2.toModify(theDigitizers,
0093     ecal = None,
0094     hcal = None,
0095 )
0096 (premix_stage2 & phase2_hgcal).toModify(theDigitizers,
0097     hgceeDigitizer = dict(premixStage1 = True),
0098     hgchebackDigitizer = dict(premixStage1 = True),
0099     hgchefrontDigitizer = dict(premixStage1 = True),
0100     calotruth = dict(premixStage1 = True), #HGCAL still needs calotruth for production mode
0101 )
0102 (premix_stage2 & phase2_hfnose).toModify(theDigitizers,
0103     hfnoseDigitizer = dict(premixStage1 = True),
0104 )
0105 (premix_stage2 & phase2_timing_layer).toModify(theDigitizers,
0106     fastTimingLayer = dict(
0107         barrelDigitizer = dict(premixStage1 = True),
0108         endcapDigitizer = dict(premixStage1 = True)
0109     ),
0110     MC_fastTimingLayer = dict(premixStage1 = True),
0111 )
0112 
0113 from Configuration.Eras.Modifier_phase2_tracker_cff import phase2_tracker
0114 phase2_tracker.toModify(theDigitizers,
0115                         strip = None)
0116 
0117 theDigitizersValid = cms.PSet(theDigitizers)
0118 theDigitizers.mergedtruth.select.signalOnlyTP = True
0119 
0120 from Configuration.ProcessModifiers.run3_ecalclustering_cff import run3_ecalclustering
0121 run3_ecalclustering.toModify( theDigitizersValid, 
0122                               calotruth = cms.PSet( caloParticles ) )
0123 
0124 phase2_timing.toModify( theDigitizersValid.mergedtruth,
0125                         createInitialVertexCollection = cms.bool(True) )
0126 
0127 from Configuration.ProcessModifiers.premix_stage1_cff import premix_stage1
0128 def _customizePremixStage1(mod):
0129     # To avoid this if-else structure we'd need an "_InverseModifier"
0130     # to customize pixel/strip for everything else than fastSim.
0131     if hasattr(mod, "pixel"):
0132         if hasattr(mod.pixel, "AlgorithmCommon"):
0133             mod.pixel.AlgorithmCommon.makeDigiSimLinks = True
0134         else:
0135             mod.pixel.makeDigiSimLinks = True
0136     if hasattr(mod, "strip"):
0137         mod.strip.makeDigiSimLinks = True
0138     mod.mergedtruth.select.signalOnlyTP = False
0139 premix_stage1.toModify(theDigitizersValid, _customizePremixStage1)
0140 
0141 def _loadPremixStage2Aliases(process):
0142     process.load("SimGeneral.MixingModule.aliases_PreMix_cfi")
0143 modifyDigitizers_loadPremixStage2Aliases = premix_stage2.makeProcessModifier(_loadPremixStage2Aliases)