Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:08

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import sys
0004 if 'runkey=hi_run' in sys.argv:
0005   from Configuration.Eras.Era_Run3_pp_on_PbPb_cff import Run3_pp_on_PbPb
0006   process = cms.Process("SiStripApproxMonitor", Run3_pp_on_PbPb)
0007 else:
0008   from Configuration.Eras.Era_Run3_cff import Run3
0009   process = cms.Process("SiStripApproxMonitor", Run3)
0010 
0011 process.load('FWCore.MessageService.MessageLogger_cfi')
0012 process.MessageLogger.debugModules = cms.untracked.vstring('siStripDigis',
0013                                                            'siStripClusters',
0014                                                            'siStripZeroSuppression',
0015                                                            'SiStripClusterizer',
0016                                                            'siStripApproximateClusterComparator')
0017 process.MessageLogger.cout = cms.untracked.PSet(threshold = cms.untracked.string('ERROR'))
0018 
0019 live=True
0020 unitTest=False
0021 
0022 if 'unitTest=True' in sys.argv:
0023     live=False
0024     unitTest=True
0025 
0026 # uncomment for running on lxplus
0027 #live=False
0028 offlineTesting=not live
0029 #print "live: "+str(live)+" ==> offlineTesting: "+str(offlineTesting)
0030 
0031 #----------------------------
0032 # Event Source
0033 #-----------------------------
0034 # for live online DQM in P5
0035 if (unitTest):
0036   process.load("DQM.Integration.config.unitteststreamerinputsource_cfi")
0037   from DQM.Integration.config.unitteststreamerinputsource_cfi import options
0038 elif (live):
0039   process.load("DQM.Integration.config.inputsource_cfi")
0040   from DQM.Integration.config.inputsource_cfi import options
0041 # for testing in lxplus
0042 elif(offlineTesting):
0043   process.load("DQM.Integration.config.fileinputsource_cfi")
0044   from DQM.Integration.config.fileinputsource_cfi import options
0045 
0046 #----------------------------
0047 # DQM Live Environment
0048 #-----------------------------
0049 
0050 process.load("DQM.Integration.config.environment_cfi")
0051 process.DQM.filter = '^(SiStripApproximateClusters)(/[^/]+){0,5}$'
0052 
0053 process.dqmEnv.subSystemFolder    = "SiStripApproximateClusters"
0054 process.dqmSaver.tag = "SiStripApproximateClusters"
0055 process.dqmSaver.backupLumiCount = 30
0056 process.dqmSaver.runNumber = options.runNumber
0057 # process.dqmSaverPB.tag = "SiStripApproximateClusters"
0058 # process.dqmSaverPB.runNumber = options.runNumber
0059 
0060 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0061 process.dqmEnvTr = DQMEDAnalyzer('DQMEventInfo',
0062                                  subSystemFolder = cms.untracked.string('SiStripApproximateClusters'),
0063                                  eventRateWindow = cms.untracked.double(0.5),
0064                                  eventInfoFolder = cms.untracked.string('EventInfo'))
0065 
0066 #-----------------------------
0067 # Magnetic Field
0068 #-----------------------------
0069 process.load('Configuration.StandardSequences.MagneticField_cff')
0070 
0071 #-------------------------------------------------
0072 # GEOMETRY
0073 #-------------------------------------------------
0074 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0075 
0076 #--------------------------
0077 # Calibration
0078 #--------------------------
0079 # Condition for P5 cluster
0080 if (live):
0081     process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0082 # Condition for lxplus: change and possibly customise the GT
0083 elif(offlineTesting):
0084     process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0085     from Configuration.AlCa.GlobalTag import GlobalTag as gtCustomise
0086     #you may need to set manually the GT in the line below
0087     process.GlobalTag = gtCustomise(process.GlobalTag, 'auto:run3_hlt', '')
0088 
0089 print("Will process with GlobalTag: %s" % process.GlobalTag.globaltag.value())
0090 
0091 #--------------------------------------------
0092 # Patch to avoid using Run Info information in reconstruction
0093 #--------------------------------------------
0094 process.siStripQualityESProducer.ListOfRecordToMerge = cms.VPSet(
0095    cms.PSet( record = cms.string("SiStripDetVOffRcd"),    tag    = cms.string("") ),
0096    cms.PSet( record = cms.string("SiStripDetCablingRcd"), tag    = cms.string("") ),
0097    cms.PSet( record = cms.string("SiStripBadChannelRcd"), tag    = cms.string("") ),
0098    cms.PSet( record = cms.string("SiStripBadFiberRcd"),   tag    = cms.string("") ),
0099    cms.PSet( record = cms.string("SiStripBadModuleRcd"),  tag    = cms.string("") )
0100    )
0101 #-------------------------------------------
0102 
0103 #-----------------------
0104 #  Reconstruction Modules
0105 #-----------------------
0106 ## Collision Reconstruction
0107 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0108 process.load("Configuration.StandardSequences.Reconstruction_cff")
0109 
0110 import RecoVertex.BeamSpotProducer.onlineBeamSpotESProducer_cfi as _mod
0111 process.BeamSpotESProducer = _mod.onlineBeamSpotESProducer.clone()
0112 
0113 # for running offline enhance the time validity of the online beamspot in DB
0114 if ((not live) or process.isDqmPlayback.value): 
0115   process.BeamSpotESProducer.timeThreshold = cms.int32(int(1e6))
0116 
0117 import RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi
0118 process.offlineBeamSpot = RecoVertex.BeamSpotProducer.BeamSpotOnline_cfi.onlineBeamSpotProducer.clone()
0119 
0120 #
0121 # Strip FED check
0122 #
0123 rawDataCollectorLabel = 'rawDataCollector'
0124 
0125 #--------------------------
0126 # Service
0127 #--------------------------
0128 process.AdaptorConfig = cms.Service("AdaptorConfig")
0129 
0130 # Simple filter for event
0131 process.eventFilter = cms.EDFilter("SimpleEventFilter",
0132 #                   EventsToSkip = cms.untracked.int32(3)
0133                    EventsToSkip = cms.untracked.int32(100)
0134 )
0135 
0136 #--------------------------
0137 # Producers
0138 #--------------------------
0139 # Event History Producer
0140 process.load("DPGAnalysis.SiStripTools.eventwithhistoryproducerfroml1abc_cfi")
0141 
0142 # APV Phase Producer
0143 process.load("DPGAnalysis.SiStripTools.apvcyclephaseproducerfroml1tsDB_cfi")
0144 
0145 #--------------------------
0146 # Filters
0147 #--------------------------
0148 # HLT Filter
0149 # 0=random, 1=physics, 2=calibration, 3=technical
0150 process.hltTriggerTypeFilter = cms.EDFilter("HLTTriggerTypeFilter",
0151     SelectedTriggerType = cms.int32(1)
0152 )
0153 
0154 # L1 Trigger Bit Selection (bit 40 and 41 for BSC trigger)
0155 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
0156 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
0157 process.hltLevel1GTSeed.L1TechTriggerSeeding = True
0158 process.hltLevel1GTSeed.L1SeedsLogicalExpression = 'NOT (36 OR 37 OR 38 OR 39)'
0159 
0160 # HLT trigger selection (HLT_ZeroBias)
0161 # modified for 0 Tesla HLT menu (no ZeroBias_*)
0162 process.load('HLTrigger.HLTfilters.hltHighLevel_cfi')
0163 if (process.runType.getRunType() == process.runType.hi_run):
0164     #--------------------------
0165     # HI Runs HLT path
0166     #--------------------------
0167     process.hltHighLevel.HLTPaths = ['HLT_ZeroBias_*' , 'HLT_HIZeroBias*' , 'HLT_ZeroBias1_*' , 'HLT_PAZeroBias_*' , 'HLT_PAZeroBias1_*', 'HLT_PAL1MinimumBiasHF_OR_SinglePixelTrack_*' , 'HLT_HICentralityVeto*','HLT_HIMinimumBias*', 'HLT_HIPhysics*']
0168 else:
0169     process.hltHighLevel.HLTPaths = ['HLT_ZeroBias_*' , 'HLT_ZeroBias1_*' , 'HLT_PAZeroBias_*' , 'HLT_PAZeroBias1_*', 'HLT_PAL1MinimumBiasHF_OR_SinglePixelTrack_*']
0170 process.hltHighLevel.andOr = True
0171 process.hltHighLevel.throw = False
0172 
0173 if (process.runType.getRunType() == process.runType.hi_run):
0174     process.RecoForDQM_LocalReco     = cms.Sequence(process.siPixelDigis*process.siStripDigis*process.trackerlocalreco)
0175 else :
0176     process.RecoForDQM_LocalReco     = cms.Sequence(process.siPixelDigis*process.siStripDigis*process.gtDigis*process.trackerlocalreco)
0177 
0178 process.DQMCommon = cms.Sequence(process.dqmEnv*process.dqmEnvTr*process.dqmSaver)#*process.dqmSaverPB)
0179 
0180 print("Running with run type = ", process.runType.getRunTypeName())
0181 
0182 ### HEAVY ION SETTING
0183 if process.runType.getRunType() == process.runType.hi_run:
0184     rawDataRepackerLabel = 'rawDataRepacker'
0185     process.castorDigis.InputLabel = rawDataRepackerLabel
0186     process.csctfDigis.producer = rawDataRepackerLabel
0187     process.dttfDigis.DTTF_FED_Source = rawDataRepackerLabel
0188     process.ecalDigisCPU.InputLabel = rawDataRepackerLabel
0189     process.ecalPreshowerDigis.sourceTag = rawDataRepackerLabel
0190     process.gctDigis.inputLabel = rawDataRepackerLabel
0191     process.hcalDigis.InputLabel = rawDataRepackerLabel
0192     process.muonCSCDigis.InputObjects = rawDataRepackerLabel
0193     process.muonDTDigis.inputLabel = rawDataRepackerLabel
0194     process.muonRPCDigis.InputLabel = rawDataRepackerLabel
0195     process.scalersRawToDigi.scalersInputTag = rawDataRepackerLabel
0196     process.siPixelDigis.cpu.InputLabel = rawDataRepackerLabel
0197     process.siStripDigis.ProductLabel = rawDataRepackerLabel
0198     process.tcdsDigis.InputLabel = rawDataRepackerLabel
0199 
0200     if ((process.runType.getRunType() == process.runType.hi_run) and live):
0201         process.source.SelectEvents = [
0202 #            'HLT_HICentralityVeto*', # present in 2018 and 2022 HIon menus
0203             'HLT_HIMinimumBias*',     # replaced HLT_HICentralityVeto starting from the 2023 HIon menu
0204 #            'HLT_HIZeroBias*',       # present in DQM stream of HIon menu, but not used in this client
0205             'HLT_HIPhysics*'
0206         ]
0207 
0208     process.load('RecoTracker.IterativeTracking.InitialStepPreSplitting_cff')
0209     process.InitialStepPreSplittingTask.remove(process.initialStepTrackRefsForJetsPreSplitting)
0210     process.InitialStepPreSplittingTask.remove(process.caloTowerForTrkPreSplitting)
0211     process.InitialStepPreSplittingTask.remove(process.ak4CaloJetsForTrkPreSplitting)
0212     process.InitialStepPreSplittingTask.remove(process.jetsForCoreTrackingPreSplitting)
0213     process.InitialStepPreSplittingTask.remove(process.siPixelClusters)
0214     process.InitialStepPreSplittingTask.remove(process.siPixelRecHits)
0215     process.InitialStepPreSplittingTask.remove(process.MeasurementTrackerEvent)
0216 
0217     # Redefinition of siPixelClusters: has to be after RecoTracker.IterativeTracking.InitialStepPreSplitting_cff
0218     process.load("RecoLocalTracker.SiPixelClusterizer.SiPixelClusterizer_cfi")
0219 
0220     # Select events based on the pixel cluster multiplicity
0221     import  HLTrigger.special.hltPixelActivityFilter_cfi
0222     process.multFilter = HLTrigger.special.hltPixelActivityFilter_cfi.hltPixelActivityFilter.clone(
0223         inputTag = 'siPixelClusters',
0224         minClusters = 1,
0225         maxClusters = 50000
0226     )
0227 
0228     from RecoTracker.TkSeedingLayers.PixelLayerTriplets_cfi import *
0229     process.PixelLayerTriplets.BPix.HitProducer = 'siPixelRecHitsPreSplitting'
0230     process.PixelLayerTriplets.FPix.HitProducer = 'siPixelRecHitsPreSplitting'
0231     from RecoTracker.PixelTrackFitting.PixelTracks_cff import *
0232     process.pixelTracksHitTriplets.SeedComparitorPSet.clusterShapeCacheSrc = 'siPixelClusterShapeCachePreSplitting'
0233 
0234     process.RecoForDQM_TrkReco = cms.Sequence(
0235         process.offlineBeamSpot
0236       * process.MeasurementTrackerEventPreSplitting
0237       * process.siPixelClusterShapeCachePreSplitting
0238       * process.recopixelvertexing
0239       * process.InitialStepPreSplitting
0240     )
0241 
0242     # append the approximate clusters monitoring for the HI run case
0243     from DQM.SiStripMonitorApproximateCluster.SiStripMonitorApproximateCluster_cfi import SiStripMonitorApproximateCluster
0244     process.siStripApproximateClusterComparator = SiStripMonitorApproximateCluster.clone(
0245         compareClusters = True,
0246         ClustersProducer = "siStripClusters"
0247     )
0248 
0249     process.p = cms.Path(
0250         process.scalersRawToDigi*
0251         process.tcdsDigis*
0252         process.onlineMetaDataDigis*
0253         process.APVPhases*
0254         process.consecutiveHEs*
0255         process.hltTriggerTypeFilter*
0256         process.RecoForDQM_LocalReco*
0257         process.siPixelClusters*
0258         process.DQMCommon*
0259         process.multFilter*
0260         ##### TRIGGER SELECTION #####
0261         process.hltHighLevel*
0262         process.RecoForDQM_TrkReco*
0263         process.siStripApproximateClusterComparator
0264     )
0265 
0266 ### process customizations included here
0267 from DQM.Integration.config.online_customizations_cfi import *
0268 process = customise(process)
0269 print("Final Source settings:", process.source)