File indexing completed on 2024-07-28 22:48:48
0001 """
0002 example run scenario:
0003
0004 cmsRun global_reco_PPS_test_cfg.py globalTag=auto:run3_data_prompt inputFiles=file:run_xyz.root maxEvents=100 dqm=1
0005
0006 """
0007
0008 import FWCore.ParameterSet.Config as cms
0009 from Configuration.Eras.Era_Run3_cff import Run3
0010 import FWCore.ParameterSet.VarParsing as VarParsing
0011
0012
0013 default_input = '/store/data/Run2024E/ZeroBias/AOD/PromptReco-v1/000/381/380/00000/cc9dc36a-15d9-430b-9494-058589e42cf9.root'
0014
0015
0016 default_strips = '/store/data/Run2024A/ZeroBias/AOD/PromptReco-v1/000/378/869/00000/2ad791a1-c074-4129-a220-704ffec6e608.root'
0017
0018 process = cms.Process('RECODQM', Run3)
0019
0020 options = VarParsing.VarParsing()
0021
0022 options.register('globalTag',
0023 'auto:run3_data_prompt',
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.string,
0026 "Global Tag")
0027
0028 options.register('inputFiles',
0029 '',
0030 VarParsing.VarParsing.multiplicity.list,
0031 VarParsing.VarParsing.varType.string)
0032
0033 options.register('maxEvents',
0034 1000,
0035 VarParsing.VarParsing.multiplicity.singleton,
0036 VarParsing.VarParsing.varType.int)
0037
0038 options.register('dqm',
0039 0,
0040 VarParsing.VarParsing.multiplicity.singleton,
0041 VarParsing.VarParsing.varType.int)
0042
0043 options.register('strips',
0044 0,
0045 VarParsing.VarParsing.multiplicity.singleton,
0046 VarParsing.VarParsing.varType.int)
0047
0048 options.parseArguments()
0049
0050 fileList = [f'file:{f}' if not (f.startswith('/store/') or f.startswith('file:') or f.startswith('root:')) else f for f in options.inputFiles]
0051 if len(fileList)==0:
0052 if options.strips:
0053 fileList.append(default_strips)
0054 else:
0055 fileList.append(default_input)
0056
0057 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents))
0058 process.verbosity = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0059
0060
0061 process.MessageLogger = cms.Service("MessageLogger",
0062 cerr = cms.untracked.PSet(
0063 threshold = cms.untracked.string('INFO')
0064 )
0065 )
0066
0067
0068 process.load('Configuration.StandardSequences.Services_cff')
0069 process.load('FWCore.MessageService.MessageLogger_cfi')
0070 process.load('Configuration.EventContent.EventContent_cff')
0071 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0072
0073
0074 process.load("DQM.CTPPS.ctppsDQM_cff")
0075 process.ctppsDiamondDQMSource.excludeMultipleHits = cms.bool(True)
0076 process.ctppsDiamondDQMSource.plotOnline = cms.untracked.bool(True)
0077 process.ctppsDiamondDQMSource.plotOffline = cms.untracked.bool(False)
0078
0079
0080 process.load("DQM.Integration.config.environment_cfi")
0081 process.dqmEnv.subSystemFolder = "CTPPS"
0082 process.dqmEnv.eventInfoFolder = "EventInfo"
0083 process.dqmSaver.path = ""
0084 process.dqmSaver.tag = "CTPPS"
0085
0086
0087 process.source = cms.Source("PoolSource",
0088 fileNames = cms.untracked.vstring(
0089 fileList
0090 ),
0091 )
0092
0093
0094 from Configuration.AlCa.GlobalTag import GlobalTag
0095
0096 process.GlobalTag = GlobalTag(process.GlobalTag, options.globalTag)
0097
0098
0099 process.load("RecoPPS.Configuration.recoCTPPS_cff")
0100
0101
0102 process.ctppsProtonReconstructionPlotter = cms.EDAnalyzer("CTPPSProtonReconstructionPlotter",
0103 tagTracks = cms.InputTag("ctppsLocalTrackLiteProducer"),
0104 tagRecoProtonsSingleRP = cms.InputTag("ctppsProtons", "singleRP"),
0105 tagRecoProtonsMultiRP = cms.InputTag("ctppsProtons", "multiRP"),
0106
0107 rpId_45_F = cms.uint32(23),
0108 rpId_45_N = cms.uint32(3),
0109 rpId_56_N = cms.uint32(103),
0110 rpId_56_F = cms.uint32(123),
0111
0112 outputFile = cms.string("reco_protons_hist.root"),
0113 )
0114
0115 process.ctppsTrackDistributionPlotter = cms.EDAnalyzer("CTPPSTrackDistributionPlotter",
0116 tagTracks = cms.InputTag("ctppsLocalTrackLiteProducer"),
0117
0118 rpId_45_F = cms.uint32(23),
0119 rpId_45_N = cms.uint32(3),
0120 rpId_56_N = cms.uint32(103),
0121 rpId_56_F = cms.uint32(123),
0122
0123 outputFile = cms.string("reco_tracks_hist.root"),
0124 )
0125
0126 process.path = cms.Path(
0127 process.recoCTPPS
0128 )
0129
0130 process.end_path = cms.EndPath(
0131 process.ctppsTrackDistributionPlotter
0132 )
0133
0134 if not options.strips:
0135 process.end_path *= process.ctppsProtonReconstructionPlotter
0136
0137 if options.dqm:
0138 process.path *= process.ctppsDQMOfflineSource * process.ctppsDQMOfflineHarvest
0139 process.end_path *= process.dqmEnv * process.dqmSaver
0140
0141 process.schedule = cms.Schedule(
0142 process.path,
0143 process.end_path
0144 )