Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-05 00:07:45

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 import sys
0005 from Configuration.Eras.Era_Run3_cff import Run3
0006 process = cms.Process("PIXELDQMLIVE", Run3)
0007 
0008 live=True
0009 unitTest = False
0010 
0011 if 'unitTest=True' in sys.argv:
0012     live=False
0013     unitTest=True
0014 
0015 #set to false for lxplus offline testing
0016 #live=False
0017 offlineTesting=not live
0018 
0019 TAG ="PixelPhase1" 
0020 
0021 process.MessageLogger = cms.Service("MessageLogger",
0022     debugModules = cms.untracked.vstring('siPixelDigis',
0023                                          'siStripClusters', 
0024                                          'SiPixelRawDataErrorSource', 
0025                                          'SiPixelDigiSource'),
0026     cout = cms.untracked.PSet(threshold = cms.untracked.string('ERROR')),
0027     destinations = cms.untracked.vstring('cout')
0028 )
0029 
0030 #----------------------------
0031 # Event Source
0032 #-----------------------------
0033 # for live online DQM in P5
0034 
0035 if (unitTest):
0036     process.load("DQM.Integration.config.unittestinputsource_cfi")
0037     from DQM.Integration.config.unittestinputsource_cfi import options
0038 
0039 elif (live):
0040     process.load("DQM.Integration.config.inputsource_cfi")
0041     from DQM.Integration.config.inputsource_cfi import options
0042 
0043 # for testing in lxplus
0044 elif(offlineTesting):
0045     process.load("DQM.Integration.config.fileinputsource_cfi")
0046     from DQM.Integration.config.fileinputsource_cfi import options
0047 
0048 #-----------------------------
0049 # DQM Environment
0050 #-----------------------------
0051 
0052 process.load("DQMServices.Components.DQMEnvironment_cfi")
0053 
0054 process.load("DQM.Integration.config.environment_cfi")
0055 
0056 #----------------------------
0057 # DQM Live Environment
0058 #-----------------------------
0059 
0060 process.dqmEnv.subSystemFolder = TAG
0061 process.dqmSaver.tag = TAG
0062 process.dqmSaver.runNumber = options.runNumber
0063 process.dqmSaverPB.tag = TAG
0064 process.dqmSaverPB.runNumber = options.runNumber
0065 
0066 
0067 #-----------------------------
0068 # Magnetic Field
0069 #-----------------------------
0070 
0071 process.load('Configuration.StandardSequences.MagneticField_cff')
0072 
0073 #-------------------------------------------------
0074 # GEOMETRY
0075 #-------------------------------------------------
0076 
0077 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0078 
0079 #-------------------------------------------------
0080 # GLOBALTAG
0081 #-------------------------------------------------
0082 # Condition for P5 cluster
0083 
0084 if (live):
0085     process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0086 
0087 # Condition for lxplus: change and possibly customise the GT
0088 elif(offlineTesting):
0089     process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0090     from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0091     process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run2_data', '')
0092 
0093 #-----------------------
0094 #  Reconstruction Modules
0095 #-----------------------
0096 
0097 # Real data raw to digi
0098 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0099 process.load("RecoLocalTracker.SiStripZeroSuppression.SiStripZeroSuppression_cfi")
0100 process.load("RecoLocalTracker.SiStripClusterizer.SiStripClusterizer_RealData_cfi")
0101 
0102 process.load("DPGAnalysis.SiStripTools.eventwithhistoryproducerfroml1abc_cfi")
0103 process.load("DPGAnalysis.SiStripTools.apvcyclephaseproducerfroml1tsDB_cfi")
0104 
0105 # PixelPhase1 Real data raw to digi
0106 process.load("EventFilter.SiPixelRawToDigi.SiPixelRawToDigi_cfi")
0107 process.siPixelDigis.cpu.IncludeErrors = True
0108 
0109 if (process.runType.getRunType() == process.runType.hi_run):    
0110     #--------------------------------
0111     # Heavy Ion Configuration Changes
0112     #--------------------------------
0113     process.siPixelDigis.cpu.InputLabel = "rawDataRepacker"
0114     process.siStripDigis.ProductLabel   = "rawDataRepacker"
0115     process.scalersRawToDigi.scalersInputTag = "rawDataRepacker"
0116 else :
0117     process.siPixelDigis.cpu.InputLabel = "rawDataCollector"
0118     process.siStripDigis.ProductLabel     = cms.InputTag("rawDataCollector") 
0119 
0120 ## Collision Reconstruction
0121 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0122 
0123 ## Cosmic Track Reconstruction
0124 if (process.runType.getRunType() == process.runType.cosmic_run or process.runType.getRunType() == process.runType.cosmic_run_stage1):
0125     process.load("RecoTracker.Configuration.RecoTrackerP5_cff")
0126     process.load("Configuration.StandardSequences.ReconstructionCosmics_cff")
0127     process.load("RecoPixelVertexing.PixelLowPtUtilities.ClusterShapeHitFilterESProducer_cfi")
0128 else:
0129     process.load("Configuration.StandardSequences.Reconstruction_cff")
0130 
0131 import RecoVertex.BeamSpotProducer.onlineBeamSpotESProducer_cfi as _mod
0132 process.BeamSpotESProducer = _mod.onlineBeamSpotESProducer.clone()
0133 
0134 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0135 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0136 
0137 process.load("DQM.SiPixelPhase1Config.SiPixelPhase1OnlineDQM_cff")
0138 
0139 process.PerModule.enabled=True
0140 process.PerReadout.enabled=True
0141 process.OverlayCurvesForTiming.enabled=True
0142 process.IsOffline.enabled=False
0143 
0144 #--------------------------
0145 # Service
0146 #--------------------------
0147 process.AdaptorConfig = cms.Service("AdaptorConfig")
0148 
0149 #--------------------------
0150 # Filters
0151 #--------------------------
0152 
0153 # HLT Filter
0154 # 0=random, 1=physics, 2=calibration, 3=technical
0155 process.hltTriggerTypeFilter = cms.EDFilter("HLTTriggerTypeFilter",
0156     SelectedTriggerType = cms.int32(1)
0157 )
0158 
0159 process.load('HLTrigger.HLTfilters.hltHighLevel_cfi')
0160 if (process.runType.getRunType() == process.runType.hi_run):
0161     process.hltHighLevel.HLTPaths = ['HLT_ZeroBias_*' , 'HLT_HIZeroBias_*' , 'HLT_ZeroBias1_*' , 'HLT_PAZeroBias_*' , 'HLT_PAZeroBias1_*', 'HLT_PAL1MinimumBiasHF_OR_SinglePixelTrack_*','HLT*SingleMu*' , 'HLT_HICentralityVeto*' , 'HLT_HIMinimumBias*','HLT_HIPhysics*']
0162 else:
0163     process.hltHighLevel.HLTPaths = ['HLT_ZeroBias_*' , 'HLT_ZeroBias1_*' , 'HLT_PAZeroBias_*' , 'HLT_PAZeroBias1_*', 'HLT_PAL1MinimumBiasHF_OR_SinglePixelTrack_*','HLT*SingleMu*']
0164 process.hltHighLevel.andOr = True
0165 process.hltHighLevel.throw =  False
0166 
0167 #--------------------------
0168 # Scheduling
0169 #--------------------------
0170 
0171 process.DQMmodules = cms.Sequence(process.dqmEnv* process.dqmSaver*process.dqmSaverPB)
0172 
0173 process.RecoForDQM_LocalReco = cms.Sequence(process.siPixelDigis*process.siStripDigis*process.gtDigis*process.trackerlocalreco)
0174 
0175 ### COSMIC RUN SETTING
0176 if (process.runType.getRunType() == process.runType.cosmic_run or process.runType.getRunType() == process.runType.cosmic_run_stage1):
0177         
0178     # Reco for cosmic data
0179     process.load('RecoTracker.SpecialSeedGenerators.SimpleCosmicBONSeeder_cfi')
0180     process.simpleCosmicBONSeeds.ClusterCheckPSet.MaxNumberOfCosmicClusters = 450
0181     process.combinatorialcosmicseedfinderP5.MaxNumberOfCosmicClusters = 450
0182 
0183     
0184 
0185     process.RecoForDQM_TrkReco_cosmic = cms.Sequence(process.offlineBeamSpot*process.MeasurementTrackerEvent*process.ctftracksP5*process.siPixelClusterShapeCache)
0186     
0187     process.p = cms.Path(
0188                          ##### TRIGGER SELECTION #####
0189                          process.hltHighLevel*
0190                          process.scalersRawToDigi*
0191                          process.tcdsDigis*
0192                          process.APVPhases*
0193                          process.consecutiveHEs*
0194                          process.hltTriggerTypeFilter*
0195                          process.RecoForDQM_LocalReco*
0196                          process.DQMmodules*
0197                          process.RecoForDQM_TrkReco_cosmic*
0198                          process.siPixelPhase1OnlineDQM_source_cosmics*
0199                          process.siPixelPhase1OnlineDQM_harvesting
0200                          )
0201    
0202 ### pp/hi COLLISION SETTING
0203 
0204 if (process.runType.getRunType() == process.runType.pp_run or process.runType.getRunType() == process.runType.pp_run_stage1 or process.runType.getRunType() == process.runType.hi_run):
0205     # Reco for pp collisions
0206     process.load('RecoTracker.IterativeTracking.InitialStepPreSplitting_cff')
0207     process.InitialStepPreSplittingTask.remove(process.initialStepTrackRefsForJetsPreSplitting)
0208     process.InitialStepPreSplittingTask.remove(process.caloTowerForTrkPreSplitting)
0209     process.InitialStepPreSplittingTask.remove(process.ak4CaloJetsForTrkPreSplitting)
0210     process.InitialStepPreSplittingTask.remove(process.jetsForCoreTrackingPreSplitting)
0211     process.InitialStepPreSplittingTask.remove(process.siPixelClusters)
0212     process.InitialStepPreSplittingTask.remove(process.siPixelRecHits)
0213     process.InitialStepPreSplittingTask.remove(process.MeasurementTrackerEvent)
0214     process.InitialStepPreSplittingTask.remove(process.siPixelClusterShapeCache)
0215 
0216     # Redefinition of siPixelClusters: has to be after RecoTracker.IterativeTracking.InitialStepPreSplitting_cff 
0217     process.load("RecoLocalTracker.SiPixelClusterizer.SiPixelClusterizer_cfi")
0218 
0219     from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import *
0220     process.PixelLayerTriplets.BPix.HitProducer = cms.string('siPixelRecHitsPreSplitting')
0221     process.PixelLayerTriplets.FPix.HitProducer = cms.string('siPixelRecHitsPreSplitting')
0222     from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import *
0223     process.pixelTracksHitTriplets.SeedComparitorPSet.clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting'
0224     process.RecoForDQM_TrkReco = cms.Sequence(process.offlineBeamSpot*process.MeasurementTrackerEventPreSplitting*process.siPixelClusterShapeCachePreSplitting*process.recopixelvertexing*process.InitialStepPreSplitting)
0225 
0226     if (process.runType.getRunType() == process.runType.hi_run):
0227         #        process.SiPixelClusterSource.src = cms.InputTag("siPixelClustersPreSplitting")
0228         #        process.Reco = cms.Sequence(process.siPixelDigis*process.pixeltrackerlocalreco)
0229         process.Reco = cms.Sequence(process.siPixelDigis*process.siStripDigis*process.trackerlocalreco)
0230     else:
0231         process.Reco = cms.Sequence(process.siPixelDigis*process.siStripDigis*process.trackerlocalreco)
0232                           
0233 
0234     process.p = cms.Path(
0235       process.hltHighLevel #trigger selection
0236      *process.scalersRawToDigi
0237      *process.tcdsDigis
0238      *process.APVPhases
0239      *process.consecutiveHEs
0240      *process.Reco
0241      *process.siPixelClusters
0242      *process.DQMmodules
0243      *process.RecoForDQM_TrkReco
0244      *process.siPixelPhase1OnlineDQM_source_pprun
0245      *process.siPixelPhase1OnlineDQM_harvesting
0246     )
0247 
0248 ### FIXME: to add the HI Track Reconstruction    
0249 ### process customizations included here
0250 from DQM.Integration.config.online_customizations_cfi import *
0251 process = customise(process)
0252 
0253 #--------------------------------------------------
0254 # Heavy Ion Specific Fed Raw Data Collection Label
0255 #--------------------------------------------------
0256 
0257 print("Running with run type = ", process.runType.getRunType())
0258 print("Final Source settings:", process.source)