Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-31 23:17:02

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 RecoPixelVertexing.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 RecoPixelVertexing.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 RecoHI.HiTracking.HILowPtConformalPixelTracks_cfi import *
0186 from RecoHI.HiCentralityAlgos.HiCentrality_cfi import hiCentrality
0187 from RecoHI.HiCentralityAlgos.HiClusterCompatibility_cfi import hiClusterCompatibility
0188 _highlevelreco_HITask = highlevelrecoTask.copy()
0189 _highlevelreco_HITask.add(hiConformalPixelTracksTaskPhase1)
0190 _highlevelreco_HITask.add(hiCentrality)
0191 _highlevelreco_HITask.add(hiClusterCompatibility)
0192 (pp_on_XeXe_2017 | pp_on_AA ).toReplaceWith(highlevelrecoTask, _highlevelreco_HITask)
0193 pp_on_AA.toReplaceWith(highlevelrecoTask,highlevelrecoTask.copyAndExclude([PFTauTask]))
0194 
0195 # not commisoned and not relevant in FastSim (?):
0196 _fastSim_highlevelrecoTask = highlevelrecoTask.copyAndExclude([muoncosmichighlevelrecoTask])
0197 fastSim.toReplaceWith(highlevelrecoTask,_fastSim_highlevelrecoTask)
0198 
0199 
0200 from FWCore.Modules.logErrorHarvester_cfi import *
0201 
0202 # "Export" Section
0203 reconstructionTask     = cms.Task(localrecoTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0204 reconstruction         = cms.Sequence(reconstructionTask)
0205 
0206 #logErrorHarvester should only wait for items produced in the reconstruction sequence
0207 _modulesInReconstruction = list()
0208 reconstructionTask.visit(cms.ModuleNamesFromGlobalsVisitor(globals(),_modulesInReconstruction))
0209 logErrorHarvester.includeModules = cms.untracked.vstring(sorted(set(_modulesInReconstruction)))
0210 
0211 reconstruction_trackingOnlyTask = cms.Task(localrecoTask,globalreco_trackingTask)
0212 #calo parts removed as long as tracking is not running jetCore in phase2
0213 trackingPhase2PU140.toReplaceWith(reconstruction_trackingOnlyTask,
0214                                   reconstruction_trackingOnlyTask.copyAndExclude([hgcalLocalRecoTask,castorreco]))
0215 reconstruction_trackingOnly = cms.Sequence(reconstruction_trackingOnlyTask)
0216 reconstruction_pixelTrackingOnlyTask = cms.Task(
0217     pixeltrackerlocalrecoTask,
0218     offlineBeamSpotTask,
0219     siPixelClusterShapeCachePreSplitting,
0220     recopixelvertexingTask
0221 )
0222 reconstruction_pixelTrackingOnly = cms.Sequence(reconstruction_pixelTrackingOnlyTask)
0223 
0224 reconstruction_ecalOnlyTask = cms.Task(
0225     bunchSpacingProducer,
0226     offlineBeamSpot,
0227     ecalOnlyLocalRecoTask,
0228     pfClusteringPSTask,
0229     pfClusteringECALTask,
0230     particleFlowSuperClusterECALOnly
0231 )
0232 reconstruction_ecalOnly = cms.Sequence(reconstruction_ecalOnlyTask)
0233 
0234 from Configuration.Eras.Modifier_phase2_ecal_devel_cff import phase2_ecal_devel
0235 phase2_ecal_devel.toReplaceWith(reconstruction_ecalOnlyTask, reconstruction_ecalOnlyTask.copyAndExclude([pfClusteringPSTask, pfClusteringECALTask, particleFlowSuperClusterECALOnly]))
0236 
0237 reconstruction_hcalOnlyTask = cms.Task(
0238     bunchSpacingProducer,
0239     offlineBeamSpot,
0240     hcalOnlyLocalRecoTask,
0241     hcalOnlyGlobalRecoTask,
0242     pfClusteringHBHEHFOnlyTask
0243 )
0244 
0245 reconstruction_hcalOnly = cms.Sequence(reconstruction_hcalOnlyTask)
0246 
0247 #need a fully expanded sequence copy
0248 modulesToRemove = list() # copy does not work well
0249 noTrackingAndDependent = list()
0250 noTrackingAndDependent.append(siPixelClustersPreSplitting)
0251 noTrackingAndDependent.append(siStripZeroSuppression)
0252 noTrackingAndDependent.append(siStripClusters)
0253 noTrackingAndDependent.append(initialStepSeedLayersPreSplitting)
0254 noTrackingAndDependent.append(trackerClusterCheckPreSplitting)
0255 noTrackingAndDependent.append(initialStepTrackingRegionsPreSplitting)
0256 noTrackingAndDependent.append(initialStepHitDoubletsPreSplitting)
0257 noTrackingAndDependent.append(initialStepHitTripletsPreSplitting)
0258 noTrackingAndDependent.append(initialStepSeedsPreSplitting)
0259 noTrackingAndDependent.append(initialStepTrackCandidatesPreSplitting)
0260 noTrackingAndDependent.append(initialStepTracksPreSplitting)
0261 noTrackingAndDependent.append(firstStepPrimaryVerticesPreSplitting)
0262 noTrackingAndDependent.append(initialStepTrackRefsForJetsPreSplitting)
0263 noTrackingAndDependent.append(caloTowerForTrkPreSplitting)
0264 noTrackingAndDependent.append(ak4CaloJetsForTrkPreSplitting)
0265 noTrackingAndDependent.append(jetsForCoreTrackingPreSplitting)
0266 noTrackingAndDependent.append(siPixelClusterShapeCachePreSplitting)
0267 noTrackingAndDependent.append(siPixelClusters)
0268 noTrackingAndDependent.append(clusterSummaryProducer)
0269 noTrackingAndDependent.append(siPixelRecHitsPreSplitting)
0270 noTrackingAndDependent.append(MeasurementTrackerEventPreSplitting)
0271 noTrackingAndDependent.append(PixelLayerTriplets)
0272 noTrackingAndDependent.append(pixelTracks)
0273 noTrackingAndDependent.append(pixelVertices)
0274 modulesToRemove.append(dt1DRecHits)
0275 modulesToRemove.append(dt1DCosmicRecHits)
0276 modulesToRemove.append(csc2DRecHits)
0277 modulesToRemove.append(rpcRecHits)
0278 modulesToRemove.append(gemRecHits)
0279 #modulesToRemove.append(ecalGlobalUncalibRecHit)
0280 modulesToRemove.append(ecalMultiFitUncalibRecHit)
0281 modulesToRemove.append(ecalDetIdToBeRecovered)
0282 modulesToRemove.append(ecalRecHit)
0283 modulesToRemove.append(ecalCompactTrigPrim)
0284 modulesToRemove.append(ecalTPSkim)
0285 modulesToRemove.append(ecalPreshowerRecHit)
0286 modulesToRemove.append(selectDigi)
0287 modulesToRemove.append(hbheprereco)
0288 modulesToRemove.append(hbhereco)
0289 modulesToRemove.append(hfreco)
0290 modulesToRemove.append(horeco)
0291 modulesToRemove.append(hcalnoise)
0292 modulesToRemove.append(zdcreco)
0293 modulesToRemove.append(castorreco)
0294 ##it's OK according to Ronny modulesToRemove.append(CSCHaloData)#needs digis
0295 reconstruction_fromRECO = reconstruction.copyAndExclude(modulesToRemove+noTrackingAndDependent)
0296 
0297 
0298 #sequences with additional stuff
0299 reconstruction_withPixellessTkTask  = cms.Task(localrecoTask,globalreco_plusPLTask,highlevelrecoTask,logErrorHarvester)
0300 reconstruction_withPixellessTk  = cms.Sequence(reconstruction_withPixellessTkTask)
0301 reconstruction_HcalNZSTask = cms.Task(localreco_HcalNZSTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0302 reconstruction_HcalNZS = cms.Sequence(reconstruction_HcalNZSTask)
0303 
0304 #sequences without some stuffs
0305 #
0306 reconstruction_woCosmicMuonsTask = cms.Task(localrecoTask,globalrecoTask,highlevelrecoTask,logErrorHarvester)
0307 reconstruction_woCosmicMuons = cms.Sequence(reconstruction_woCosmicMuonsTask)