Back to home page

Project CMSSW displayed by LXR

 
 

    


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