Beispiel #1
0
#!/usr/bin/env python3

import FWCore.ParameterSet.Config as cms
import Validation.RecoTau.DBSApi_cff as mydbs

dummy = cms.Source("PoolSource", fileNames=cms.untracked.vstring())
dataDict = {}
for key in mydbs.datasetDict.keys():
    mydbs.FillSource(key, dummy)
    dataDict[key] = [{'file': fname} for fname in dummy.fileNames]
    dummy.fileNames = cms.untracked.vstring()

toxml = {'dataFiles': dataDict}

outFile = open('SourcesDatabase.xml', 'w')
outFile.write(mydbs.DictToXML(toxml))
Beispiel #2
0
   elif options.eventType == "QCD":
      process.load("Configuration.Generator.QCDForPF_cfi")

# Run on a RECO (eg RelVal)
if options.dataSource.find('recoFiles') != -1:
   myFile = options.sourceFile
   if myFile == 'none':
      myFile = "Validation.RecoTau.sources.EventSource_%s_RECO_cff" % options.eventType
      #myFile = os.path.join(ReleaseBase, "Validation/RecoTau/test", "EventSource_%s_RECO_cff.py" % options.eventType)
   LoadDataCffFile(myFile)
   if len(process.source.fileNames) == 0 and not options.gridJob:
      import Validation.RecoTau.DBSApi_cff as mydbs
      if os.path.isfile('SourcesDatabase.xml'):
         print "Trying to retrieve the input files from SourcesDatabase.xml..."
         xml = open('SourcesDatabase.xml','r')
         mydbs.loadXML(xml,options.eventType,process.source)
      if len(process.source.fileNames) == 0:
         print "Accessing DBS to retrieve the input files..."
         mydbs.FillSource(options.eventType,process.source)
      if len(process.source.fileNames) == 0:
         sys.exit(0)
      print process.source
   # check if we want to rerun PFTau
   if options.dataSource.find('PFTau') != -1:
      process.load("Configuration.StandardSequences.Geometry_cff")
      process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
      process.load("Configuration.StandardSequences.MagneticField_cff")
      process.load("RecoTauTag.Configuration.RecoPFTauTag_cff")
      process.runPFTau = cms.Path(process.PFTau)
      process.schedule.append(process.runPFTau)
   if options.dataSource.find('CaloTau') != -1:
Beispiel #3
0
#                                    #
#       Data Source Setup            #
#                                    #
######################################

process.schedule = cms.Schedule()

readFiles = cms.untracked.vstring()
secFiles = cms.untracked.vstring()
process.source = cms.Source("PoolSource",
                            fileNames=readFiles,
                            secondaryFileNames=secFiles)

import Validation.RecoTau.DBSApi_cff as mydbs
print "Accessing DBS to retrieve the input files..."
mydbs.FillSource(options.eventType + 'DQM', process.source)

if len(process.source.fileNames) == 0:
    print "No"
    sys.exit(0)

print process.source

outputFileName = os.path.join(configDir, "DataSource_cff.py")
outputFile = open(outputFileName, 'w')
outputFile.write('import FWCore.ParameterSet.Config as cms\n')
outputFile.write('source = %s\n' % process.source)

# have to set max events here, since it may get written by the
# dataSource cffs
process.maxEvents = cms.untracked.PSet(