File indexing completed on 2024-11-25 02:29:11
0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 from CalibTracker.SiStripCommon.shallowTree_test_template import *
0004
0005
0006
0007
0008 options = VarParsing.VarParsing()
0009
0010 options.register('conditionGT',
0011 "auto:run2_data",
0012 VarParsing.VarParsing.multiplicity.singleton,
0013 VarParsing.VarParsing.varType.string,
0014 "condition global tag for the job (\"auto:run2_data\" is default)")
0015
0016 options.register('conditionOverwrite',
0017 "",
0018 VarParsing.VarParsing.multiplicity.singleton,
0019 VarParsing.VarParsing.varType.string,
0020 "configuration to overwrite the condition into the GT (\"\" is default)")
0021
0022 options.register('inputCollection',
0023 "ALCARECOSiStripCalMinBias",
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.string,
0026 "collections to be used for input (\"ALCARECOSiStripCalMinBias\" is default)")
0027
0028 options.register('outputFile',
0029 "calibTreeTest.root",
0030 VarParsing.VarParsing.multiplicity.singleton,
0031 VarParsing.VarParsing.varType.string,
0032 "name for the output root file (\"calibTreeTest.root\" is default)")
0033
0034 options.register('inputFiles',
0035
0036
0037
0038
0039
0040
0041
0042 '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-14Apr2016-v1/50000/0085DB76-AC02-E611-9F0C-0002C94CD12E.root',
0043 VarParsing.VarParsing.multiplicity.list,
0044 VarParsing.VarParsing.varType.string,
0045 "file to process")
0046
0047 options.register('maxEvents',
0048 -1,
0049 VarParsing.VarParsing.multiplicity.singleton,
0050 VarParsing.VarParsing.varType.int,
0051 "number of events to process (\"-1\" for all)")
0052
0053 options.register('runNumber',
0054 -1,
0055 VarParsing.VarParsing.multiplicity.singleton,
0056 VarParsing.VarParsing.varType.int,
0057 "run number to process (\"-1\" for all)")
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 options.parseArguments()
0068
0069 print("conditionGT : ", options.conditionGT)
0070 print("conditionOverwrite: ", options.conditionOverwrite)
0071 print("inputCollection : ", options.inputCollection)
0072 print("maxEvents : ", options.maxEvents)
0073 print("outputFile : ", options.outputFile)
0074 print("inputFiles : ", options.inputFiles)
0075 print("runNumber : ", options.runNumber)
0076
0077
0078 process = cms.Process('CALIB')
0079 process.load('CalibTracker.Configuration.setupCalibrationTree_cff')
0080 process.load('Configuration/StandardSequences/MagneticField_cff')
0081 process.load('Configuration.Geometry.GeometryRecoDB_cff')
0082 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0083 process.load('CalibTracker.SiStripCommon.ShallowEventDataProducer_cfi')
0084
0085
0086
0087 from Configuration.AlCa.GlobalTag import GlobalTag
0088 process.GlobalTag = GlobalTag(process.GlobalTag, options.conditionGT, options.conditionOverwrite)
0089
0090 process.load('FWCore.MessageService.MessageLogger_cfi')
0091 process.load('Configuration.StandardSequences.Services_cff')
0092 process.add_( cms.Service( "TFileService",
0093 fileName = cms.string( options.outputFile ),
0094 closeFileFast = cms.untracked.bool(True) ) )
0095
0096 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0097
0098
0099
0100
0101
0102
0103 if options.runNumber == -1:
0104 process.source = cms.Source (
0105 "PoolSource",
0106 fileNames = cms.untracked.vstring( options.inputFiles )
0107 )
0108 else:
0109 print("Restricting to the following events :")
0110 print('%s:1-%s:MAX'%(options.runNumber,options.runNumber))
0111 process.source = cms.Source (
0112 "PoolSource",
0113 fileNames = cms.untracked.vstring( options.inputFiles ),
0114 eventsToProcess = cms.untracked.VEventRange('%s:1-%s:MAX'%(options.runNumber,options.runNumber))
0115 )
0116
0117
0118 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0119 process.MessageLogger.cerr.FwkReport.reportEvery = 10000
0120
0121
0122 process.CalibrationTracks.src = cms.InputTag( options.inputCollection )
0123 process.shallowTracks.Tracks = cms.InputTag( options.inputCollection )
0124
0125
0126
0127
0128 process.prescaleEvent.prescale = 1
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141 process.eventInfo = cms.EDAnalyzer(
0142 "ShallowTree",
0143 outputCommands = cms.untracked.vstring(
0144 'drop *',
0145 'keep *_shallowEventRun_*_*',
0146 )
0147 )
0148
0149
0150
0151 process.TkCalPath_StdBunch = cms.Path(process.TkCalSeq_StdBunch *process.shallowEventRun*process.eventInfo)
0152 process.TkCalPath_StdBunch0T = cms.Path(process.TkCalSeq_StdBunch0T *process.shallowEventRun*process.eventInfo)
0153 process.TkCalPath_IsoMuon = cms.Path(process.TkCalSeq_IsoMuon *process.shallowEventRun*process.eventInfo)
0154 process.TkCalPath_IsoMuon0T = cms.Path(process.TkCalSeq_IsoMuon0T *process.shallowEventRun*process.eventInfo)
0155 process.TkCalPath_AagBunch = cms.Path(process.TkCalSeq_AagBunch *process.shallowEventRun*process.eventInfo)
0156 process.TkCalPath_AagBunch0T = cms.Path(process.TkCalSeq_AagBunch0T *process.shallowEventRun*process.eventInfo)
0157
0158
0159 process.schedule = cms.Schedule( process.TkCalPath_StdBunch,
0160 process.TkCalPath_StdBunch0T,
0161 process.TkCalPath_IsoMuon,
0162 process.TkCalPath_IsoMuon0T,
0163 process.TkCalPath_AagBunch,
0164 process.TkCalPath_AagBunch0T,
0165 )
0166
0167
0168 process.options = cms.untracked.PSet(
0169 Rethrow = cms.untracked.vstring('OtherCMS',
0170 'StdException',
0171 'Unknown',
0172 'BadAlloc',
0173 'BadExceptionType',
0174 'ProductNotFound',
0175 'DictionaryNotFound',
0176 'InsertFailure',
0177 'Configuration',
0178 'LogicError',
0179 'UnimplementedFeature',
0180 'InvalidReference',
0181 'NullPointerError',
0182 'NoProductSpecified',
0183 'EventTimeout',
0184 'EventCorruption',
0185 'ScheduleExecutionFailure',
0186 'EventProcessorFailure',
0187 'FileInPathError',
0188 'FileOpenError',
0189 'FileReadError',
0190 'FatalRootError',
0191 'MismatchedInputFiles',
0192 'ProductDoesNotSupportViews',
0193 'ProductDoesNotSupportPtr',
0194 'NotFound')
0195 )