Example #1
0
# 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:
      process.load("Configuration.StandardSequences.Geometry_cff")
      process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
      process.load("Configuration.StandardSequences.MagneticField_cff")
Example #2
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))