Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-01-08 23:50:23

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_approxSiStripClusters_cff import Run3_pp_on_PbPb_approxSiStripClusters
0007   process = cms.Process("BeamPixel", Run3_pp_on_PbPb_approxSiStripClusters)
0008 else:
0009   from Configuration.Eras.Era_Run3_cff import Run3
0010   process = cms.Process("BeamPixel", Run3)
0011 
0012 unitTest = False
0013 if 'unitTest=True' in sys.argv:
0014     unitTest = True
0015 
0016 
0017 #----------------------------
0018 # Common for PP and HI running
0019 #----------------------------
0020 if unitTest == True:
0021     process.load("DQM.Integration.config.unittestinputsource_cfi")
0022     from DQM.Integration.config.unittestinputsource_cfi import options
0023 else:
0024     process.load("DQM.Integration.config.inputsource_cfi")
0025     from DQM.Integration.config.inputsource_cfi import options
0026 # Use this to run locally (for testing purposes)
0027 #process.load("DQM.Integration.config.fileinputsource_cfi")
0028 #from DQM.Integration.config.fileinputsource_cfi import options
0029 
0030 
0031 #----------------------------
0032 # HLT Filter
0033 #----------------------------
0034 # 0=random, 1=physics, 2=calibration, 3=technical
0035 process.hltTriggerTypeFilter = cms.EDFilter("HLTTriggerTypeFilter", SelectedTriggerType = cms.int32(1))
0036 
0037 
0038 #----------------------------
0039 # DQM Environment
0040 #----------------------------
0041 process.load("DQM.Integration.config.environment_cfi")
0042 process.dqmEnv.subSystemFolder = "BeamPixel"
0043 process.dqmSaver.tag = "BeamPixel"
0044 process.dqmSaver.runNumber = options.runNumber
0045 process.dqmSaverPB.tag = 'BeamPixel'
0046 process.dqmSaverPB.runNumber = options.runNumber
0047 
0048 #----------------------------
0049 # Conditions
0050 #----------------------------
0051 # Use this to run locally (for testing purposes), choose the right GT
0052 #process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0053 #from Configuration.AlCa.GlobalTag import GlobalTag
0054 #process.GlobalTag = GlobalTag(process.GlobalTag, "auto:run3_data", "")
0055 # Otherwise use this
0056 process.load("DQM.Integration.config.FrontierCondition_GT_cfi")
0057 
0058 
0059 #----------------------------
0060 # Sub-system Configuration
0061 #----------------------------
0062 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0063 process.load("Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff")
0064 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0065 
0066 
0067 #----------------------------
0068 # Define Sequences
0069 #----------------------------
0070 process.dqmModules  = cms.Sequence(process.dqmEnv + process.dqmSaver + process.dqmSaverPB)
0071 process.physTrigger = cms.Sequence(process.hltTriggerTypeFilter)
0072 
0073 
0074 #----------------------------
0075 # Process Customizations
0076 #----------------------------
0077 from DQM.Integration.config.online_customizations_cfi import *
0078 process = customise(process)
0079 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0080 
0081 
0082 #----------------------------
0083 # Tracking General Configuration
0084 #----------------------------
0085 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi")
0086 process.load("RecoLocalTracker.Configuration.RecoLocalTracker_cff")
0087 process.load("TrackingTools.TransientTrack.TransientTrackBuilder_cfi")
0088 
0089 
0090 #----------------------------
0091 # Pixel-Tracks&Vertices Config
0092 #----------------------------
0093 from RecoPixelVertexing.PixelLowPtUtilities.siPixelClusterShapeCache_cfi import *
0094 process.siPixelClusterShapeCachePreSplitting = siPixelClusterShapeCache.clone(src = 'siPixelClustersPreSplitting')
0095 process.load("RecoLocalTracker.SiPixelRecHits.PixelCPEGeneric_cfi")
0096 process.load("RecoPixelVertexing.Configuration.RecoPixelVertexing_cff")
0097 from RecoVertex.PrimaryVertexProducer.OfflinePixel3DPrimaryVertices_cfi import *
0098 process.pixelVertices = pixelVertices.clone(
0099     TkFilterParameters = dict(
0100     minPt = process.pixelTracksTrackingRegions.RegionPSet.ptMin)
0101 )
0102 process.pixelTracksTrackingRegions.RegionPSet.originRadius     = 0.4
0103 process.pixelTracksTrackingRegions.RegionPSet.originHalfLength = 15.
0104 process.pixelTracksTrackingRegions.RegionPSet.originXPos       = 0.08
0105 process.pixelTracksTrackingRegions.RegionPSet.originYPos       = -0.03
0106 process.pixelTracksTrackingRegions.RegionPSet.originZPos       = 0.
0107 
0108 
0109 #----------------------------
0110 # Proton-Proton Specific Section
0111 #----------------------------
0112 if (process.runType.getRunType() == process.runType.pp_run or process.runType.getRunType() == process.runType.pp_run_stage1 or 
0113     process.runType.getRunType() == process.runType.cosmic_run or process.runType.getRunType() == process.runType.cosmic_run_stage1 or 
0114     process.runType.getRunType() == process.runType.hpu_run or process.runType.getRunType() == process.runType.commissioning_run ):
0115     print("[beampixel_dqm_sourceclient-live_cfg]::running pp")
0116 
0117 
0118     #----------------------------
0119     # Tracking Configuration
0120     #----------------------------
0121     process.castorDigis.InputLabel           = "rawDataCollector"
0122     process.csctfDigis.producer              = "rawDataCollector"
0123     process.dttfDigis.DTTF_FED_Source        = "rawDataCollector"
0124     process.ecalDigis.cpu.InputLabel         = "rawDataCollector"
0125     process.ecalPreshowerDigis.sourceTag     = "rawDataCollector"
0126     process.gctDigis.inputLabel              = "rawDataCollector"
0127     process.gtDigis.DaqGtInputTag            = "rawDataCollector"
0128     process.hcalDigis.InputLabel             = "rawDataCollector"
0129     process.muonCSCDigis.InputObjects        = "rawDataCollector"
0130     process.muonDTDigis.inputLabel           = "rawDataCollector"
0131     process.muonRPCDigis.InputLabel          = "rawDataCollector"
0132     process.scalersRawToDigi.scalersInputTag = "rawDataCollector"
0133     process.siPixelDigis.cpu.InputLabel      = "rawDataCollector"
0134     process.siStripDigis.ProductLabel        = "rawDataCollector"
0135 
0136     
0137     #----------------------------
0138     # pixelVertexDQM Config
0139     #----------------------------
0140     process.pixelVertexDQM = DQMEDAnalyzer('Vx3DHLTAnalyzer',
0141                                             vertexCollection   = cms.untracked.InputTag("pixelVertices"),
0142                                             pixelHitCollection = cms.untracked.InputTag("siPixelRecHitsPreSplitting"),
0143                                             debugMode          = cms.bool(True),
0144                                             nLumiFit           = cms.uint32(2),
0145                                             maxLumiIntegration = cms.uint32(15),
0146                                             nLumiXaxisRange    = cms.uint32(5000),
0147                                             dataFromFit        = cms.bool(True),
0148                                             minNentries        = cms.uint32(20),
0149                                             # If the histogram has at least "minNentries" then extract Mean and RMS,
0150                                             # or, if we are performing the fit, the number of vertices must be greater
0151                                             # than minNentries otherwise it waits for other nLumiFit
0152                                             xRange             = cms.double(0.8),
0153                                             xStep              = cms.double(0.001),
0154                                             yRange             = cms.double(0.8),
0155                                             yStep              = cms.double(0.001),
0156                                             zRange             = cms.double(30.0),
0157                                             zStep              = cms.double(0.04),
0158                                             VxErrCorr          = cms.double(1.0), # Was 1.2, changed to 1.0 in Run3 13.6 TeV collisions - Keep checking this with later release
0159                                             minVxDoF           = cms.double(10.0),
0160                                             minVxWgt           = cms.double(0.5),
0161                                             fileName           = cms.string("/nfshome0/dqmdev/BeamMonitorDQM/BeamPixelResults.txt"))
0162 
0163 
0164 #----------------------------
0165 # Heavy Ion Specific Section
0166 #----------------------------
0167 if (process.runType.getRunType() == process.runType.hi_run):
0168     print("[beampixel_dqm_sourceclient-live_cfg]::running HI")
0169 
0170 
0171     #----------------------------
0172     # Tracking Configuration
0173     #----------------------------
0174     process.castorDigis.InputLabel           = "rawDataRepacker"
0175     process.csctfDigis.producer              = "rawDataRepacker"
0176     process.dttfDigis.DTTF_FED_Source        = "rawDataRepacker"
0177     process.ecalDigis.cpu.InputLabel         = "rawDataRepacker"
0178     process.ecalPreshowerDigis.sourceTag     = "rawDataRepacker"
0179     process.gctDigis.inputLabel              = "rawDataRepacker"
0180     process.gtDigis.DaqGtInputTag            = "rawDataRepacker"
0181     process.hcalDigis.InputLabel             = "rawDataRepacker"
0182     process.muonCSCDigis.InputObjects        = "rawDataRepacker"
0183     process.muonDTDigis.inputLabel           = "rawDataRepacker"
0184     process.muonRPCDigis.InputLabel          = "rawDataRepacker"
0185     process.scalersRawToDigi.scalersInputTag = "rawDataRepacker"
0186     process.siPixelDigis.cpu.InputLabel      = "rawDataRepacker"
0187     process.siStripDigis.ProductLabel        = "rawDataRepacker"
0188 
0189 
0190     #----------------------------
0191     # pixelVertexDQM Config
0192     #----------------------------
0193     process.pixelVertexDQM = DQMEDAnalyzer('Vx3DHLTAnalyzer',
0194                                             vertexCollection   = cms.untracked.InputTag("pixelVertices"),
0195                                             pixelHitCollection = cms.untracked.InputTag("siPixelRecHitsPreSplitting"),
0196                                             debugMode          = cms.bool(True),
0197                                             nLumiFit           = cms.uint32(5),
0198                                             maxLumiIntegration = cms.uint32(15),
0199                                             nLumiXaxisRange    = cms.uint32(5000),
0200                                             dataFromFit        = cms.bool(True),
0201                                             minNentries        = cms.uint32(20),
0202                                             # If the histogram has at least "minNentries" then extract Mean and RMS,
0203                                             # or, if we are performing the fit, the number of vertices must be greater
0204                                             # than minNentries otherwise it waits for other nLumiFit
0205                                             xRange             = cms.double(0.8),
0206                                             xStep              = cms.double(0.001),
0207                                             yRange             = cms.double(0.8),
0208                                             yStep              = cms.double(0.001),
0209                                             zRange             = cms.double(30.0),
0210                                             zStep              = cms.double(0.04),
0211                                             VxErrCorr          = cms.double(1.0), # Was 1.2, changed to 1.0 in Run3 13.6 TeV collisions - Keep checking this with later release
0212                                             minVxDoF           = cms.double(10.0),
0213                                             minVxWgt           = cms.double(0.5),
0214                                             fileName           = cms.string("/nfshome0/dqmdev/BeamMonitorDQM/BeamPixelResults.txt"))
0215 
0216 
0217 #----------------------------
0218 # File to save beamspot info
0219 #----------------------------
0220 if process.dqmRunConfig.type.value() == "production":
0221     process.pixelVertexDQM.fileName = "/nfshome0/dqmpro/BeamMonitorDQM/BeamPixelResults.txt"
0222 else:
0223     process.pixelVertexDQM.fileName = "/nfshome0/dqmdev/BeamMonitorDQM/BeamPixelResults.txt"
0224 print("[beampixel_dqm_sourceclient-live_cfg]::saving DIP file into " + str(process.pixelVertexDQM.fileName))
0225 
0226 
0227 #----------------------------
0228 # Pixel-Tracks&Vertices Reco
0229 #----------------------------
0230 process.reconstructionStep = cms.Sequence(process.siPixelDigis*
0231                                           process.siStripDigis*
0232                                           process.striptrackerlocalreco*
0233                                           process.offlineBeamSpot*
0234                                           process.siPixelClustersPreSplitting*
0235                                           process.siPixelRecHitsPreSplitting*
0236                                           process.siPixelClusterShapeCachePreSplitting*
0237                                           process.recopixelvertexing)
0238 
0239 
0240 #----------------------------
0241 # Define Path
0242 #----------------------------
0243 process.p = cms.Path(process.scalersRawToDigi*process.physTrigger*process.reconstructionStep*process.pixelVertexDQM*process.dqmModules)