#  //
# //  Actually make tarball & insert into workflow -- needed to do this after maker
# ||  is instantiated so that we have the workflow name to play with
#//

if tarupLib:
    
  tarball="%s.sandbox.tgz" % maker.workflowName
  systemcommand="tar -cvzf %s -C ../.. --wildcards --exclude=\"*.tgz\" --exclude \"*.root\" %s %s %s %s %s" % (tarball,CMSSWLibSubPath,CMSSWModuleSubPath,CMSSWSharePath,CMSSWSrcPath,CMSSWPythonPath)

  print "system command: %s" % systemcommand
  os.system(systemcommand)
#  systemcommand="mv ../%s ." % tarball
#  os.system(systemcommand)
  FullPathToTarfile=os.path.join(os.getcwd(),tarball)
  maker.setUserSandbox(FullPathToTarfile)
  print "Tarball %s inserted into workflow" % tarball

if selectionEfficiency != None:
    maker.addSelectionEfficiency(selectionEfficiency)


# loop over cfg's provided and add to workflow
# first cmsRun node created implicitly by WorkflowMaker
nodeNumber = 0
for cfgFile in cfgFiles:

    if cfgTypes[nodeNumber] == "cfg":
        from FWCore.ParameterSet.Config import include
        cmsCfg = include(cfgFile)
    else: