Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-14 23:57:21

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("BeamMonitor")
0005 
0006 #-------------------------------------
0007 # ALL Common Stuff for PP and H.I
0008 #-------------------------------------
0009 process.load("DQM.Integration.test.inputsource_cfi")
0010 
0011 #--------------------------
0012 # Filters
0013 #--------------------------
0014 # HLT Filter
0015 process.load("HLTrigger.special.HLTTriggerTypeFilter_cfi")
0016 # 0=random, 1=physics, 2=calibration, 3=technical
0017 process.hltTriggerTypeFilter.SelectedTriggerType = 1
0018 
0019 
0020 #----------------------------
0021 # DQM Live Environment
0022 #-----------------------------
0023 process.load("DQM.Integration.test.environment_cfi")
0024 process.dqmEnv.subSystemFolder = 'BeamMonitor'
0025 
0026 import DQMServices.Components.DQMEnvironment_cfi
0027 process.dqmEnvPixelLess = DQMServices.Components.DQMEnvironment_cfi.dqmEnv.clone()
0028 process.dqmEnvPixelLess.subSystemFolder = 'BeamMonitor_PixelLess'
0029 
0030 #----------------------------
0031 # BeamMonitor
0032 #-----------------------------
0033 process.load("DQM.BeamMonitor.BeamMonitor_cff")
0034 process.load("DQM.BeamMonitor.BeamMonitorBx_cff")
0035 process.load("DQM.BeamMonitor.BeamMonitor_PixelLess_cff")
0036 process.load("DQM.BeamMonitor.BeamConditionsMonitor_cff")
0037 
0038 #---------------------------
0039 # Reco reltaed
0040 #---------------------------
0041 
0042 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0043 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0044 process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0045 
0046 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0047 
0048 # Change Beam Monitor variables
0049 if process.dqmSaver.producer.value() is "Playback":
0050   process.dqmBeamMonitor.BeamFitter.WriteAscii = False
0051   process.dqmBeamMonitor.BeamFitter.AsciiFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResults.txt'
0052   process.dqmBeamMonitor.BeamFitter.WriteDIPAscii = True
0053   process.dqmBeamMonitor.BeamFitter.DIPFileName = '/nfshome0/dqmdev/BeamMonitorDQM/BeamFitResults.txt'
0054 else:
0055   process.dqmBeamMonitor.BeamFitter.WriteAscii = True
0056   process.dqmBeamMonitor.BeamFitter.AsciiFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResults.txt'
0057   process.dqmBeamMonitor.BeamFitter.WriteDIPAscii = True
0058   process.dqmBeamMonitor.BeamFitter.DIPFileName = '/nfshome0/dqmpro/BeamMonitorDQM/BeamFitResults.txt'
0059 #process.dqmBeamMonitor.BeamFitter.SaveFitResults = False
0060 #process.dqmBeamMonitor.BeamFitter.OutputFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResults.root'
0061   process.dqmBeamMonitorBx.BeamFitter.WriteAscii = True
0062   process.dqmBeamMonitorBx.BeamFitter.AsciiFileName = '/nfshome0/yumiceva/BeamMonitorDQM/BeamFitResults_Bx.txt'
0063 
0064 
0065 ## TKStatus
0066 process.dqmTKStatus = cms.EDAnalyzer("TKStatus",
0067         BeamFitter = cms.PSet(
0068         DIPFileName = process.dqmBeamMonitor.BeamFitter.DIPFileName
0069         )
0070 )
0071 
0072 
0073 
0074 process.dqmcommon = cms.Sequence(process.dqmEnv
0075                                  *process.dqmSaver)
0076 
0077 process.monitor = cms.Sequence(process.dqmBeamMonitor)
0078 
0079 
0080 
0081 #--------------------------
0082 # Proton Proton Stuff
0083 #--------------------------
0084 
0085 if (process.runType.getRunType() == process.runType.pp_run or process.runType.getRunType() == process.runType.cosmic_run):
0086     print("Running pp paths")
0087 
0088     process.EventStreamHttpReader.SelectEvents = cms.untracked.PSet(
0089               SelectEvents = cms.vstring('HLT_L1*',
0090                                          'HLT_Jet*',
0091                                          'HLT_*Cosmic*',
0092                                          'HLT_HT*',
0093                                          'HLT_MinBias_*',
0094                                          'HLT_Physics*',
0095                                          'HLT_ZeroBias_v*'))
0096 
0097     process.load("Configuration.StandardSequences.Reconstruction_cff")
0098 
0099     #Offline Beam Spot
0100     process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
0101 
0102     ## Offline PrimaryVertices
0103     import RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi
0104     process.offlinePrimaryVertices = RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi.offlinePrimaryVertices.clone()
0105     process.offlinePrimaryVertices.TrackLabel = cms.InputTag("firstStepTracksWithQuality")
0106     process.dqmBeamMonitor.BeamFitter.TrackCollection = cms.untracked.InputTag('firstStepTracksWithQuality')
0107     process.dqmBeamMonitorBx.BeamFitter.TrackCollection = cms.untracked.InputTag('firstStepTracksWithQuality')
0108     #### END OF TRACKING RECONSTRUCTION ####
0109 
0110     process.dqmBeamMonitor.OnlineMode = True                  ## in MC the LS are not ordered??
0111     process.dqmBeamMonitor.resetEveryNLumi = 5
0112     process.dqmBeamMonitor.resetPVEveryNLumi = 5
0113     process.dqmBeamMonitor.PVFitter.minNrVerticesForFit = 25
0114 
0115     #TriggerName for selecting pv for DIP publication, NO wildcard needed here
0116     #it will pick all triggers which has these strings in theri name
0117     process.dqmBeamMonitor.jetTrigger  = cms.untracked.vstring("HLT_ZeroBias_v",
0118                                                                "HLT_Jet300_v",
0119                                                                "HLT_QuadJet70_v")
0120 
0121     process.dqmBeamMonitor.hltResults = cms.InputTag("TriggerResults","","HLT")
0122 
0123     process.tracking_FirstStep = cms.Sequence(process.siPixelDigis
0124                                          *process.siStripDigis
0125                                          *process.trackerlocalreco
0126                                          *process.offlineBeamSpot
0127                                          *process.recopixelvertexing
0128                                          *process.firstStep)
0129 
0130 
0131     process.p = cms.Path(process.scalersRawToDigi
0132                          *process.onlineMetaDataDigis
0133                          *process.dqmTKStatus
0134                          *process.hltTriggerTypeFilter
0135                          *process.dqmcommon
0136                          *process.tracking_FirstStep
0137                          *process.offlinePrimaryVertices
0138                          *process.monitor)
0139 
0140 
0141 #--------------------------------------------------
0142 # Heavy Ion Stuff
0143 #--------------------------------------------------
0144 
0145 if (process.runType.getRunType() == process.runType.hi_run):
0146    
0147     print("Running HI paths")
0148     process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker")
0149     process.csctfDigis.producer = cms.InputTag("rawDataRepacker")
0150     process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataRepacker")
0151     process.ecalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0152     process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataRepacker")
0153     process.gctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0154     process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataRepacker")
0155     process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataRepacker")
0156     process.hcalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0157     process.muonCSCDigis.InputObjects = cms.InputTag("rawDataRepacker")
0158     process.muonDTDigis.inputLabel = cms.InputTag("rawDataRepacker")
0159     process.muonRPCDigis.InputLabel = cms.InputTag("rawDataRepacker")
0160     process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataRepacker")
0161     process.siPixelDigis.InputLabel = cms.InputTag("rawDataRepacker")
0162     process.siStripDigis.ProductLabel = cms.InputTag("rawDataRepacker")
0163 
0164 
0165 #----------------------------                                                                                                                                                      
0166 # Event Source
0167 #-----------------------------
0168     process.EventStreamHttpReader.SelectEvents =  cms.untracked.PSet(
0169               SelectEvents = cms.vstring('HLT_HI*')
0170             )
0171  
0172     # Beamspot DQM options
0173     process.dqmBeamMonitor.OnlineMode = True                  
0174     process.dqmBeamMonitor.resetEveryNLumi = 10
0175     process.dqmBeamMonitor.resetPVEveryNLumi = 10
0176     process.dqmBeamMonitor.PVFitter.minNrVerticesForFit = 20
0177     process.dqmBeamMonitor.BeamFitter.MinimumTotalLayers = 3   ## using pixel triplets
0178 
0179     #TriggerName for selecting pv for DIP publication, NO wildcard needed here
0180     #it will pick all triggers which has these strings in theri name
0181     process.dqmBeamMonitor.jetTrigger  = cms.untracked.vstring("HLT_HI")
0182                                                                
0183     process.dqmBeamMonitor.hltResults = cms.InputTag("TriggerResults","","HLT")
0184  
0185     ## Load Heavy Ion Sequence
0186     process.load("Configuration.StandardSequences.ReconstructionHeavyIons_cff") 
0187  
0188     # Select events based on the pixel cluster multiplicity
0189     import  HLTrigger.special.hltPixelActivityFilter_cfi
0190     process.multFilter = HLTrigger.special.hltPixelActivityFilter_cfi.hltPixelActivityFilter.clone(
0191                          inputTag  = cms.InputTag('siPixelClusters'),
0192                          minClusters = cms.uint32(150),
0193                          maxClusters = cms.uint32(50000)
0194                 )
0195  
0196     process.filter_step = cms.Sequence( process.siPixelDigis
0197                                        *process.siPixelClusters
0198                                        #*process.multFilter
0199                                   )
0200 
0201     process.HIRecoForDQM = cms.Sequence( process.siPixelDigis
0202                                         *process.siPixelClusters
0203                                         *process.siPixelRecHits
0204                                         *process.offlineBeamSpot
0205                                         *process.hiPixelVertices
0206                                         *process.hiPixel3PrimTracks
0207                                    )
0208  
0209     # use HI pixel tracking and vertexing
0210     process.dqmBeamMonitor.BeamFitter.TrackCollection = cms.untracked.InputTag('hiPixel3PrimTracks')
0211     process.dqmBeamMonitorBx.BeamFitter.TrackCollection = cms.untracked.InputTag('hiPixel3PrimTracks')
0212     process.dqmBeamMonitor.primaryVertex = cms.untracked.InputTag('hiSelectedVertex')
0213     process.dqmBeamMonitor.PVFitter.VertexCollection = cms.untracked.InputTag('hiSelectedVertex')
0214  
0215  
0216     # make pixel vertexing less sensitive to incorrect beamspot
0217     process.hiPixel3ProtoTracks.RegionFactoryPSet.RegionPSet.originRadius = 0.2
0218     process.hiPixel3ProtoTracks.RegionFactoryPSet.RegionPSet.fixedError = 0.5
0219     process.hiSelectedProtoTracks.maxD0Significance = 100
0220     process.hiPixelAdaptiveVertex.TkFilterParameters.maxD0Significance = 100
0221     process.hiPixelAdaptiveVertex.useBeamConstraint = False
0222     process.hiPixelAdaptiveVertex.PVSelParameters.maxDistanceToBeam = 1.0
0223  
0224  
0225     #--------------------------
0226     # Scheduling             
0227     #--------------------------
0228                          
0229     process.hi = cms.Path(process.scalersRawToDigi
0230                         *process.onlineMetaDataDigis
0231                         *process.dqmTKStatus
0232                         *process.hltTriggerTypeFilter
0233                         *process.filter_step
0234                         *process.HIRecoForDQM
0235                         *process.dqmcommon
0236                         *process.monitor)