Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-10-09 23:02:20

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from RecoLuminosity.LumiProducer.bunchSpacingProducer_cfi import *
0004 from RecoLocalMuon.Configuration.RecoLocalMuon_cff import *
0005 from RecoLocalCalo.Configuration.RecoLocalCalo_cff import *
0006 from RecoLocalFastTime.Configuration.RecoLocalFastTime_cff import *
0007 from RecoMTD.Configuration.mtdGlobalReco_cff import *
0008 from RecoTracker.Configuration.RecoTracker_cff import *
0009 from RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff import *
0010 from TrackingTools.Configuration.TrackingTools_cff import *
0011 from RecoTracker.MeasurementDet.MeasurementTrackerEventProducer_cfi import *
0012 from RecoTracker.PixelLowPtUtilities.siPixelClusterShapeCache_cfi import *
0013 from RecoHGCal.Configuration.recoHGCAL_cff import *
0014 
0015 from Configuration.Eras.Modifier_fastSim_cff import fastSim
0016 
0017 siPixelClusterShapeCachePreSplitting = siPixelClusterShapeCache.clone(
0018     src = 'siPixelClustersPreSplitting'
0019     )
0020 
0021 # Global  reco
0022 from RecoEcal.Configuration.RecoEcal_cff import *
0023 from RecoJets.Configuration.CaloTowersRec_cff import *
0024 from RecoMET.Configuration.RecoMET_cff import *
0025 from RecoMuon.Configuration.RecoMuon_cff import *
0026 # Higher level objects
0027 from RecoVertex.Configuration.RecoVertex_cff import *
0028 from RecoEgamma.Configuration.RecoEgamma_cff import *
0029 from RecoVertex.Configuration.RecoPixelVertexing_cff import *
0030 
0031 
0032 from RecoJets.Configuration.RecoJetsGlobal_cff import *
0033 from RecoMET.Configuration.RecoPFMET_cff import *
0034 from RecoBTag.Configuration.RecoBTag_cff import *
0035 #
0036 # please understand that division global,highlevel is completely fake !
0037 #
0038 #local reconstruction
0039 from RecoLocalTracker.Configuration.RecoLocalTracker_cff import *
0040 from RecoParticleFlow.Configuration.RecoParticleFlow_cff import *
0041 from RecoPPS.Configuration.recoCTPPS_cff import *
0042 #
0043 # new tau configuration
0044 #
0045 from RecoTauTag.Configuration.RecoPFTauTag_cff import *
0046 # Also BeamSpot
0047 from RecoVertex.BeamSpotProducer.BeamSpot_cff import *
0048 
0049 from RecoLocalCalo.CastorReco.CastorSimpleReconstructor_cfi import *
0050 
0051 # Low pT electrons
0052 from RecoEgamma.EgammaElectronProducers.lowPtGsfElectronSequence_cff import *
0053 
0054 # Conversions from lowPtGsfTracks
0055 from RecoEgamma.EgammaPhotonProducers.conversionOpenTrackSequence_cff import *
0056 from RecoEgamma.EgammaPhotonProducers.gsfTracksOpenConversionSequence_cff import *
0057 
0058 
0059 localrecoTask = cms.Task(bunchSpacingProducer,trackerlocalrecoTask,muonlocalrecoTask,calolocalrecoTask,castorreco)
0060 localreco = cms.Sequence(localrecoTask)
0061 localreco_HcalNZSTask = cms.Task(bunchSpacingProducer,trackerlocalrecoTask,muonlocalrecoTask,calolocalrecoTaskNZS,castorreco)
0062 localreco_HcalNZS = cms.Sequence(localreco_HcalNZSTask)
0063 
0064 _run3_localrecoTask = localrecoTask.copyAndExclude([castorreco])
0065 _run3_localreco_HcalNZSTask = localreco_HcalNZSTask.copyAndExclude([castorreco])
0066 from Configuration.Eras.Modifier_run3_common_cff import run3_common
0067 run3_common.toReplaceWith(localrecoTask, _run3_localrecoTask)
0068 run3_common.toReplaceWith(localreco_HcalNZSTask, _run3_localreco_HcalNZSTask)
0069 
0070 from Configuration.Eras.Modifier_phase2_timing_layer_cff import phase2_timing_layer
0071 _phase2_timing_layer_localrecoTask = _run3_localrecoTask.copy()
0072 _phase2_timing_layer_localrecoTask.add(fastTimingLocalRecoTask)
0073 _phase2_timing_layer_localreco_HcalNZSTask = _run3_localreco_HcalNZSTask.copy()
0074 _phase2_timing_layer_localreco_HcalNZSTask.add(fastTimingLocalRecoTask)
0075 phase2_timing_layer.toReplaceWith(localrecoTask,_phase2_timing_layer_localrecoTask)
0076 phase2_timing_layer.toReplaceWith(localreco_HcalNZSTask,_phase2_timing_layer_localreco_HcalNZSTask)
0077 
0078 from Configuration.Eras.Modifier_ctpps_cff import ctpps
0079 
0080 _ctpps_localrecoTask = localrecoTask.copy()
0081 _ctpps_localrecoTask.add(recoCTPPSTask)
0082 ctpps.toReplaceWith(localrecoTask, _ctpps_localrecoTask)
0083 
0084 _ctpps_localreco_HcalNZSTask = localreco_HcalNZSTask.copy()
0085 _ctpps_localreco_HcalNZSTask.add(recoCTPPSTask)
0086 ctpps.toReplaceWith(localreco_HcalNZSTask, _ctpps_localreco_HcalNZSTask)
0087 
0088 ###########################################
0089 # no castor, zdc, Totem/CTPPS RP in FastSim
0090 ###########################################
0091 _fastSim_localrecoTask = localrecoTask.copyAndExclude([
0092     castorreco,
0093     totemRPLocalReconstructionTask,totemTimingLocalReconstructionTask,diamondSampicLocalReconstructionTask,ctppsDiamondLocalReconstructionTask,
0094     ctppsLocalTrackLiteProducer,ctppsPixelLocalReconstructionTask,ctppsProtons,
0095     trackerlocalrecoTask
0096 ])
0097 fastSim.toReplaceWith(localrecoTask, _fastSim_localrecoTask)
0098 
0099 #
0100 # temporarily switching off recoGenJets; since this are MC and wil be moved to a proper sequence
0101 #
0102 
0103 from RecoLocalCalo.Castor.Castor_cff import *
0104 from RecoLocalCalo.Configuration.hcalGlobalReco_cff import *
0105 
0106 globalreco_trackingTask = cms.Task(offlineBeamSpotTask,
0107                           MeasurementTrackerEventPreSplitting, # unclear where to put this
0108                           siPixelClusterShapeCachePreSplitting, # unclear where to put this
0109                           standalonemuontrackingTask,
0110                           trackingGlobalRecoTask,
0111                           hcalGlobalRecoTask,
0112                           vertexrecoTask)
0113 _globalreco_tracking_LowPUTask = globalreco_trackingTask.copy()
0114 _globalreco_tracking_LowPUTask.replace(trackingGlobalRecoTask, cms.Task(recopixelvertexingTask,trackingGlobalRecoTask))
0115 from Configuration.Eras.Modifier_trackingLowPU_cff import trackingLowPU
0116 trackingLowPU.toReplaceWith(globalreco_trackingTask, _globalreco_tracking_LowPUTask)
0117 ##########################################
0118 # offlineBeamSpot is reconstructed before mixing in fastSim
0119 ##########################################
0120 _fastSim_globalreco_trackingTask = globalreco_trackingTask.copyAndExclude([offlineBeamSpotTask,MeasurementTrackerEventPreSplitting,siPixelClusterShapeCachePreSplitting])
0121 fastSim.toReplaceWith(globalreco_trackingTask,_fastSim_globalreco_trackingTask)
0122 
0123 _phase2_timing_layer_globalreco_trackingTask = globalreco_trackingTask.copy()
0124 _phase2_timing_layer_globalreco_trackingTask.add(fastTimingGlobalRecoTask)
0125 phase2_timing_layer.toReplaceWith(globalreco_trackingTask,_phase2_timing_layer_globalreco_trackingTask)
0126 
0127 globalrecoTask = cms.Task(globalreco_trackingTask,
0128                           particleFlowClusterTask,
0129                           ecalClustersTask,
0130                           caloTowersRecTask,
0131                           egammaGlobalRecoTask,
0132                           jetGlobalRecoTask,
0133                           muonGlobalRecoTask,
0134                           pfTrackingGlobalRecoTask,
0135                           muoncosmicrecoTask,
0136                           CastorFullRecoTask)
0137 globalreco = cms.Sequence(globalrecoTask)
0138 
0139 _run3_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask])
0140 run3_common.toReplaceWith(globalrecoTask, _run3_globalrecoTask)
0141 
0142 _fastSim_globalrecoTask = globalrecoTask.copyAndExclude([CastorFullRecoTask,muoncosmicrecoTask])
0143 # insert the few tracking modules to be run after mixing back in the globalreco sequence
0144 _fastSim_globalrecoTask.add(newCombinedSeeds,trackExtrapolator,caloTowerForTrk,firstStepPrimaryVerticesUnsorted,ak4CaloJetsForTrk,initialStepTrackRefsForJets,firstStepPrimaryVertices)
0145 fastSim.toReplaceWith(globalrecoTask,_fastSim_globalrecoTask)
0146 
0147 from Configuration.Eras.Modifier_phase2_hgcal_cff import phase2_hgcal
0148 _phase2HGALRecoTask = globalrecoTask.copy()
0149 _phase2HGALRecoTask.add(iterTICLTask)
0150 phase2_hgcal.toReplaceWith(globalrecoTask, _phase2HGALRecoTask)
0151 
0152 from Configuration.Eras.Modifier_phase2_hfnose_cff import phase2_hfnose
0153 _phase2HFNoseRecoTask = globalrecoTask.copy()
0154 _phase2HFNoseRecoTask.add(iterHFNoseTICLTask)
0155 phase2_hfnose.toReplaceWith(globalrecoTask, _phase2HFNoseRecoTask)
0156 
0157 
0158 globalreco_plusPLTask= cms.Task(globalrecoTask,ctfTracksPixelLessTask)
0159 globalreco_plusPL= cms.Sequence(globalreco_plusPLTask)
0160 
0161 reducedRecHitsTask = cms.Task( reducedEcalRecHitsTask , reducedHcalRecHitsTask )
0162 reducedRecHits = cms.Sequence (reducedRecHitsTask)
0163 
0164 highlevelrecoTask = cms.Task(egammaHighLevelRecoPrePFTask,
0165                              particleFlowRecoTask,
0166                              egammaHighLevelRecoPostPFTask,
0167                              muoncosmichighlevelrecoTask,
0168                              muonshighlevelrecoTask,
0169                              particleFlowLinksTask,
0170                              jetHighLevelRecoTask,
0171                              metrecoPlusHCALNoiseTask,
0172                              btaggingTask,
0173                              recoPFMETTask,
0174                              PFTauTask,
0175                              reducedRecHitsTask,
0176                              lowPtGsfElectronTask,
0177                              conversionOpenTrackTask,
0178                              gsfTracksOpenConversions
0179                              )
0180 highlevelreco = cms.Sequence(highlevelrecoTask)
0181 
0182 # AA data with pp reco
0183 from Configuration.Eras.Modifier_pp_on_XeXe_2017_cff import pp_on_XeXe_2017
0184 from Configuration.ProcessModifiers.pp_on_AA_cff import pp_on_AA
0185 from Configuration.Eras.Modifier_run3_upc_cff import run3_upc
0186 from RecoHI.HiTracking.HILowPtConformalPixelTracks_cfi import *
0187 from RecoHI.HiCentralityAlgos.HiCentrality_cfi import hiCentrality
0188 from RecoHI.HiCentralityAlgos.HiClusterCompatibility_cfi import hiClusterCompatibility
0189 _highlevelreco_HITask = highlevelrecoTask.copy()
0190 _highlevelreco_HITask.add(hiConformalPixelTracksTask)
0191 _highlevelreco_HITask.add(hiCentrality)
0192 _highlevelreco_HITask.add(hiClusterCompatibility)
0193 (pp_on_XeXe_2017 | pp_on_AA | run3_upc).toReplaceWith(highlevelrecoTask, _highlevelreco_HITask)
0194 pp_on_AA.toReplaceWith(highlevelrecoTask,highlevelrecoTask.copyAndExclude([PFTauTask]))
0195 from Configuration.Eras.Modifier_ppRef_2024_cff import ppRef_2024
0196 ppRef_2024.toReplaceWith(highlevelrecoTask, cms.Task(highlevelrecoTask.copy(), hiClusterCompatibility))
0197 from Configuration.ProcessModifiers.phase2_pp_on_AA_cff import phase2_pp_on_AA
0198 phase2_pp_on_AA.toReplaceWith(highlevelrecoTask, cms.Task(highlevelrecoTask.copy(), hiClusterCompatibility, hiCentrality))
0199 
0200 # not commisoned and not relevant in FastSim (?):
0201 _fastSim_highlevelrecoTask = highlevelrecoTask.copyAndExclude([muoncosmichighlevelrecoTask])
0202 fastSim.toReplaceWith(highlevelrecoTask,_fastSim_highlevelrecoTask)
0203 
0204 
0205 from FWCore.Modules.logErrorHarvester_cfi import *
0206 
0207 # "Export" Section
0208 reconstructionTask     = cms.Task(localrecoTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0209 reconstruction         = cms.Sequence(reconstructionTask)
0210 
0211 #logErrorHarvester should only wait for items produced in the reconstruction sequence
0212 _modulesInReconstruction = list()
0213 reconstructionTask.visit(cms.ModuleNamesFromGlobalsVisitor(globals(),_modulesInReconstruction))
0214 logErrorHarvester.includeModules = cms.untracked.vstring(sorted(set(_modulesInReconstruction)))
0215 
0216 reconstruction_trackingOnlyTask = cms.Task(localrecoTask,globalreco_trackingTask)
0217 #calo parts removed as long as tracking is not running jetCore in phase2
0218 trackingPhase2PU140.toReplaceWith(reconstruction_trackingOnlyTask,
0219                                   reconstruction_trackingOnlyTask.copyAndExclude([hgcalLocalRecoTask,castorreco]))
0220 reconstruction_trackingOnly = cms.Sequence(reconstruction_trackingOnlyTask)
0221 reconstruction_pixelTrackingOnlyTask = cms.Task(
0222     pixeltrackerlocalrecoTask,
0223     offlineBeamSpotTask,
0224     siPixelClusterShapeCachePreSplitting,
0225     recopixelvertexingTask
0226 )
0227 reconstruction_pixelTrackingOnly = cms.Sequence(reconstruction_pixelTrackingOnlyTask)
0228 
0229 reconstruction_ecalOnlyTask = cms.Task(
0230     bunchSpacingProducer,
0231     offlineBeamSpot,
0232     ecalOnlyLocalRecoTask,
0233     pfClusteringPSTask,
0234     pfClusteringECALTask,
0235     particleFlowSuperClusterECALOnly
0236 )
0237 reconstruction_ecalOnly = cms.Sequence(reconstruction_ecalOnlyTask)
0238 
0239 from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
0240 phase2_ecal_devel.toReplaceWith(reconstruction_ecalOnlyTask, reconstruction_ecalOnlyTask.copyAndExclude([pfClusteringPSTask, pfClusteringECALTask, particleFlowSuperClusterECALOnly]))
0241 
0242 reconstruction_hcalOnlyTask = cms.Task(
0243     bunchSpacingProducer,
0244     offlineBeamSpot,
0245     hcalOnlyLocalRecoTask,
0246     hcalOnlyGlobalRecoTask,
0247     pfClusteringHBHEHFOnlyTask
0248 )
0249 
0250 # define secondary validation task running only Legacy
0251 reconstruction_hcalOnlyLegacyTask = cms.Task(
0252         bunchSpacingProducer,
0253         offlineBeamSpot,
0254         hcalOnlyLegacyLocalRecoTask,
0255         hcalOnlyLegacyGlobalRecoTask,
0256         pfClusteringHBHEHFOnlyLegacyTask)
0257 
0258 reconstruction_hcalOnly = cms.Sequence(reconstruction_hcalOnlyTask)
0259 reconstruction_hcalOnlyLegacy = cms.Sequence(reconstruction_hcalOnlyLegacyTask)
0260 
0261 #need a fully expanded sequence copy
0262 modulesToRemove = list() # copy does not work well
0263 noTrackingAndDependent = list()
0264 noTrackingAndDependent.append(siPixelClustersPreSplitting)
0265 noTrackingAndDependent.append(siStripZeroSuppression)
0266 noTrackingAndDependent.append(siStripClusters)
0267 noTrackingAndDependent.append(initialStepSeedLayersPreSplitting)
0268 noTrackingAndDependent.append(trackerClusterCheckPreSplitting)
0269 noTrackingAndDependent.append(initialStepTrackingRegionsPreSplitting)
0270 noTrackingAndDependent.append(initialStepHitDoubletsPreSplitting)
0271 noTrackingAndDependent.append(initialStepHitTripletsPreSplitting)
0272 noTrackingAndDependent.append(initialStepSeedsPreSplitting)
0273 noTrackingAndDependent.append(initialStepTrackCandidatesPreSplitting)
0274 noTrackingAndDependent.append(initialStepTracksPreSplitting)
0275 noTrackingAndDependent.append(firstStepPrimaryVerticesPreSplitting)
0276 noTrackingAndDependent.append(initialStepTrackRefsForJetsPreSplitting)
0277 noTrackingAndDependent.append(caloTowerForTrkPreSplitting)
0278 noTrackingAndDependent.append(ak4CaloJetsForTrkPreSplitting)
0279 noTrackingAndDependent.append(jetsForCoreTrackingPreSplitting)
0280 noTrackingAndDependent.append(siPixelClusterShapeCachePreSplitting)
0281 noTrackingAndDependent.append(siPixelClusters)
0282 noTrackingAndDependent.append(clusterSummaryProducer)
0283 noTrackingAndDependent.append(siPixelRecHitsPreSplitting)
0284 noTrackingAndDependent.append(MeasurementTrackerEventPreSplitting)
0285 noTrackingAndDependent.append(PixelLayerTriplets)
0286 noTrackingAndDependent.append(pixelTracks)
0287 noTrackingAndDependent.append(pixelVertices)
0288 modulesToRemove.append(dt1DRecHits)
0289 modulesToRemove.append(dt1DCosmicRecHits)
0290 modulesToRemove.append(csc2DRecHits)
0291 modulesToRemove.append(rpcRecHits)
0292 modulesToRemove.append(gemRecHits)
0293 #modulesToRemove.append(ecalGlobalUncalibRecHit)
0294 modulesToRemove.append(ecalMultiFitUncalibRecHit)
0295 modulesToRemove.append(ecalDetIdToBeRecovered)
0296 modulesToRemove.append(ecalRecHit)
0297 modulesToRemove.append(ecalCompactTrigPrim)
0298 modulesToRemove.append(ecalTPSkim)
0299 modulesToRemove.append(ecalPreshowerRecHit)
0300 modulesToRemove.append(selectDigi)
0301 modulesToRemove.append(hbheprereco)
0302 modulesToRemove.append(hbhereco)
0303 modulesToRemove.append(hfreco)
0304 modulesToRemove.append(horeco)
0305 modulesToRemove.append(hcalnoise)
0306 modulesToRemove.append(zdcreco)
0307 modulesToRemove.append(zdcrecoRun3)
0308 modulesToRemove.append(castorreco)
0309 ##it's OK according to Ronny modulesToRemove.append(CSCHaloData)#needs digis
0310 reconstruction_fromRECO = reconstruction.copyAndExclude(modulesToRemove+noTrackingAndDependent)
0311 
0312 
0313 #sequences with additional stuff
0314 reconstruction_withPixellessTkTask  = cms.Task(localrecoTask,globalreco_plusPLTask,highlevelrecoTask,logErrorHarvester)
0315 reconstruction_withPixellessTk  = cms.Sequence(reconstruction_withPixellessTkTask)
0316 reconstruction_HcalNZSTask = cms.Task(localreco_HcalNZSTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0317 reconstruction_HcalNZS = cms.Sequence(reconstruction_HcalNZSTask)
0318 
0319 #sequences without some stuffs
0320 #
0321 reconstruction_woCosmicMuonsTask = cms.Task(localrecoTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0322 reconstruction_woCosmicMuons = cms.Sequence(reconstruction_woCosmicMuonsTask)