Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-03 19:40:35

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