Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:13

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 def removePath(process, pname):
0004     if hasattr(process, pname):
0005         process.schedule.remove(getattr(process, pname))
0006         delattr(process, pname)
0007 
0008 def customizeInitialStepOnly(process):
0009     # Customize reconstruction
0010     process.trackerClusterCheck.PixelClusterCollectionLabel = 'siPixelClustersPreSplitting'
0011     process.initialStepSeedLayers.FPix.HitProducer = 'siPixelRecHitsPreSplitting'
0012     process.initialStepSeedLayers.BPix.HitProducer = 'siPixelRecHitsPreSplitting'
0013     process.initialStepHitQuadruplets.SeedComparitorPSet.clusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
0014     process.initialStepSeeds.SeedComparitorPSet.ClusterShapeCacheSrc = "siPixelClusterShapeCachePreSplitting"
0015     if hasattr(process, "initialStepTrackCandidatesMkFitHits"):
0016         process.initialStepTrackCandidatesMkFitHits.pixelRecHits = "siPixelRecHitsPreSplitting"
0017     if hasattr(process.initialStepTrackCandidates, "MeasurementTrackerEvent"):
0018         process.initialStepTrackCandidates.MeasurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'
0019     process.initialStepTracks.MeasurementTrackerEvent = 'MeasurementTrackerEventPreSplitting'
0020     process.iterTrackingTask = cms.Task(process.trackerClusterCheck,
0021                                         process.InitialStepTask)
0022 
0023     # Customize MTV
0024     for selector in [
0025         process.cutsRecoTracksInitialStep,
0026         process.cutsRecoTracksPt09InitialStep,
0027         process.cutsRecoTracksFromPVInitialStep,
0028         process.cutsRecoTracksFromPVPt09InitialStep,
0029         ]:
0030         selector.algorithm = []
0031         selector.quality = []
0032         selector.src = "initialStepTracks"
0033         selector.vertexTag = "firstStepPrimaryVertices"
0034 
0035     process.trackingParticleRecoTrackAsssociationPreSplitting = process.trackingParticleRecoTrackAsssociation.clone(
0036         label_tr = "initialStepTracks",
0037         associator = "quickTrackAssociatorByHitsPreSplitting",
0038     )
0039     process.VertexAssociatorByPositionAndTracksPreSplitting = process.VertexAssociatorByPositionAndTracks.clone(
0040         trackAssociation = "trackingParticleRecoTrackAsssociationPreSplitting"
0041     )
0042 
0043 
0044     def setInput(mtvs, labels):
0045         for mtv in mtvs:
0046             mod = getattr(process, mtv)
0047             mod.label = labels
0048             mod.label_vertex = "firstStepPrimaryVertices"
0049             if mod.UseAssociators.value():
0050                 mod.associators = ["quickTrackAssociatorByHitsPreSplitting"]
0051             else:
0052                 mod.associators = ["trackingParticleRecoTrackAsssociationPreSplitting"]
0053             mod.vertexAssociator = "VertexAssociatorByPositionAndTracksPreSplitting"
0054             mod.trackCollectionForDrCalculation = "initialStepTracks"
0055             mod.dodEdxPlots = False
0056             mod.doResolutionPlotsForLabels = []
0057 
0058     setInput(["trackValidatorTrackingOnly", "trackValidatorAllTPEfficTrackingOnly",
0059               "trackValidatorTPPtLess09TrackingOnly", "trackValidatorBHadronTrackingOnly"],
0060              ["cutsRecoTracksInitialStep", "cutsRecoTracksPt09InitialStep"])
0061     setInput(["trackValidatorFromPVTrackingOnly", "trackValidatorFromPVAllTPTrackingOnly"],
0062              ["cutsRecoTracksFromPVInitialStep", "cutsRecoTracksFromPVPt09InitialStep"])
0063     setInput(["trackValidatorSeedingTrackingOnly"], ["seedTracksinitialStepSeeds"])
0064     setInput(["trackValidatorBuilding"], ["initialStepTracks"])
0065     process.trackValidatorBuilding.mvaLabels = cms.untracked.PSet(initialStepTracks = cms.untracked.vstring('initialStep'))
0066 
0067     process.tracksPreValidationTrackingOnly = cms.Task(
0068         process.cutsRecoTracksInitialStep,
0069         process.cutsRecoTracksPt09InitialStep,
0070         process.cutsRecoTracksFromPVInitialStep,
0071         process.cutsRecoTracksFromPVPt09InitialStep,
0072         process.tracksValidationTruth,
0073         process.trackingParticlesSignal,
0074         process.trackingParticlesBHadron,
0075         process.trackingParticleRecoTrackAsssociationPreSplitting,
0076         process.VertexAssociatorByPositionAndTracksPreSplitting,
0077     )
0078     process.trackValidatorsTrackingOnly.remove(process.trackValidatorConversionTrackingOnly)
0079     process.trackValidatorsTrackingOnly.remove(process.trackValidatorSeedingPreSplittingTrackingOnly)
0080     process.trackValidatorsTrackingOnly.remove(process.trackValidatorBuildingPreSplitting)
0081 
0082     # Remove vertex validation
0083     process.globalPrevalidationTrackingOnly.remove(process.vertexValidationTrackingOnly)
0084 
0085     # Remove DQM
0086     removePath(process, "dqmoffline_step")
0087     removePath(process, "dqmofflineOnPAT_step")
0088 
0089     # Remove RECO output if it exists
0090     removePath(process, "RECOSIMoutput_step")
0091 
0092     return process
0093 
0094 
0095 def customizeInitialStepOnlyNoMTV(process):
0096     process = customizeInitialStepOnly(process)
0097 
0098     process.options.wantSummary = cms.untracked.bool(True)
0099 
0100     # Remove validation
0101     removePath(process, "prevalidation_step")
0102     removePath(process, "validation_step")
0103     removePath(process, "DQMoutput_step")
0104 
0105     # Minimize the rest
0106     process.RawToDigiTask = cms.Task(
0107         process.siPixelDigis,
0108         process.siStripDigis
0109     )
0110     process.reconstruction_trackingOnly = cms.Sequence(
0111         process.trackerlocalreco +
0112         process.offlineBeamSpot +
0113         process.siPixelClusterShapeCachePreSplitting +
0114         process.MeasurementTrackerEventPreSplitting,
0115         process.iterTrackingTask
0116     )
0117     process.trackerlocalrecoTask.remove(process.clusterSummaryProducer)
0118     process.iterTrackingTask.remove(process.ak4CaloJetsForTrk)
0119     process.iterTrackingTask.remove(process.caloTowerForTrk)
0120     process.iterTrackingTask.remove(process.firstStepPrimaryVertices)
0121     process.iterTrackingTask.remove(process.firstStepPrimaryVerticesUnsorted)
0122     process.iterTrackingTask.remove(process.initialStepTrackRefsForJets)
0123     process.iterTrackingTask.remove(process.initialStepClassifier1)
0124     process.iterTrackingTask.remove(process.initialStep)
0125 
0126     # Add a dummy output module to trigger the (minimal) prefetching
0127     process.out = cms.OutputModule("AsciiOutputModule",
0128         outputCommands = cms.untracked.vstring(
0129             "keep *_initialStepTracks_*_*",
0130         ),
0131         verbosity = cms.untracked.uint32(0)
0132     )
0133     process.outPath = cms.EndPath(process.out)
0134     process.schedule = cms.Schedule(process.raw2digi_step, process.reconstruction_step, process.outPath)
0135 
0136     # Minimize printouts
0137     process.MessageLogger.cerr.FwkReport.reportEvery = 100
0138     process.MessageLogger.cerr.default.limit = 1
0139     process.MessageLogger.suppressWarning.extend([
0140             "initialStepTrackCandidatesMkFitInput",
0141             "initialStepTrackCandidatesMkFit",
0142             "initialStepTrackCandidates",
0143             "initialStepTracks",
0144     ])
0145 
0146     return process