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 # Common part for PP and H.I Running
0008 #-----------------------------
0009 process.load("DQM.Integration.test.inputsource_cfi")
0010 
0011 
0012 #--------------------------
0013 # HLT Filter
0014 process.load("HLTrigger.special.HLTTriggerTypeFilter_cfi")
0015 # 0=random, 1=physics, 2=calibration, 3=technical
0016 process.hltTriggerTypeFilter.SelectedTriggerType = 1
0017 
0018 
0019 #----------------------------
0020 # DQM Live Environment
0021 #-----------------------------
0022 process.load("DQM.Integration.test.environment_cfi")
0023 process.dqmEnv.subSystemFolder = 'BeamMonitor'
0024 
0025 import DQMServices.Components.DQMEnvironment_cfi
0026 process.dqmEnvPixelLess = DQMServices.Components.DQMEnvironment_cfi.dqmEnv.clone()
0027 process.dqmEnvPixelLess.subSystemFolder = 'BeamMonitor_PixelLess'
0028 
0029 #----------------------------
0030 # BeamMonitor
0031 #-----------------------------
0032 process.load("DQM.BeamMonitor.BeamMonitor_cff")
0033 process.load("DQM.BeamMonitor.BeamMonitorBx_cff")
0034 process.load("DQM.BeamMonitor.BeamMonitor_PixelLess_cff")
0035 process.load("DQM.BeamMonitor.BeamConditionsMonitor_cff")
0036 
0037 
0038 
0039 
0040 ####  SETUP TRACKING RECONSTRUCTION ####
0041 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0042 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff')
0043 process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
0044 
0045 process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
0046 
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 process.dqmcommon = cms.Sequence(process.dqmEnv
0074                                 *process.dqmSaver)
0075 
0076 process.monitor = cms.Sequence(process.dqmBeamMonitor)
0077 
0078 
0079 
0080 #--------------------------
0081 # Proton-Proton Stuff
0082 #--------------------------
0083 
0084 if (process.runType.getRunType() == process.runType.pp_run or process.runType.getRunType() == process.runType.cosmic_run):
0085 
0086     print("Running pp")
0087     process.EventStreamHttpReader.SelectEvents = cms.untracked.PSet(
0088              SelectEvents = cms.vstring('HLT_L1*',
0089                                         'HLT_Jet*',
0090                                         'HLT_*Cosmic*',
0091                                         'HLT_HT*',
0092                                         'HLT_MinBias_*',
0093                                         'HLT_Physics*',
0094                                         'HLT_ZeroBias_v*')
0095                                       )
0096 
0097     process.load("Configuration.StandardSequences.Reconstruction_cff")
0098     process.load("RecoTracker.IterativeTracking.iterativeTk_cff")
0099 
0100     ## Pixelless Tracking
0101     process.load('RecoTracker/Configuration/RecoTrackerNotStandard_cff')
0102     process.MeasurementTracker.pixelClusterProducer = cms.string("")
0103 
0104     # Offline Beam Spot
0105     process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
0106 
0107     ## Offline PrimaryVertices
0108     import RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi
0109     process.offlinePrimaryVertices = RecoVertex.PrimaryVertexProducer.OfflinePrimaryVertices_cfi.offlinePrimaryVertices.clone()
0110 
0111 
0112     process.dqmBeamMonitor.OnlineMode = True              
0113     process.dqmBeamMonitor.resetEveryNLumi = 5
0114     process.dqmBeamMonitor.resetPVEveryNLumi = 5
0115     process.dqmBeamMonitor.PVFitter.minNrVerticesForFit = 25
0116 
0117     process.dqmBeamMonitor.BeamFitter.TrackCollection = cms.untracked.InputTag('generalTracks')
0118 
0119 
0120     process.offlinePrimaryVertices.TrackLabel = cms.InputTag("generalTracks")
0121     process.offlinePrimaryVertices.label=cms.string("")
0122     process.offlinePrimaryVertices.minNdof=cms.double(0.0)
0123     process.offlinePrimaryVertices.useBeamConstraint=cms.bool(False)
0124 
0125 
0126     #TriggerName for selecting pv for DIP publication, NO wildcard needed here
0127     #it will pick all triggers which has these strings in theri name
0128     process.dqmBeamMonitor.jetTrigger  = cms.untracked.vstring("HLT_ZeroBias_v",
0129                                                                "HLT_Jet300_v",
0130                                                                "HLT_QuadJet70_v")
0131 
0132     process.dqmBeamMonitor.hltResults = cms.InputTag("TriggerResults","","HLT")
0133 
0134     #fast general track reco
0135     process.iterTracking =cms.Sequence(process.InitialStep
0136                                   *process.LowPtTripletStep
0137                                   *process.PixelPairStep
0138                                   *process.DetachedTripletStep
0139                                   *process.MixedTripletStep
0140                                   *process.PixelLessStep
0141                                   *process.TobTecStep
0142                                   *process.generalTracks) 
0143 
0144 
0145     process.tracking_FirstStep = cms.Sequence(process.siPixelDigis
0146                                          *process.siStripDigis
0147                                          *process.trackerlocalreco
0148                                          *process.offlineBeamSpot
0149                                          *process.recopixelvertexing
0150                                          *process.iterTracking)
0151 
0152 
0153     process.p = cms.Path(process.scalersRawToDigi
0154                          *process.onlineMetaDataDigis
0155                          *process.dqmTKStatus
0156                          *process.hltTriggerTypeFilter
0157                          *process.dqmcommon
0158                          *process.tracking_FirstStep
0159                          *process.offlinePrimaryVertices
0160                          *process.monitor)
0161 
0162 
0163 
0164 
0165 #--------------------------------------------------
0166 # Heavy Ion Stuff
0167 #--------------------------------------------------
0168 
0169 if (process.runType.getRunType() == process.runType.hi_run):
0170 
0171     print("Running HI")
0172     process.castorDigis.InputLabel = cms.InputTag("rawDataRepacker")
0173     process.csctfDigis.producer = cms.InputTag("rawDataRepacker")
0174     process.dttfDigis.DTTF_FED_Source = cms.InputTag("rawDataRepacker")
0175     process.ecalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0176     process.ecalPreshowerDigis.sourceTag = cms.InputTag("rawDataRepacker")
0177     process.gctDigis.inputLabel = cms.InputTag("rawDataRepacker")
0178     process.gtDigis.DaqGtInputTag = cms.InputTag("rawDataRepacker")
0179     process.gtEvmDigis.EvmGtInputTag = cms.InputTag("rawDataRepacker")
0180     process.hcalDigis.InputLabel = cms.InputTag("rawDataRepacker")
0181     process.muonCSCDigis.InputObjects = cms.InputTag("rawDataRepacker")
0182     process.muonDTDigis.inputLabel = cms.InputTag("rawDataRepacker")
0183     process.muonRPCDigis.InputLabel = cms.InputTag("rawDataRepacker")
0184     process.scalersRawToDigi.scalersInputTag = cms.InputTag("rawDataRepacker")
0185 
0186     #----------------------------
0187     # Event Source
0188     #-----------------------------
0189     process.EventStreamHttpReader.SelectEvents =  cms.untracked.PSet(
0190           SelectEvents = cms.vstring(
0191                                      'HLT_HI*'
0192                                         )
0193                                      )
0194 
0195     process.dqmBeamMonitor.OnlineMode = True                  ## in MC the LS are not ordered??
0196     process.dqmBeamMonitor.resetEveryNLumi = 10
0197     process.dqmBeamMonitor.resetPVEveryNLumi = 10
0198     process.dqmBeamMonitor.BeamFitter.MinimumTotalLayers = 3   ## using pixel triplets
0199     process.dqmBeamMonitor.PVFitter.minNrVerticesForFit = 20
0200 
0201 
0202     process.dqmBeamMonitor.jetTrigger  = cms.untracked.vstring("HLT_HI")
0203 
0204     process.dqmBeamMonitor.hltResults = cms.InputTag("TriggerResults","","HLT")
0205 
0206 
0207     ## Load Heavy Ion Sequence
0208     process.load("Configuration.StandardSequences.ReconstructionHeavyIons_cff") ## HI sequences
0209 
0210     # Select events based on the pixel cluster multiplicity
0211     import  HLTrigger.special.hltPixelActivityFilter_cfi
0212     process.multFilter = HLTrigger.special.hltPixelActivityFilter_cfi.hltPixelActivityFilter.clone(
0213       inputTag  = cms.InputTag('siPixelClusters'),
0214       minClusters = cms.uint32(150),
0215       maxClusters = cms.uint32(50000)
0216       )
0217 
0218     process.filter_step = cms.Sequence( process.siPixelDigis
0219                                        *process.siPixelClusters
0220                                        #*process.multFilter
0221                                   )
0222 
0223     process.HIRecoForDQM = cms.Sequence( process.siPixelDigis
0224                                     *process.siPixelClusters
0225                                     *process.siPixelRecHits
0226                                     *process.offlineBeamSpot
0227                                     *process.hiPixelVertices
0228                                     *process.hiPixel3PrimTracks
0229                                    )
0230 
0231     # use HI pixel tracking and vertexing
0232     process.dqmBeamMonitor.BeamFitter.TrackCollection = cms.untracked.InputTag('hiPixel3PrimTracks')
0233     process.dqmBeamMonitorBx.BeamFitter.TrackCollection = cms.untracked.InputTag('hiPixel3PrimTracks')
0234     process.dqmBeamMonitor.primaryVertex = cms.untracked.InputTag('hiSelectedVertex')
0235     process.dqmBeamMonitor.PVFitter.VertexCollection = cms.untracked.InputTag('hiSelectedVertex')
0236 
0237 
0238     # make pixel vertexing less sensitive to incorrect beamspot
0239     process.hiPixel3ProtoTracks.RegionFactoryPSet.RegionPSet.originRadius = 0.2
0240     process.hiPixel3ProtoTracks.RegionFactoryPSet.RegionPSet.fixedError = 0.5
0241     process.hiSelectedProtoTracks.maxD0Significance = 100
0242     process.hiPixelAdaptiveVertex.TkFilterParameters.maxD0Significance = 100
0243     process.hiPixelAdaptiveVertex.vertexCollections.useBeamConstraint = False
0244     #not working due to wrong tag of reco
0245     process.hiPixelAdaptiveVertex.vertexCollections.maxDistanceToBeam = 1.0
0246 
0247 
0248 
0249     
0250     process.p = cms.Path(process.scalersRawToDigi
0251                         *process.onlineMetaDataDigis
0252                         *process.dqmTKStatus
0253                         *process.hltTriggerTypeFilter
0254                         *process.filter_step
0255                         *process.HIRecoForDQM
0256                         *process.dqmcommon
0257                         *process.monitor)
0258