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 diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index 83dc0655c033e..e1a49746d2188 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,21 @@ def inGeometryKeys(opt): # fastsim requires some changes to the default cff files and sequences if self._options.fast: + # 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]: + 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) + self.SIMDefaultCFF = 'FastSimulation.Configuration.SimIdeal_cff' self.RECODefaultCFF= 'FastSimulation.Configuration.Reconstruction_AftMix_cff' self.RECOBEFMIXDefaultCFF = 'FastSimulation.Configuration.Reconstruction_BefMix_cff' 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/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) 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 new file mode 100644 index 0000000000000..1cc332cbc12a1 --- /dev/null +++ b/Configuration/Eras/python/Util_fastSimPhase2_cff.py @@ -0,0 +1,16 @@ +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 +from Configuration.Eras.Modifier_phase2_fastSim_cff import phase2_fastSim + +def fastSimPhase2(obj): + return cms.ModifierChain( + obj.copyAndExclude([run3_GEM, phase2_muon, phase2_GEM, phase2_timing, phase2_timing_layer, phase2_trigger, trackingMkFitProdPhase2]), + phase2_fastSim, + ) diff --git a/Configuration/PyReleaseValidation/python/relval_Run4.py b/Configuration/PyReleaseValidation/python/relval_Run4.py index 994a9a2c9dc15..d322db4bea2e2 100644 --- a/Configuration/PyReleaseValidation/python/relval_Run4.py +++ b/Configuration/PyReleaseValidation/python/relval_Run4.py @@ -29,6 +29,10 @@ numWFIB.extend([35634.0]) #Run4D124 numWFIB.extend([36034.0]) #Run4D125 +#Run4 FS (TTbar) +numWFIB.extend([36434.0]) #Run4D110 +numWFIB.extend([36834.0]) #Run4D121 + #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..2b38849064410 100644 --- a/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py +++ b/Configuration/PyReleaseValidation/python/upgradeWorkflowComponents.py @@ -94,6 +94,10 @@ 'Run4D124PU', 'Run4D125', 'Run4D125PU', + 'Run4D110FS', + 'Run4D110FSPU', + 'Run4D121FS', + 'Run4D121FSPU', ] # pre-generation of WF numbers @@ -237,6 +241,8 @@ def condition(self, fragment, stepList, key, hasHarvest): 'HLT75e33', 'FastSimRun3', 'HARVESTFastRun3', + 'FastSimRun4', + 'HARVESTFastRun4', ], PU = [ 'DigiTrigger', @@ -261,6 +267,8 @@ def condition(self, fragment, stepList, key, hasHarvest): 'HLT75e33', 'FastSimRun3', 'HARVESTFastRun3', + 'FastSimRun4', + 'HARVESTFastRun4', ], suffix = '', offset = 0.0, @@ -3750,6 +3758,20 @@ 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'], + }, + 'Run4D121FS' : { + 'Geom' : 'ExtendedRun4D121', + 'HLTmenu': '@relvalRun4', + 'GT' : 'auto:phase2_realistic_T35', + 'Era' : 'Phase2C22I13M9_FastSim', + 'ScenToRun' : ['GenHLBeamSpot','FastSimRun4','HARVESTFastRun4'], + }, } # standard PU sequences @@ -3757,7 +3779,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 = {} 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/Configuration/StandardSequences/python/Eras.py b/Configuration/StandardSequences/python/Eras.py index fecb31d054dbc..697e972ae0a1a 100644 --- a/Configuration/StandardSequences/python/Eras.py +++ b/Configuration/StandardSequences/python/Eras.py @@ -96,10 +96,12 @@ def __init__(self): 'Phase2C11I13T26M9_noMkFit', 'Phase2C17I13M9', 'Phase2C17I13M9_noMkFit', + 'Phase2C17I13M9_FastSim', 'Phase2C20I13M9', 'Phase2C20I13M9_noMkFit', 'Phase2C22I13M9', 'Phase2C22I13M9_noMkFit', + 'Phase2C22I13M9_FastSim', 'Phase2C26I13M9', 'Phase2C26I13M9_noMkFit' ] diff --git a/Configuration/StandardSequences/python/Reconstruction_cff.py b/Configuration/StandardSequences/python/Reconstruction_cff.py index b38abb9aea9bd..0dfbe1086fe98 100644 --- a/Configuration/StandardSequences/python/Reconstruction_cff.py +++ b/Configuration/StandardSequences/python/Reconstruction_cff.py @@ -139,9 +139,16 @@ _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 = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask]) _fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator,caloTowerForTrk,firstStepPrimaryVerticesUnsorted,ak4CaloJetsForTrk,initialStepTrackRefsForJets,firstStepPrimaryVertices) + fastSim.toReplaceWith(globalrecoTask,_fastSim_globalrecoTask) from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal @@ -333,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 b520af65a4f23..32c58040df066 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" : @@ -135,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" : diff --git a/FastSimulation/Configuration/python/Geometries_MC_cff.py b/FastSimulation/Configuration/python/Geometries_MC_cff.py deleted file mode 100644 index 3e62b81c68f9f..0000000000000 --- a/FastSimulation/Configuration/python/Geometries_MC_cff.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from FastSimulation.Configuration.Geometries_cff import * - -# Apply Tracker and Muon misalignment -misalignedTrackerGeometry.applyAlignment = True -misalignedDTGeometry.applyAlignment = True -misalignedCSCGeometry.applyAlignment = True 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 deleted file mode 100644 index 7c6b4cf049dc0..0000000000000 --- a/FastSimulation/Configuration/python/Geometries_START_cff.py +++ /dev/null @@ -1,12 +0,0 @@ -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 - diff --git a/FastSimulation/Configuration/python/Geometries_cff.py b/FastSimulation/Configuration/python/Geometries_cff.py index 795e299cfbc6c..c6ba8270b60c6 100644 --- a/FastSimulation/Configuration/python/Geometries_cff.py +++ b/FastSimulation/Configuration/python/Geometries_cff.py @@ -1,51 +1,52 @@ 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 * - - -# The tracker geometry left-over (for aligned/misaligned geometry) -# The goemetry used for reconstruction must not be misaligned. -trackerGeometryDB.applyAlignment = False -# Create a misaligned geometry for simulation -misalignedTrackerGeometry = Geometry.TrackerGeometryBuilder.trackerGeometryDB_cfi.trackerGeometryDB.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.dtGeometryDB_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.cscGeometryDB_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 * +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. + getattr(process,'trackerGeometry'+suff).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") + + # 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 + +# 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) 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..5b2cd74f6f447 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py +++ b/FastSimulation/SimplifiedGeometryPropagator/python/fastSimProducer_cff.py @@ -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) diff --git a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc index fba74d0afde17..d2d5926c825fc 100644 --- a/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc +++ b/FastSimulation/SimplifiedGeometryPropagator/src/Geometry.cc @@ -135,7 +135,7 @@ Geometry::Geometry(const edm::ParameterSet& cfg, forwardLayers_[index]->setIndex(index); // check order if (index > 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/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/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py index 81c23ff62073a..a77ff7f0923bc 100644 --- a/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py +++ b/FastSimulation/TrackingRecHitProducer/python/PixelPluginsPhase2_cfi.py @@ -10,13 +10,10 @@ isBarrel = cms.bool(True), name = cms.string("pixelBarrelSmearer"), 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'), - ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), - ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), + templateId = cms.int32(-1), + 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'), @@ -30,13 +27,10 @@ isBarrel = cms.bool(False), name = cms.string("pixelForwardSmearer"), 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'), - ## BigPixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), - ## EdgePixelResolutionFile = cms.string('FastSimulation/TrackingRecHitProducer/data/BarrelEdge2017.root'), + templateId = cms.int32(-1), + 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'), diff --git a/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py b/FastSimulation/TrackingRecHitProducer/python/TrackingRecHitProducer_cfi.py index 05e5c9363facb..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={ @@ -37,8 +36,7 @@ "TID": { 1: cms.double(0.00262), 2: cms.double(0.00354), - 3: cms.double(0.00391) - }, + 3: cms.double(0.00391)}, "TOB": { 1: cms.double(0.00461), 2: cms.double(0.00458), @@ -69,3 +67,35 @@ select=cms.string("(subdetId=="+subdetId+") && (layer=="+str(trackerLayer)+")"), ) fastTrackerRecHits.plugins.append(pluginConfig) + +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/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc index 6560de3d19384..e1f24977fbb9d 100644 --- a/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc +++ b/FastSimulation/TrackingRecHitProducer/src/PixelResolutionHistograms.cc @@ -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, @@ -289,6 +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_; 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; } diff --git a/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc b/RecoMuon/MeasurementDet/src/MuonDetLayerMeasurements.cc index d6e37161e5c18..e2ee2b132fc78 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() {} @@ -198,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"; } 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( diff --git a/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py b/RecoTracker/IterativeTracking/python/DetachedQuadStep_cff.py index c3a8293228cc8..77bc721db035a 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 @@ -384,11 +385,14 @@ #fastsim from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover detachedQuadStepMasks = maskProducerFromClusterRemover(detachedQuadStepClusters) -fastSim.toReplaceWith(DetachedQuadStepTask, - cms.Task(detachedQuadStepMasks - ,detachedQuadStepTrackingRegions - ,detachedQuadStepSeeds - ,detachedQuadStepTrackCandidates - ,detachedQuadStepTracks - ,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 3fc8609645d8e..49a3427f4ae3c 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 )) @@ -470,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 - ,highPtTripletStep - ) ) +_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 7557ca44c240d..9093f4589feda 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 @@ -137,7 +138,6 @@ fastSim.toReplaceWith(initialStepSeeds,_fastSim_initialStepSeeds) - # building import TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff _initialStepTrajectoryFilterBase = TrackingTools.TrajectoryFiltering.TrajectoryFilter_cff.CkfBaseTrajectoryFilter_block.clone( @@ -429,7 +429,7 @@ ), #end of vpset ) #end of clone - +fastSim.toModify(initialStepSelector,vertices = "firstStepPrimaryVerticesBeforeMixing") # Final sequence InitialStepTask = cms.Task(initialStepSeedLayers, @@ -485,7 +485,10 @@ ,initialStepClassifier1,initialStepClassifier2,initialStepClassifier3 ,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 40a1161b15f13..4af1b02232f7c 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, @@ -327,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 - ,lowPtQuadStep - ) ) +_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 5c9db796bd503..e84556006a5b7 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( @@ -400,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) @@ -429,11 +450,14 @@ #fastsim from FastSimulation.Tracking.FastTrackerRecHitMaskProducer_cfi import maskProducerFromClusterRemover lowPtTripletStepMasks = maskProducerFromClusterRemover(lowPtTripletStepClusters) -fastSim.toReplaceWith(LowPtTripletStepTask, - cms.Task(lowPtTripletStepMasks - ,lowPtTripletStepTrackingRegions - ,lowPtTripletStepSeeds - ,lowPtTripletStepTrackCandidates - ,lowPtTripletStepTracks - ,lowPtTripletStep - )) +_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 a2ff9f228cba0..c5c8d413476b4 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) @@ -495,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 - ,pixelPairStep - ) +_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) 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/aliases_cfi.py b/SimGeneral/MixingModule/python/aliases_cfi.py index 9ef571596b797..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.toModify(simSiStripDigis, mix = None) -fastSim.toModify(simAPVsaturation, mix = None) diff --git a/SimGeneral/MixingModule/python/digitizers_cfi.py b/SimGeneral/MixingModule/python/digitizers_cfi.py index b330344559c43..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,12 +109,15 @@ ) 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) 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/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 8644ee7a254fd..f8b585c7fb9d3 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( @@ -123,7 +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")), 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 = []) ) diff --git a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py index 98353db571132..6e5462b4e86e0 100644 --- a/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py +++ b/SimGeneral/TrackingAnalysis/python/trackingParticleNumberOfLayersProducer_cff.py @@ -1,8 +1,10 @@ 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"]) 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..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), @@ -95,3 +94,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..e177ac6065221 100644 --- a/Validation/RecoTrack/python/TrackValidation_cff.py +++ b/Validation/RecoTrack/python/TrackValidation_cff.py @@ -22,6 +22,9 @@ 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(): @@ -59,6 +62,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": @@ -549,7 +558,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 +947,10 @@ 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"], @@ -976,6 +992,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"]])