Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-04-06 03:11:21

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