raise RuntimeError(
        "Global tag not specified!  Try sourcing environment.sh\n")
else:
    print 'Using globalTag: %s' % options.globalTag

process.GlobalTag.globaltag = cms.string(options.globalTag)

# Count events at the beginning of the pat tuplization
process.load("FinalStateAnalysis.RecoTools.eventCount_cfi")
process.load("FinalStateAnalysis.RecoTools.dqmEventCount_cfi")

# Hack meta information about this PAT tuple in the provenance.
process.eventCount.uwMeta = cms.PSet(
    # The git commit
    commit=cms.string(fsa_version()),
    user=cms.string(get_user()),
    date=cms.string(time.strftime("%d %b %Y %H:%M:%S +0000", time.gmtime())),
)

process.schedule = cms.Schedule()

# Load all of our skim paths
process.load("FinalStateAnalysis.RecoTools.uwSkims_cfi")
# PAT tuplize all skim paths
for skim_path in process.skimConfig.paths:
    print "Building skim path:", skim_path
    the_path = getattr(process, skim_path)
    # Count every event, even the ones that fail the skim
    the_path.insert(0, process.eventCount)
    if options.isMC and not options.embedded:
        the_path.insert(0, process.dqmEventCount)
if options.globalTag == "":
    raise RuntimeError("Global tag not specified!  Try sourcing environment.sh\n")
else:
    print 'Using globalTag: %s'%options.globalTag

process.GlobalTag.globaltag = cms.string(options.globalTag)

# Count events at the beginning of the pat tuplization
process.load("FinalStateAnalysis.RecoTools.eventCount_cfi")
process.load("FinalStateAnalysis.RecoTools.dqmEventCount_cfi")

# Hack meta information about this PAT tuple in the provenance.
process.eventCount.uwMeta = cms.PSet(
    # The git commit
    commit = cms.string(fsa_version()),
    user = cms.string(get_user()),
    date = cms.string(time.strftime("%d %b %Y %H:%M:%S +0000", time.gmtime())),
)

process.schedule = cms.Schedule()

# Load all of our skim paths
process.load("FinalStateAnalysis.RecoTools.uwSkims_cfi")
# PAT tuplize all skim paths
for skim_path in process.skimConfig.paths:
    print "Building skim path:", skim_path
    the_path = getattr(process, skim_path)
    # Count every event, even the ones that fail the skim
    the_path.insert(0, process.eventCount)
    if options.isMC and not options.embedded:
        the_path.insert(0, process.dqmEventCount)