Exemplo n.º 1
0
from WMCore.Configuration import Configuration
config = Configuration()
config.section_("General")
config.General.requestName = 'WJets2'
config.General.transferLogs = True

config.section_("JobType")
config.JobType.pluginName = 'Analysis'
config.JobType.sendExternalFolder = True  #  = 'Analysis'
#config.JobType.sendExternalFolder = True
config.JobType.inputFiles = [
    'L1PrefiringMaps_new.root',
    'Summer16_07Aug2017_V11_MC_L1FastJet_AK4PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L2Relative_AK4PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L3Absolute_AK4PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L1FastJet_AK8PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L2Relative_AK8PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L3Absolute_AK8PFchs.txt',
    'Summer16_07Aug2017_V11_MC_L1FastJet_AK8PFPuppi.txt',
    'Summer16_07Aug2017_V11_MC_L2Relative_AK8PFPuppi.txt',
    'Summer16_07Aug2017_V11_MC_L3Absolute_AK8PFPuppi.txt',
    'Summer16_07Aug2017_V11_MC_L1FastJet_AK4PFPuppi.txt',
    'Summer16_07Aug2017_V11_MC_L2Relative_AK4PFPuppi.txt',
    'Summer16_07Aug2017_V11_MC_L3Absolute_AK4PFPuppi.txt'
]
#config.JobType.inputFiles=['L1PrefiringMaps_new.root','PHYS14_25_V2_All_L1FastJet_AK4PFchs.txt','PHYS14_25_V2_All_L2Relative_AK4PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK4PFchs.txt','PHYS14_25_V2_All_L1FastJet_AK8PFchs.txt','PHYS14_25_V2_All_L2Relative_AK8PFchs.txt','PHYS14_25_V2_All_L3Absolute_AK8PFchs.txt']
# Name of the CMSSW configuration file
#config.JobType.psetName    = 'bkg_ana.py'
config.JobType.psetName = 'analysis.py'
#config.JobType.allowUndistributedCMSSW = True
config.JobType.allowUndistributedCMSSW = True
Exemplo n.º 2
0
            '/SingleElectron/Run2016H-03Feb2017_ver2-v1/MINIAOD',
            '/SingleElectron/Run2016H-03Feb2017_ver3-v1/MINIAOD'
    ]:
        datasetSplit = dataset.split('/')
        datasetName = datasetSplit[1] + "_" + datasetSplit[2]
        #NOTE: need to bind by value, not by reference
        myJobs[datasetName] = [
            lambda cfg, dataset=dataset: setattr(cfg.Data, "inputDataset",
                                                 dataset),
            lambda cfg, datasetSplit=datasetSplit: setattr(
                cfg.Data, "outputDatasetTag", datasetSplit[2] + "_" + cfg.Data.
                outputDatasetTag), lambda cfg, datasetSplit=datasetSplit: cfg.
            JobType.pyCfgParams.append("isData=True")
        ]

configTmpl = Configuration()

configTmpl.section_('General')
configTmpl.General.transferOutputs = True
configTmpl.General.transferLogs = False

configTmpl.section_('JobType')
configTmpl.JobType.psetName = "XTag/LLPSpecific/test/produce_80X_NANOX.py"
configTmpl.JobType.pluginName = 'Analysis'
configTmpl.JobType.outputFiles = ['nano.root']
configTmpl.JobType.maxJobRuntimeMin = 22 * 60
configTmpl.JobType.pyCfgParams = []
configTmpl.JobType.inputFiles = ['QGL_cmssw8020_v2.db']

configTmpl.section_('Data')
configTmpl.Data.inputDataset = ""
Exemplo n.º 3
0
from WMCore.Configuration import Configuration
import re
import socket

myhost = socket.getfqdn().lower()

conf = Configuration()
main = conf.section_('main')
srv = main.section_('server')
srv.thread_pool = 5
main.application = 'crabserver'
main.port = 8270
main.index = 'data'

main.authz_defaults = { 'role': None, 'group': None, 'site': None }
main.section_('tools').section_('cms_auth').key_file = "%s/auth/wmcore-auth/header-auth-key" % __file__.rsplit('/', 3)[0]

app = conf.section_('crabserver')
app.admin = '*****@*****.**'
app.description = 'CRABServer RESTFull API'
app.title = 'CRABRESTFull'

views = conf.section_('views')

data = views.section_('data')
data.object = 'CRABInterface.RESTBaseAPI.RESTBaseAPI'
data.phedexurl = 'https://cmsweb.cern.ch/phedex/datasvc/xml/prod/'
data.dbsurl = 'http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet'
data.defaultBlacklist = ['T0_CH_CERN']
data.serverhostcert = "%s/auth/crabserver/dmwm-service-cert.pem" % __file__.rsplit('/', 3)[0]
data.serverhostkey = "%s/auth/crabserver/dmwm-service-key.pem" % __file__.rsplit('/', 3)[0]
Exemplo n.º 4
0
    def testB(self):
        """add settings"""
        config = Configuration()
        config.section_("Section1")

        section1 = getattr(config, "Section1", None)
        self.assertTrue(section1 != None)

        config.section_("Section2")
        section2 = getattr(config, "Section2", None)
        self.assertTrue(section2 != None)

        self.assertRaises(AttributeError, getattr, config, "Section3")

        # basic types
        config.Section1.Parameter1 = True
        config.Section1.Parameter2 = "string"
        config.Section1.Parameter3 = 123
        config.Section1.Parameter4 = 123.456

        self.assertEqual(config.Section1.Parameter1, True)
        self.assertEqual(config.Section1.Parameter2, "string")
        self.assertEqual(config.Section1.Parameter3, 123)
        self.assertEqual(config.Section1.Parameter4, 123.456)

        # dictionary format:
        try:
            section1Dict = config.Section1.dictionary_()
        except Exception as ex:
            msg = "Error converting section to dictionary:\n"
            msg += "%s\n" % str(ex)
            self.fail(msg)

        self.assertTrue( "Parameter1" in section1Dict)
        self.assertTrue( "Parameter2" in section1Dict)
        self.assertTrue( "Parameter3" in section1Dict)
        self.assertTrue( "Parameter4" in section1Dict)

        self.assertEqual(section1Dict['Parameter1'],
                         config.Section1.Parameter1)
        self.assertEqual(section1Dict['Parameter2'],
                         config.Section1.Parameter2)
        self.assertEqual(section1Dict['Parameter3'],
                         config.Section1.Parameter3)
        self.assertEqual(section1Dict['Parameter4'],
                         config.Section1.Parameter4)

        # compound types
        config.Section2.List = ["string", 123, 123.456, False]
        config.Section2.Dictionary = { "string" : "string",
                                       "int" : 123,
                                       "float" : 123.456,
                                       "bool" : False}
        config.Section2.Tuple = ("string", 123, 123.456, False)


        self.assertEqual(config.Section2.List,
                         ["string", 123, 123.456, False])
        self.assertEqual(config.Section2.Tuple,
                         ("string", 123, 123.456, False))

        class DummyObject:
            pass
        # unsupported parameter type
        self.assertRaises(
            RuntimeError, setattr,
            config.Section2, "BadObject", DummyObject())
        # unsupported data type in compound type
        badList = [ DummyObject(), DummyObject()]
        self.assertRaises(
            RuntimeError, setattr,
            config.Section2, "BadList", badList)

        badDict = { "dict" : {}, "list": [DummyObject()], "tuple" : () }
        self.assertRaises(
            RuntimeError, setattr,
            config.Section2, "BadDict", badDict)

        goodDict = { "dict" : {}, "list": [], "tuple" : () }
        config.Section2.GoodDict = goodDict