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