Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-01-27 02:45:09

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