Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:14:47

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 # Setup 'standard' options
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 #                 "/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60007/869EE593-1FAB-E511-AF99-0025905A60B4.root",
0037 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60009/0C35C6BF-D3AA-E511-9BC9-0CC47A4C8E16.root',
0038 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60009/38B847F9-05AA-E511-AB78-00259074AE82.root',
0039 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60009/D0BAD20B-09AB-E511-B073-0026189438F6.root',
0040 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60009/DEFA8704-CCAA-E511-8203-0CC47A4D7634.root',
0041 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/60009/FE24690A-2DAA-E511-A96A-00259074AE3E.root',
0042 #                  '/store/data/Run2015D/ZeroBias/ALCARECO/SiStripCalMinBias-16Dec2015-v1/00000/0443D984-F9BA-E511-A740-0025905B8610.root',
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 # To use the prompt reco dataset please use 'generalTracks' as inputCollection
0064 # To use the cosmic reco dataset please use 'ctfWithMaterialTracksP5' as inputCollection
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') #event Info
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 #process.source = cms.Source (
0099 #    "PoolSource",
0100 #    fileNames = cms.untracked.vstring(options.inputFiles)
0101 #    )
0102 
0103 #import runs
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 #definition of input collection
0123 process.CalibrationTracks.src = cms.InputTag( options.inputCollection )
0124 process.shallowTracks.Tracks  = cms.InputTag( options.inputCollection )
0125 #process.shallowGainCalibrationAllBunch   = 'ALCARECOSiStripCalMinBias' #cms.InputTag( options.inputCollection )
0126 #process.shallowGainCalibrationAllBunch0T = 'ALCARECOSiStripCalMinBias' #cms.InputTag( options.inputCollection )
0127 
0128 #Setup prescale
0129 process.prescaleEvent.prescale = 1
0130 
0131 
0132 # BSCNoBeamHalo selection (Not to use for Cosmic Runs) --- OUTDATED!!!
0133 ## process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
0134 ## process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
0135 
0136 ## process.L1T1=process.hltLevel1GTSeed.clone()
0137 ## process.L1T1.L1TechTriggerSeeding = cms.bool(True)
0138 ## process.L1T1.L1SeedsLogicalExpression = cms.string('(40 OR 41) AND NOT (36 OR 37 OR 38 OR 39)')
0139 
0140 #process.TkCalPath = cms.Path(process.L1T1*process.TkCalFullSequence)
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 )